Fixing Tuya integration in Home Assistant after free subscription expires
- Jorge Morán
- Homelab , Home assistant
- February 11, 2024
- 3 min
On February 2nd I noticed that all my Tuya devices and automations in Home Assistant had stopped working. Initially, I thought it was probably a cloud issue because normally the Tuya integration is not local, it connects to a remote server every time.
That led me to the path of trying to use the Home Assistant Community Store (HACS) to install Local Tuya . That didn’t work either because my access to IoT Core (a Tuya Cloud Service) had expired.
I frantically started to search online about what to do, then I ran into this GitHub issue. The TL;DR is that I was not alone, and many people were facing the same issue.
To fix the problem, I had to ask for an extension so that my trial plan was enabled again. First I had to visit Tuya’s site. Then, I proceeded to open my API project, and in the Service API tab, searched for IoT Core.
On that page, we can click on the View Details link on IoT Core’s row, upon doing that we’ll get additional information about the plan we have. In my case, it was already renewed, but on the GitHub issue I linked, you’ll find out how it looks. You should see a link that says Extend Trial Period.
My screenshot already says that my application is approved, so you know what to look out for after you send your request. However, just so you get an idea about what to say in your extension request, here’s what I said:
It doesn’t take long for them to respond. In my case, it took less than a day even though I sent my request on a weekend.
After the approval, you might have to unlink your Tuya app account from the project on Tuya’s IoT Platform website, but in my case, it wasn’t necessary.
I didn’t want to risk going through this problem again so I proceeded to configure Local Tuya now that my API integration was working. In retrospect, before Local Tuya commands to devices were laggy, they used to take more than a second. Now, everything turns on and off instantaneously.
To make the migration a bit easier, visit the Devices page to get the Device IDs of all our devices. They should have nice Device Names which are the ones we configured when we linked them to our Tuya app. We need to be careful about selecting the right data center on the top right corner of the screen. In my case, it is Western America Data Center.
Now that we have our devices, let’s visit the API explorer page to query Device Details. The parameter for that endpoint is our Device ID.
After calling the endpoint with our Device ID, among the response fields we’ll find one called local_key. That and the Device ID are two of the most important fields we’ll need in Local Tuya.
To summarize, it can be annoying when our access to Tuya’s API expires, but luckily they have made it super easy to request an extension. However, I don’t know if in the future they’ll stop granting extensions, so Local Tuya might let us keep using our devices even if the cloud service does not give us access.