Tuya v2 does not refresh states of entities

Hello,

I am new to home assistant and I am a total beginner.

I tried to integrate my Tuya-devices with the Tuya v2 integration.
So far I installed Tuya v2 using HACS, I can see all my Plugs and I am able to set them up in the Lovelace.

I can switch all of them on or off (but only one time). Afterwards the entity does not refresh the state (I can’t see the new state, the switch turns back to the previous position) and I can’t trigger the switch again.

Only if I restart Home Assistant the entities we’re refreshed and I can trigger them again.

Can someone help me with this?

I am using Home Assistant 2021.9.6
HACS v.1.15.2
Tuya v2 v.1.5.0

If you need any further information, please let me know.

Thank you
danny1989

1 Like

I also have the exact same issue after updating to 2021.10 with the new tuya integration. If anyone knows why this is please let me know.

If you can control your devices, but states or not being properly reported, there is chance you didn’t properly authorize the “Device Status Notification” API.

You can still check (and add) this now though. Go to you Tuya developer account, click on “Cloud → Development → your HA project” and check the service API. Make sure you have the Device Status Notification authorized.

1 Like

Thank you so much that fixed the issue. Additionally i noticed that my garage door opener is not being detected through the new tuya api. I have it working fine through local tuya right now so its not that big of a deal but would there need to be an additional service API i need for that to work as well? This is the garage opener I am currently using.
https://www.amazon.com/gp/product/B086MKP14K/ref=ppx_yo_dt_b_search_asin_title?ie=UTF8&th=1

I am having the same issue with Entity states not being refreshed. If I restart HA they then reflect the current Entity state. I have checked and have the Device Status Notification API authorised.

I can control them fine through HA though. Running core-2021.10.1

Any suggestions?

I am having the same issue,
Tuya v2 integration will initially get device state on reboot, but will not update again.
The Device Status Notification service is enabled for the project.

1 Like

Exact the same issue,
Tuya v2 integration will initially get device state on reboot, but will not update again.
The Device Status Notification service is enabled for the project.
I’m running HA core-2021.11.4

1 Like

Same Issue for me, seems to have only cropped up in the past few days, was working fine before that.

I am also on Core 2021.11.4

I have the same problem in 2021.11.4. I changed to version 2021.11.2 and the status update works again.

I rolled back to 2021.11.2 and it hasn’t resolved it for me. So it may be Tuya related.

Could those posting their issues in this thread please add any further relevant information to this GitHub issue?

If you don’t have specific information to add, just give a thumbs up to the initial report.

1 Like

If it helps i’ve rolled back to both 11.2 and 11.1 and the issue still exists to me so my guess is the issue is on Tuya side.

Same here with Home Assistant 2021.11.5 and 2 pieces of Tuya - WiFi smart plugs (managed with SmartLife mobile app).

If I reload the Tuya integration in the integrations page of HA the states become correct as in case when we restart HA. But without them state reporting is wrong.

I tried to debug with Tuya IoT debug features, and there the states are defenitely correct.

So summarized:

  • Tuya - IoT console have good states.
  • HA has also good states immediately after restart
  • HA has also good states after reload Tuya integration

We have wrong states just meanwhile we use HA, not before and not after :slight_smile:

Hey,

sry guys for not answering.

This was what I needed to get my devices work properly.
Thank you very much.

This worked for me for the last couple of weeks.
But now there is a new problem…

For some days my devices will not update its states immediately.
e.g. I have 6 smart plugs. When I switch them on/off, the states (just on my HA dashboard) do sometimes refresh and sometimes not. The switches itself are triggerd. This happens randomly to all of them and is not linked to any specific plug.
I have to trigger the switches (via HA) up to 5-10 times again until it switches its state. But even that doesn’t work 100%.
If I don’t try to synchronize the states, the switches will not turn on/off with any automated script.

Thank you for any helpful hints on this issue.

danny1989

2 Likes

Same here for me both on Tuya V2 and Tuya built in integration

Just to add that the devs are aware of this and working on a solution.

You can follow this issue on GitHub for updates on the latest developments.

1 Like

I have the current Ha updates and I see Tuya devices stopped working. As soon as I go to Integrations… Tuya and do ‘Update’ everything works correctly. Maybe if I could do an automated ‘Update’ it would stay working. I tried to follow the first post in this thread but I think they moved things around on the Tuya Development site as mine looks nothing like the above screen shot

How do you do this? I see no ‘Update’ option under integrations.

Tuya switch state in HA is just, broken.

I would not recommend a Tuya device to anyone who needs any sort of consistent reliable operation via Home Assistant.

I experience something truly annoying with the tuya cloud : I’m testing a power strip with the tuya integration. I can control the outlet independently in HA but, often I have to “reload” the Tuya integration to “refresh” or “re-establish” the connection between HA and the Tuya cloud service.

For exemple, I have widgets for each outlets on my Pixel 6 and I can turn them on but when I try to turn them off neither the widgets or the Tuya integration works. I have to reload the integration or open the tuya smart life app in order to turn off the outlets (seems like the integration doesn’t include the control all outlets in one service like in the tuya smart life app)

2 Likes