Fixing Tuya integration in Home Assistant after free subscription expires

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.

Finding IoT Core
Finding IoT Core API

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.

Requesting extension of IoT Core API
Requesting extension of IoT Core API

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:

Extension request form
Extension request form

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.

Listing our Tuya devices
Listing our Tuya devices

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.

Getting Local Key for Local Tuya
Getting Local Key for Local Tuya

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.

Related Posts

Forensics Beginner Challenges Part 3 of 3

Forensics Beginner Challenges Part 3 of 3

Let’s start the third and final installment of this series about solving forensics beginner challenges.

Read More
Rotating Guest Password of an Omada Controller's SSID With a Script

Rotating Guest Password of an Omada Controller's SSID With a Script

I used to have a captive portal in my house for guests, but it was tedious to hand out individual passwords, and keeping track of the newly generated passwords was not the best experience management-wise.

Read More
Managing a Hugo Site as a Web CMS

Managing a Hugo Site as a Web CMS

In this post, we’ll create a web-based management tool to create posts on a Hugo blog, to do this, we’ll use Docker to deploy a VSCode Server instance with Caddy as a reverse proxy.

Read More