Tuya devices state not updating properly

They seem to have fixed it. Working good for me too

Still wasn’t working - I reverted to 2021.05.

I have the same problem, but found a workaround: Disable IPv6 in Supervisor → Host → Ip-Adress .
When setting the logger for tuya/tuya_iot to DEBUG you will notice, that there is often missing the PUBLISH answer from tuya after a POST of the switch-command. When IPv6 is disabled this happens nearly never.

5 Likes

This definatley fixes the problem, state changes are instant now.

2 Likes

Disabling IPV6 works for me too! Thanks

I had the same problem with tuya smart switches. My solution to this problem is explained in my post

https://community.home-assistant.io/t/local-tuya-help/370427/12?u=dadopq

For now this is working. I’m testing things out but for now there is no problem. If anyone is willing to test this on his setup, please do.

Update: Sorry, disabling IPv6 seems to be not reliable. It was okay when I first configured it but later in the day I noticed that HomeAssistant was not showing the true state. Reloading Tuya integration corrects the states, but then it is is not permanent.

Previous comment:
Disabling IPv6 was the fix for me too! Kudos @Peter_Junker !
For those who use container (with docker compose) like me, I just disabled the IPv6 of the host device (Pi, method 2 here) then reboot it. External state updates are now instantly displayed on homeassistant.

Dont disable ipv6 . In my experience it wont solve any problems but it will generate a lot of problems. This isnt way for solving problems.

agree! it´s only a temp workaround.

For me, it still works.

can you elaborate, what problems? what used IPv6 over IPv4?

As most people I also tried disabling ipv6. I think I wrote in some thread that this solved some my problem but it didnt. I’m not professional sysadmin nor programmer so I can’t elaborate on that matter from networking point of view, but in my experience this doesnt solve any problems.
I forgot what problems I tried to solved, I think it was some dns issue, but the problem wasnt ipv6. It was my dns miss configuration.

I like to share my fix or workaround for this issue.

Im not shure if i have granted the API Permissions correctly when i have setup the integration.
After i added the “Data Dashbord Service” on the “Service API” site of Tuya, the switch states are allways in the correct state.

2 Likes

I’d like to share my solution to the problem.

When i created the Project in the Tuya Development Environment i accidentally selected Development Type “Custom” instead of “Smart Home”.

Unfortunately you can’t change that after you created the Project so you need to create a whole new Project and make sure to set the Development Type to Smart Home.

This is wrong:

This is correct:

3 Likes

This worked for me. Thanks! :grinning:

I fixed it using the Smart Live App username and password on home assistant tuya integration setup, and not the user created for the associated project in tuya iot.

1 Like

As I had (what looked like) the same issue.
Loggin into my Tuya account seemed to have fixed all the problems for me…

thx for sharing!

Im having the same issue - tuya switches are not updating thier state in HA. Whats the best work around?

use tuya-local?

Thinking of trying that. I’m new to HA, is there a guide out there for local tuya setup? I noticed its not listed under the HA integrations.

It is available under HACS
see also GitHub - rospogrigio/localtuya: local handling for Tuya devices