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

Hi All,
I’m running the latest core version (core-2021.11.4) and have ported all my tuya to use the cloud version. one of the most apparent difference I noticed is that the icon state change is not updated promptly compared before porting over to the new configuration. It ranges from 10 secs to a few minutes (i had to manually trigger an integration reload :roll_eyes:). The main issue would be usability, imagine accidentally switch on a light (which happens most of the time), i got to wait for a while for the state change before i can toggle it. Is it me that missed out certain configuration or are the rest experiencing the same issue?

Roy

4 Likes

Same problem here…

I’m still on core-2021.10.6 but am having problems with Tuya. I have a number of lights (Tuya and others) that are motion controlled using Node Red. Due to historical problems (probably unrelated to Tuya), 5 seconds after changing state, I confirm their status updates. If it doesn’t, I automatically try again, and if that fails, send myself a message. For about the last week, two of my lights have been sending messages saying the state has not updated every time they change, but other Tuya’s are ok. For example, I have 3 bedroom lights that come on at the same time and one doesn’t change status but the other two do. The other one with problems is a single bathroom light.

I have tried deleting and reinstalling the integration but that didn’t help. I also tried changing country and data center, but I’m not sure that’s so easily done. I’m in Australia and originally couldn’t find a sensible option, so I selected Sweden and Western Europe. If I changed to China and China, adding the integration said it did not support cross-region, but it was happy when I set it to Sweden and China (WTF?).

Yep, same for me. Response time to turn the lights on or off is pretty quick, but after changing state there is a substantial delay before the interface updates and it can be changed again. The (much) older integration didn’t have this problem, but the response times to change state was a fair bit slower. Hopefully they’ll sort this out in the next version - I read somewhere that they would also include local control at some point which would be awesome. By contrast the Tuya local integration shows the state changes instantly, but can’t actually turn them on or off at all…

definitely looking forward for local control. It works fine till we have to shift all to the cloud. Heck, i might need to write a reload script in the interim to get this reflected. It’s not only me using it, I’ll have the whole household chasing after me. :cry:

Yes I can confirm that since a few days status updates are much slower. In some cases takes minutes to update. It happens for lights, switches and plugs for me. It is also rather random. Sometimes it works reasonable fast, at other times it is much slower. State changes in the smartlife app are more consistently fast though. Since it eventually works, I assume the issue is with the Tuya API or maybe server load (I am on central EU server)? In the tuya iot account, I do not see any failures in API calls.

Would be great and assuring if the tuya folks maintaining this can give us some updates.

Hi All,

I’m experencing the same Problem with Tuya Cloud Integration since core-2021.11.4 to.
Before the core-2021.11.4 it seemed to work properly.

Is there any soliution?

I also have this problem since a view days. Automations are not running propperly and sometimes the status is not changing until I reload the tuya integration. After the update to core 2021.11.4 it was working great for a while. So I think it’s a tuya serversided problem. I hope they get it fixed very soon.

Same here. Response to manual changes or automations is quick but updating status takes forever: 15 seconds to minutes.

I’m on 2021.11

Same issue here since the last HASS update, something must’ve broke introducing the delay

yah same issue here, any update from tuya team?

EDIT: The below seems not to have been a good idea. After a while, the tuya integration stopped loading at all. I think this might cause too many API calls on the tuya side :wink: So I guess, we will have to wait.

Since for me manually reloading the integration at least updates the states, I created an automation that just reloads the integration every 2 minutes. Obviously by no means is this a “solution” and it obviously is incredibly inelegant. But at least I get a somewhat consistent (albeit with a max. of 2 min. delay) status updates. So for me this works as a stop-gap solution until the situation is resolved properly. Notice that when you reload the tuya integration all your devices become briefly unavailable (1s or so). In practice this is not an issue, unless of course you have automations that do something when a device becomes unavailable.

Anyway, if you want to use this stop-gap solution, below is the code of the automation.

description: ''
trigger:
  - platform: time_pattern
    minutes: /2
condition: []
action:
  - service: homeassistant.reload_config_entry
    data:
      entry_id: XXXXXXXXXXXXXXXXXXXXXXXXXX
mode: single>

In order to find out the entry ID, you have to check in the file /config/.storage/core.config_entries. Sicne this is a hidden .storage folder, I don’t think you can check that file with the file editor Visual Studio (correct me if I am wrong). Instead:

1. install the ssh add-on
2. open the ssh webUI
3. type the following command: less /root/config/.storage/core.config_entries

Look for the section with domain tuya:

            {
                "entry_id": "XXXXXXXXXXXXXXXXXXXXXXXXXX",
                "version": 1,
                "domain": "tuya",
                "title": "XXXX",
                "data": {
                    "endpoint": "https://openapi.tuyaeu.com",
                    "auth_type": 0,
                    "access_id": "XXXX",
                    "access_secret": "XXXX",
                    "username": "XXX",
                    "password": "XXXX",
                    "country_code": "32",
                   "tuya_app_type": "smartlife"
                },

Let’s hope it get’s fixed quickly. There are already a bunch of github issues opened, so I think the devs should be aware.

Same issue here…

I’ve been having the same issue. The only way I have fixed it was to make sure that the Tuya app account is in the same country as the developer account you have it linked to. Unfortunately for me my Tuya app account as set to Ukraine so I had to create a new account and re-pair 29 devices to it (took all day) also in the cloud developer make sure you have the “notification update” enabled (I hope a called it the right thing) ugh hours of labor today…but it paid off :+1:

This script is still a great idea. Instead of automation, thanks to the great work from you I’ve just put them into a script and assign it to a button on my dashboard. 1 click beats 3 clicks any time :grin::+1: as and when required.

Same problem.
Just upgraded to core-2021.11.5, moved my Tuya devices from the old Tuya to the new “official” Tuya.
Home Assistant sends commands and the device responds, the Home Assistant changes to the new state, then goes back to the previous state.
In others words, turn a Tuya switch on, the HA icon changes from off to on, then less than a second later, changes to off. The physical Tuya switch remains on though.

What is broken?

[Edit 1]
Open issue in home-assistant/core:
Tuya switch not keeping its state when toggled - delay in switch state updating after last HA core update 2021.11.4 #60034

[Edit 2]
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.

Same problem, big delay with update of status of Zigbee lamps and Zigbee switch.
Also slow reaction on switching on /off
Even after switching off or on, you have to wait quite long before you can switch it off/on again.
Looks that the new Tuya API from Tuya is giving problems / very slow performance.
core-2021.11.5
Home Assistant OS 6.6
supervisor-2021.10.8
Currently 21/11/2021 only my test Home Assistant is using the latest version core-2021.11.5
But this problem was also with previous version core-2021.11.4
And according me also with previous version like 11.3 etc (but it looked that problem became bigger and bigger).

My operational environment is now back again to the version of 8/10/2021
core-2021.9.7
Home Assistant OS 6.6
supervisor-2021.10.8
Here the old Tuya integration works fast en reliable.

I installed the old tuya integration through HACS. The current state of the new tuya integration is unusable.

Came here to post this. I put off going to latest home assistant as I knew it would be painful going to the new integrated Tuya.

Turned out not so bad, but the device status updates are awful. I mainly have switches and light bulbs, and all are the same. A long lag, or not updating at all. It was a pain in the ass fix all my scenes.

Luckily, I had Local Tuya installed via HACs from a while back, but unused, so I spent a few hours adding all my devices there as well. For now I’ve doubled up on my switches and bulbs in lovelace with a “local” suffix on each entity.

Anyone know what’s causing the delay?

Maybe this will force the developers hands on implementing and supporting local Tuya officially.