Tuya lights/switches delay in updating states, is it only me?

Same for me… response time can take up to 2~5 min.
But Tuya local integration shows the state changes instantly.

1 Like

I thought I had authorized “Device Status Notification” but it was not. Authorized, restarted HA, and now Tuya appears to be working correctly again.
Follow this instructions carefully and be sure you have authorized the “Device Status Notification” API for your service:

Wondering if the Tuya integration would be able to provide an error message in the log if the “Device Status Notification” has not been authorized.

2 Likes

I checked it again and i have authorized the “device status notification”. Also the region and tuya server is right. Still not working and it feels as if it is getting worse. I have two power sockets that show no changes at all until i restart the tuya integration. At the moment it is very frustrating! It was working so well and fast but now it is really unusable.

I had a look at my Tuya settings, and updated my projects data center to western Europe ( I did have it set to central ). Then I unauthorised and re-authorised Device Status, then restarted core on HA.

There’s still a nasty lag of anywhere between 5 - 20 seconds to receive the status in lovelace.

I will monitor to see if it’s improved any ( e.g. not updating the status at all )

After playing around, I would say, for me it’s moderately better ( I think western Europe was the correct setting for me but I did have central Europe selected in my project) but still rubbish for anyone relying on device status updates.

As a temp workaround until they fix this, if it’s not a hassle, give the HACs Local Tuya a try. It works perfectly for me for the basic light and switch functions that I need.

Didn’t take me that long to add my devices and the device keys can be pulled from the Tuya IoT developer portal using the API tool Device details request.

I can’t believe there still hasn’t been any communication from any of the devs or tuya on this.

fyi…your original issue was not getting any device status updates because you didn’t authorize that API service…everyone elses issue is the device status updates are slow, or not coming through intermittingly / timing out.

fyi - The HA devs are aware. Frenck has posted on this reported git bug in the comments :

If you like the issue, as suggested by Frenck, it will likely increase the priority of the issue and demonstrate a lot of people are hitting it. No point posting a comment if your symptoms are the same…just like it.

fyi…I don’t think its a straight up simple code fix on the backend or frontend of HA. Its more likely a combination of Tuya API responses suddenly taking longer than normal and not coming back at all in some cases.

Look here, if I set Tuya base to debug , and toggle a switch / lamp :

2021-11-23 11:24:27 DEBUG (SyncWorker_2) [homeassistant.components.tuya.base] Sending commands for device 27845426dc4f22a75a16: [{'code': <DPCode.SWITCH_1: 'switch_1'>, 'value': False}]

A full 8 seconds later in the log :

2021-11-23 11:24:35 DEBUG (Thread-6) [homeassistant.components.tuya] Received update for device 27845426dc4f22a75a16: {'switch_1': False, 'countdown_1': 0}

Sometimes, no response is received at all.

A tcpdump will indicate where the delay is being induced. I’ll be going there next.

1 Like

I spent the afternoon yesterday changing all my lights and switches to tuya local. Think I’ll just stick with this now.

1 Like

Yes, I’ve also just switch over to local tuya as well. It took me a substantial amount of time with 60+ lights, switches and cover but all is good now. The response is unbelievable fast.

New Tuya integration is not working as it should for now. State changes are extremely slow on HA side and due to that automations are not working as they should. I have also installed Local Tuya a month ago and still using it. It works the way it should. I would recommend people to try that until there is a fix on Tuya side.

Hi guys, we are working hard on fixing the slow response issue and will inform everyone once it’s fixed. Sorry for the inconvenience!

8 Likes

Thanks Oliver, great to hear that it is been worked on. It is such response that the community need and timely updates. Home automation has been such an integral part of our lives which we are depend on. Please keep us posted

I can confirm that besides the lights and switches it also happens with Tuya thermostat. It allows you to change the temperature but it doesn’t report the correct one back until the next system restart. But it’s great to hear this issue has been worked on. Thank you!

Hi Everyone!

On Github today have appeared some ‘news’ on the topic, but sadly not too long later the issue/thread had beeen closed on valid reason, and this is why I wanted to explain it here:

Seems that if we resubscribed to the free trial API service the sate reporting become correct:

But as the corresponding Tuya dev console is basically for developers and not end users the free API subscription will expire on every month. There is a paid subscription but basically that is not really for end users. So currently seems that - with the new Tuya v2 integration through the official Tuya API - the usage of our devices could be a ‘little bit’ uncomfortable.

Because of that there had already started some bad tone post about the paid service: Tuya; delayed/missing state updates: Confirmed Tuya Cloud issue, awaiting upstream fix · Issue #60034 · home-assistant/core · GitHub

What I try to answer here, I hope in a correct way:

So, please fix me if I’m wrong: the goal of the new, official TuYa integration was to make its user to pay for it, eventually?

I don’t think that the question is correct. Home Assistant and its integrations are independent from the platform vendors. The payed solution is defined by Tuya and by the independent developers of Home Assistant and its integrations.

Its absolutely understandable if the corresponding developers prefers the official supported solutions over on any other undocumented hacked solutions. The Tuya API and its functions are the true official method to handle Tuya devices, and all of the functions it offers are not for end-users but for developers. So basically the payed solution in the first round is not for us as end-users but for 3rd party develpers, developer companies who want to use Tuya API for their products. The problem we are in front of is that there is no real software relied on Tuya API with developer company who pay for the API usage. Because of it we - as end-users - use the API directly and therefore we have to pay for it directly.

So this is why I think the question is wrong. Any developer will prefer official possibilities over on any unofficial way, and this is why the new integration is lot more reliable as any other. The problem is that Tuya does not offer clean and free mathod to use with Home Assistant, what is for me from the other aspect sadly can be understanadble also. Tudy does not want to use their devices with 3rd party softwares. They want to build massive own userbases with its own solution. But if anybody would like to use their devices in a standalone software there is a possibility but it need to be paid.

So the situation is not based on Home Assistant developers but on Tuya itself who want to build its own userbaes instead of allow 3rd party services ‘to do this’.

I hope I was clear.

Local Tuya could be the solution what is basically a 3rd party hack, instead of use the official Tuya API.

(Or simply forget Tuya devices and use more generic ones.)

Glad I switched to tuya local during all this mess. Seems to have been the right decision.

Is the Tuya developer trial yearly, or once it’s done, you have to start paying?

Regardless of that question, they have committed to implementing an official local Tuya at some point.

The trial edition is free to use but expires in 1 month. There is a special 6 months extended period on personal requests.

But check out the whole image of the service:

As you can see, all paid subscriptions expires just in 1 years instead of a month, and the smaller one is enough for 10 000 devices. This is why I wrote that the whole developer console and its possibilities are not for end-users but 3rd party developers/developer companies who want to use Tuya API. This is absolutely correct. There is no problem with it.

The problem is that Home Assistant will never pay for it, and we as end-users also will not. The situation is simply not the one what it have to be.

If Tuya really want to close its users into their services offers just paid method to use their API, Home Assistant as a ‘non-profit organization’ will never pay for it and this is the end of the road.

If Tuya could offer a free solution to directly to Home Assistant, that could save us, but if this is somewhere a counter-interest thingie, then this is really the end of the road (I mean the official/proper road). There are always be hacks, but they are usually not reliable for a long time.

But my trial says it expires May 2022 ?

I did sign up a while back , way before this integration to get my keys for Tuya Local.

Maybe the trial is just needed to hook into Tuya, to link your TuyaSmart or Smartlife App and pull in your devices,. Of note, looking at the HA code, there is definitely a HA specific dev api channel.

If anyone’s 1 month trial is up, can you post if it still works in HA?

Hi guys, the slow response issue of Tuya HA integration is been improved, please check if it’s fixed, thanks!

3 Likes