core icon indicating copy to clipboard operation
core copied to clipboard

Tuya integration not updating status after 2025.4.1 update

Open gradevd opened this issue 9 months ago • 100 comments

The problem

Hey folks,

First time reporting a bug here. And I'm a huge admirer of the whole community and everything you don.

I Just updated my local HA server to the latest version 2025.4.1.

Unfortunately, my Tuya integration is now out of order. I have a couple of window sensors that were working just fine before. Now the Tuya integration does not update the status of the sensors at all. I need to reload the integration to get the latest status of the sensors, but then again if the status is changed HA never updates it until the next Tuya reload.

On the other hand, the sensors status is updated quite well on the native Tuya app.

Thanks, Dimitar

What version of Home Assistant Core has the issue?

2025.4.1

What was the last working version of Home Assistant Core?

No response

What type of installation are you running?

Home Assistant OS

Integration causing the issue

Tuya

Link to integration documentation on our website

No response

Diagnostics information

No response

Example YAML snippet


Anything in the logs that might be useful for us?


Additional information

No response

gradevd avatar Apr 05 '25 07:04 gradevd

Hey there @tuya, @zlinoliver, mind taking a look at this issue as it has been labeled with an integration (tuya) you are listed as a code owner for? Thanks!

Code owner commands

Code owners of tuya can trigger bot actions by commenting:

  • @home-assistant close Closes the issue.
  • @home-assistant rename Awesome new title Renames the issue.
  • @home-assistant reopen Reopen the issue.
  • @home-assistant unassign tuya Removes the current integration label and assignees on the issue, add the integration domain after the command.
  • @home-assistant add-label needs-more-information Add a label (needs-more-information, problem in dependency, problem in custom component) to the issue.
  • @home-assistant remove-label needs-more-information Remove a label (needs-more-information, problem in dependency, problem in custom component) on the issue.

(message by CodeOwnersMention)


tuya documentation tuya source (message by IssueLinks)

home-assistant[bot] avatar Apr 05 '25 08:04 home-assistant[bot]

The same problem here since I updated to the new core version this morning.

Made some tests:

Disabled most of the devices: Temp./Humid. Sensors, Smartplugs, .. Left only two 50A Circuit Breakers enabled Tuya Integration Hub was going to state: active Enabled the first Temp./Humid. Sensors, then the next one and so on Tuya Integration Hub stays in state: active Enabled the first Smartplug , then the next one and so on Tuya Integration Hub goes to state: Initializing for about 5 minutes or more After this time the Tuya Integration Hub was going to state: active

All 10 devices with 33 entities are available.

MSl1gh avatar Apr 05 '25 14:04 MSl1gh

I also have problems with Tuya after upgrading to HA Core 2025.4.1. Specifically I can't get power readings or toggle on/off on switches, when I set to On, they go back to Off in the UI, while the hardware is set On.

Log output:

2025-04-05 19:58:46.082 WARNING (ImportExecutor_0) [homeassistant.backports.enum] StrEnum was used from tuya, this is a deprecated alias which will be removed in HA Core 2025.5. Use enum.StrEnum instead, please report it to the author of the 'tuya' custom integration
2025-04-05 19:58:46.369 ERROR (Thread-2) [root] Uncaught thread exception
Traceback (most recent call last):
  File "/usr/local/lib/python3.13/threading.py", line 1041, in _bootstrap_inner
    self.run()
    ~~~~~~~~^^
  File "/usr/local/lib/python3.13/site-packages/tuya_iot/openmq.py", line 158, in run
    self.__run_mqtt()
    ~~~~~~~~~~~~~~~^^
  File "/usr/local/lib/python3.13/site-packages/tuya_iot/openmq.py", line 172, in __run_mqtt
    mqttc = self._start(mq_config)
  File "/usr/local/lib/python3.13/site-packages/tuya_iot/openmq.py", line 179, in _start
    mqttc = mqtt.Client(mq_config.client_id)
  File "/usr/local/lib/python3.13/site-packages/paho/mqtt/client.py", line 772, in __init__
    raise ValueError(
        "Unsupported callback API version: version 2.0 added a callback_api_version, see docs/migrations.rst for details"
    )

hahalj avatar Apr 05 '25 18:04 hahalj

Moin,

after reading other posts here, I have a solution for my HA Tuya integration.

Disabling IP6 protocol stack in the HA network settings causes the Tuya integration to run again normally. The duration of reloading the Hub takes only one or two seconds; with IP6 activated five minutes and longer.

It seems it is a network problem with the Tuya Cloud, not a pure Tuya integration problem.

MSl1gh avatar Apr 06 '25 05:04 MSl1gh

Does Matter work when I put ipv6 off? I thought it does not work with v4.

The Problem with the integration is not new. I’ve seen it some weeks ago. And made a rollback to Core 2025.2.2, Supervisor 2025.03.4, Operating System 14.2.

DieBreuers avatar Apr 06 '25 17:04 DieBreuers

My problem was a routing issue caused by wire guard client. It was not configured well so the integration used the vpn gateway wich could not connect to tuya api.

You can check the routing in the terminal with traceroute openapi.tuyaeu.com The first result step is the used gateway of your home assistant

principat avatar Apr 09 '25 21:04 principat

I haven't changed anything on my system, including my network components. The error specifically occurred with the HA update. This is also being discussed in some other forums. Some people have created a workaround by reloading the integration every 15 minutes. (It works, but it's not exactly nice.)

I don't mean to say that the HA guys made a mistake here. But something is suddenly different. And this was almost two months ago. As described above, my workaround is to wait with the update until a solution is found. Unfortunately, I have some Tuya devices that are only gradually being replaced.

Greetz from Germany NRW

DieBreuers avatar Apr 10 '25 13:04 DieBreuers

I tried the proposal to downgrade to Core 2025.2.2, Supervisor 2025.03.4, Operating System 14.2. but no success here. My TUYA binary sensors are just stuck and change their state only when I reload the Tuya hub. Haven't tried @principat proposal yet, but not sure if it applies to me tough as I have no vpn configured on my ha server.

gradevd avatar Apr 10 '25 13:04 gradevd

same problem on all tuya devices. It starts updating for about a minute whenever I open the smart life app. Tuya Hub seems to have changed a lot.

If I don't touch anything, at least the switches work but once they get changed from the app or any other source than HASS, they don't get recognised. I can turn them on then but not off anymore as they jump back to the off state.

This is quite bad as I am controlling my entire PV and battery system with tuya.

dobo290 avatar Apr 14 '25 17:04 dobo290

same problem on all tuya devices. It starts updating for about a minute whenever I open the smart life app. Tuya Hub seems to have changed a lot.

I have exactly the same issue. Tuya derived entities are frozen until I open the same Tuya device on my Tuya mobile app then the values update. If then I exit the app they seem to freeze or update randomly and often 20 minutes between updates. I too have lots of devices albeit none of them have critical functions, I do hope they (Tuya) fix it soon...

Martyns20 avatar Apr 14 '25 20:04 Martyns20

I have the same problem as the author. The sensors are updated only when the integration is restarted.

BackaDeGama avatar Apr 15 '25 10:04 BackaDeGama

Same here. Imho it is not HA problem

vdovinmih avatar Apr 16 '25 09:04 vdovinmih

Same here. Imho it is not HA problem

I actually think it might be.

I pulled the plugs on ha and my router because I worked on something else and once I restarted everything, it worked flawlessly over the entire night.

Once I made a change, I think manually setting a switch from the smart life app, everything falls apart.

Rebooting my ha does not solve it, only when the router and the tuya rail devices do reboot as well.

dobo290 avatar Apr 16 '25 09:04 dobo290

There seems to be a tie in with 2025.4.1 and/or 2025.4.2 from previous posts and my experience. Also, I noticed erratic pings/slow response from the Tuya API portal openapi.tuyaeu.com

Martyns20 avatar Apr 16 '25 10:04 Martyns20

Interesting if you use ChatGPT with the following... "My Tuya devices are slow to update in Home Assistant integration and there seems to be a problem with Tuya API calls"

Martyns20 avatar Apr 16 '25 10:04 Martyns20

Enabled debug log and got this:

Uncaught thread exception

Traceback (most recent call last):
  File "/usr/local/lib/python3.13/threading.py", line 1041, in _bootstrap_inner
    self.run()
    ~~~~~~~~^^
  File "/usr/local/lib/python3.13/site-packages/tuya_sharing/mq.py", line 118, in run
    self.__run_mqtt()
    ~~~~~~~~~~~~~~~^^
  File "/usr/local/lib/python3.13/site-packages/tuya_sharing/mq.py", line 136, in __run_mqtt
    mqttc = self._start(mq_config)
  File "/usr/src/homeassistant/homeassistant/components/tuya/__init__.py", line 112, in _start
    mqttc.connect(url.hostname, url.port)
    ~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.13/site-packages/paho/mqtt/client.py", line 1435, in connect
    return self.reconnect()
           ~~~~~~~~~~~~~~^^
  File "/usr/local/lib/python3.13/site-packages/paho/mqtt/client.py", line 1598, in reconnect
    self._sock = self._create_socket()
                 ~~~~~~~~~~~~~~~~~~~^^
  File "/usr/local/lib/python3.13/site-packages/paho/mqtt/client.py", line 4612, in _create_socket
    sock = self._ssl_wrap_socket(sock)
  File "/usr/local/lib/python3.13/site-packages/paho/mqtt/client.py", line 4671, in _ssl_wrap_socket
    ssl_sock.do_handshake()
    ~~~~~~~~~~~~~~~~~~~~~^^
  File "/usr/local/lib/python3.13/ssl.py", line 1372, in do_handshake
    self._sslobj.do_handshake()
    ~~~~~~~~~~~~~~~~~~~~~~~~~^^
TimeoutError: _ssl.c:1011: The handshake operation timed out

my mqtt broker works fine with all other integrations.

hope it helps

vdovinmih avatar Apr 16 '25 11:04 vdovinmih

https://github.com/fhempy/fhempy/issues/485

vdovinmih avatar Apr 16 '25 12:04 vdovinmih

Disabling IP6 did not help me.

It's been an issue for a long time... https://github.com/home-assistant/core/issues/110162

erickson-brian57 avatar Apr 17 '25 20:04 erickson-brian57

hi, So what's the end result? on version 2025.4.2 tuya still doesn't work. It is updated exactly once at the start of the HA or the integration reboot. Disabling IPv6 does not help.

b2rdetor avatar Apr 18 '25 13:04 b2rdetor

Same issue here, started with the first 2025 upgrade. Reverted to 2024 but then it stopped working around 5-6 weeks ago. Updated everything to the then current version, all worked fine for 4 weeks and last week it stopped working again. Restarting HA will make Tuya work for an hour or two and then it gets stuck again. I can turn things on and off, but updates from Tuya (eg temperature) don't come through until next restart.

ReneD100 avatar Apr 18 '25 17:04 ReneD100

2025.4.3 tuya still not works. WTF is going on?

b2rdetor avatar Apr 19 '25 11:04 b2rdetor

The situation is similar. Home Assistant Core 2025.4.3 Supervisor 2025.04.0 User Interface 20250411.0

7qx avatar Apr 20 '25 12:04 7qx

I have also been seeing this problem for several weeks. I haven't changed anything special in the HA settings, but many sensors have stopped working. At first, only temperature sensors connected via BT through a hub were glitching. Now, almost all devices do not receive the current state until the integration is rebooted, but the switch control works fine. The HA version is the latest available.

chapai518 avatar Apr 20 '25 13:04 chapai518

I still have the issue with Tuya readings not updating and it's still broken after 2025.4.3. The main issue for me is with readings from various devices such as power, temperature and humidity. Automations and manual outputs to Tuya switches such as lights and sockets all seem to work ok. It's as if HA isn't polling the API data as it should, all the readings that are not updating in HA do update correctly in the Tuya App, so the finger again points at HA. How does this issue get escalated?

Martyns20 avatar Apr 20 '25 22:04 Martyns20

Reloading the integration does not work for me - it reads the data but gets stuck again immediately. It happens with all device that should return status. I am now restarting HA every 3 hours, then it works but of course this is not very desirable...

Overview of temperature with crash, reload and restart: Image

Overview of temperature with automatic restart every 3 hours: Image

ReneD100 avatar Apr 22 '25 10:04 ReneD100

Reloading the integration does not work for me - it reads the data but gets stuck again immediately. It happens with all device that should return status. I am now restarting HA every 3 hours, then it works but of course this is not very desirable...

Overview of temperature with crash, reload and restart: Image

Overview of temperature with automatic restart every 3 hours: Image

I tried restarting but sometimes this actually breaks even more by adding up a different issue. My power readings in tuya get almost doubled. It doesn't happen every time but on several restarts my entire energy monitor for the day is just impossible.

dobo290 avatar Apr 22 '25 14:04 dobo290

I tried restarting but sometimes this actually breaks even more by adding up a different issue. My power readings in tuya get almost doubled. It doesn't happen every time but on several restarts my entire energy monitor for the day is just impossible.

It's really annoying, after I reverted to 2024 version it worked for a few days, but then there were some many other HACS integrations getting outdated. After an update a few weeks ago everything seemed to work until 2 weeks ago. I am considering using a different approach, but that means replacing hardware and setup.

ReneD100 avatar Apr 22 '25 14:04 ReneD100

I tried restarting but sometimes this actually breaks even more by adding up a different issue. My power readings in tuya get almost doubled. It doesn't happen every time but on several restarts my entire energy monitor for the day is just impossible.

It's really annoying, after I reverted to 2024 version it worked for a few days, but then there were some many other HACS integrations getting outdated. After an update a few weeks ago everything seemed to work until 2 weeks ago. I am considering using a different approach, but that means replacing hardware and setup.

I actually kind of did this. Ordered some esp32 boards and started using them for the switch while the tuya is now only used for the consumption reading with xtend, which does not have a problem as the time of input doesn't matter here. Only the power would be nice to have frequently.

dobo290 avatar Apr 22 '25 14:04 dobo290

День добрый всем. У меня такая же проблема. Сегодня обновил Core на 2025.4.4 - не помогло. Тогда я решил поиграть с настройкой сети. Выключил автонастройку локального адреса и все заработало. Огорчился что работало всего 5 минут

Image

Chess-smart avatar Apr 25 '25 10:04 Chess-smart

День добрый всем. У меня такая же проблема. Сегодня обновил Core на 2025.4.4 - не помогло. Тогда я решил поиграть с настройкой сети. Выключил автонастройку локального адреса и все заработало. Огорчился что работало всего 5 минут Unable to read this, but after running it through translate: does this mean that it worked for 5 minutes and is not working now?

ReneD100 avatar Apr 25 '25 13:04 ReneD100