Tuya smart plug state not recognized in Home Assistant, plus other issue

Hi,

First time Home Assistant user here, just installed it on a Windows VM to try to get some more functionality out of my smart switches.

One main reason is I have a switch I’d like to log activity on, primarily for troubleshooting.

It’s a Tuya controlled switch. This particular one has a “circulate” function, when it can turn on for “x” minutes, then turn off for “y” minutes, which can come on at set times. I’m unsure if it’s actually doing that, outside of Home Assistant.

I was successful in pairing Tuya to Home Assistant through these instructions:

One issue is “IoT Data Analytics” is not appearing on the API list. There is one called “Data Dashboard Service” which has IoT Data Analytics in the description, so maybe it was renamed?

All Tuya devices do show up in HA so that was successful at least.

Several problems:

  1. If I turn on the switch through the Tuya app, Home Assistant doesn’t recognize it’s on. Is this a polling issue or a sign of another problem?

  2. Perhaps part of the same issue, HA is not able to accurately list the state of any of the switches/lights in Tuya. They seem to be stuck at some earlier point in time.

  3. If I try to turn on a switch in HA, it will turn on. But then the switch, in HA, visibly toggles back to OFF. However, the switch is still in the ON position.

  4. Conversely, if a switch shows ON in HA, I can turn it off in HA. But then the switch visibly toggles back to ON. However, the switch is still in the OFF position.

  5. Perhaps obviously, history logging is following what HA thinks is happening, not what the actual state of each switch is.

  6. Light switch in Tuya has the same issues as the smart plugs.

Hoping someone can help direct me in the right direction. Thank you.

Version info:

Home Assistant Core 2022.5.5

Home Assistant Supervisor 2022.05.3

Home Assistant OS 8.1

Kernel version 5.15.41

Agent version 1.2.1

EDIT:
I’ve tried removing and re-added the Tuya integration. Same issue.
EDIT2:
Found this thread: Tuya; delayed/missing state updates: Confirmed Tuya Cloud issue, awaiting upstream fix · Issue #60034 · home-assistant/core · GitHub
It was shut down and I don’t see a resolution.

It appears you are not alone. Tuya - Status not updating · Issue #67398 · home-assistant/core · GitHub

I wouldn’t buy one of their devices myself, not unless it is zigbee and I can get out of the tuya ecosystem.

1 Like

Thanks for finding that latest link. I could find the closed ones, and some very very old threads, but not the latest. Seems like this is a very prevalent, ongoing issue with this particular ecosystem.

I just tried localtuya, but since I have my Tuya devices on an isolated VLAN, I wasn’t able to link the devices. May just wait to see if anyone comes up with a usable fix.

have the same problem. Reverted to 2022.4 for now.

Did this help fix it?

EDIT: It did not, for me, after reverting the core to 2022.4.6.
EDIT2: Nor did moving up to 2022.6.1

Replying to myself just in case others run into this problem.

In retrospect, my issue may have been the fact that I run my IOT devices on an IOT-specific VLAN, firewalled away from my main network.

I ditched my prior virtual installation and purchased a HA Green. But right after installing, I opened access to its IP address for all IOT VLAN devices.

I had thought those devices would send data to Tuya’s servers, and then HA would poll those servers, so no direct in/out LAN access was needed, but maybe there is necessary local data transfer within my LAN.

(I’ve had similar issues with a net-connected AVR only receiving/sending certain data/instructions to a phone app, HEOS to be specific. Opening up that VLAN solved it).