LocalTuya: Device pairing broken

We have four “Skyfan” DC ceiling fans with their little Tuya IOT dongle in them, and for the most part we’ve been pretty happy with them, except at some point recently we noticed that the “fan speed control” portion of Duncan’s was missing. Everything else was fine, and I’d tried a couple of times to fix it to no avail.

Today during a break from work (I’m off early, so I can go back for a meeting with the EU team tonight), I decided damn it, I’m gonna fix this no matter what. I decided to delete the device completely from Home Assistant, which I felt reasonably safe doing because I possess a copy of the local_key from the debug output right?

Umm, no, wrong. That value appears to be something else, it’s very different from what’s actually the key, as I would later learn. Furthermore, it looks like at some point Tuya rescinded the permanent free access to their API, so now none of the API stuff is working. The forum post I’ll reference later suggests that this stopped working around June 2022, but we definitely added devices in November/December of 2023 so not sure what to make of that.

Anyway, that inability to use their API to snatch the local keys meant I’m stuck with a fan I can’t re-add to home assistant. Worse still, I backed up the configuration, but not the bloody database, so I can’t even dig the key out of there! Whoops!

I was almost mad enough to consider burning the Tuya shit (which this event notwithstanding, we’ve not had too much trouble with for the most part) to the ground, flashing what I could with Tasmota, replacing the Tuya modules for the Skyfans with an aftermarket ESPHome one, and calling it a day.

But thankfully for my wallet, I found a HAss forum post that mentioned you can periodically reactivate the API service, which appears to have worked. It didn’t work immediately, but I then tried reactivating the “Core IOT” service which required a bunch more information and required “review”, but it started working at some point after that.

I quickly added the fan back to HAss, added the missing speed DP (which was there this time) and we’re back to working. But I’m still pretty fucking mad, and I may still look at migrating shit away from Tuya yet.

Horsham, VIC, Australia fwaggle

Published:


Modified:


Filed under:


Location:

Horsham, VIC, Australia

Navigation: Older Entry Newer Entry