Tuya integration fails to initialise
The problem
A few days ago the Tuya integration showed it was 'initialising' and I couldn't get any further. I've used the integration for several months prior with no issues. After several minutes it changes to display "Failed to set up. Check the logs."
I have rolled back a few days and restored and backup but the issue persists.
All of the devices still function correctly in the SmartLife app. Deleting the integration and starting again I get as far as scanning the QR code using the SmartLife app, then when I click submit it just sits on the spinning blue circle.
I'm now stuck.
What version of Home Assistant Core has the issue?
2025.3.4
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
https://www.home-assistant.io/integrations/tuya/
Diagnostics information
No response
Example YAML snippet
Anything in the logs that might be useful for us?
Logger: homeassistant.config_entries
Source: config_entries.py:753
First occurred: 17:15:59 (1 occurrences)
Last logged: 17:15:59
Error setting up entry [redacted]@googlemail.com for tuya
Traceback (most recent call last):
File "/usr/src/homeassistant/homeassistant/config_entries.py", line 753, in __async_setup_with_context
result = await component.async_setup_entry(hass, self)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/src/homeassistant/homeassistant/components/tuya/__init__.py", line 138, in async_setup_entry
await hass.async_add_executor_job(manager.update_device_cache)
asyncio.exceptions.CancelledError: Global task timeout
Additional information
No response
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 closeCloses the issue. -
@home-assistant rename Awesome new titleRenames the issue. -
@home-assistant reopenReopen the issue. -
@home-assistant unassign tuyaRemoves the current integration label and assignees on the issue, add the integration domain after the command. -
@home-assistant add-label needs-more-informationAdd a label (needs-more-information, problem in dependency, problem in custom component) to the issue. -
@home-assistant remove-label needs-more-informationRemove 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)
Same here
Tuya Integration suddenly doesn't initialize anymore.
Please fix.
EDIT: The TUYA Integration initialized again and is working now. The LOCAL TUYA worked while the official was not initializing. The official TUYA App was working while the HA integration was faulty.
Core 2025.3.4
Supervisor 2025.03.3
Operating System 15.0
Frontend 20250306.0
Same here
Same same
Same same
Same here
After reloading it works again.
After reloading it works again.
What did u reload ? I reloaded the hub and nothing happened matter of fact i cant even reload that now.
Today I have tried again to get this working. After reloading the hub entry all of my devices showed up again, however they still do not work properly. The reload took about 10 minutes.
After The reload, although I can see the controls for my smart-plugs, I cannot actually control them. If I try to turn on a plug the control slider moves to the ON position and turns blue, but the device does not switch on. After about 15 seconds the slider goes grey again and returns itself to the OFF position.
Strangely, if I turn the plug on manually by pressing the physical button, Home Assistant reports this instantly and displays the slider in the ON position. I can also control the device properly and instantly in the Smart Life app.
Having turned a device on manually using its physical button, even though Home Assistant reports the device's ON/OFF status correctly I still cannot control the device using Home Assistant.
The problem occured again after 3 days without problems of initialising.
The restart of Home Assistant is very slow as the Tuya integration just hangs for ages.
Deactivating IP6 in Settings > Network fixed the problem for Tuya not initialising in Home Assistant.
Deactivating IP6 in Settings > Network fixed the problem for Tuya not initialising in Home Assistant.
You really took me out of my misery. Man! Thanks!
Deactivating IP6 in Settings > Network fixed the problem for Tuya not initialising in Home Assistant.
This has worked for me also. Well done that man!
Should I close this thread, or leave it open as there is still clearly an issue related to the use of IPv6?
Deactivating IP6 in Settings > Network fixed the problem for Tuya not initialising in Home Assistant.
This has worked for me also. Well done that man!
Should I close this thread, or leave it open as there is still clearly an issue related to the use of IPv6?
i suggest to leave it open. Disabling IPv6 is merely a workaround and not suitable for everyone. This problem should be fixed in the integration itself
i suggest to leave it open. Disabling IPv6 is merely a workaround and not suitable for everyone. This problem should be fixed in the integration itself
Those were my thoughts too, so I shall leave it open.
Tuya integration is not initialized. Deactivating IPv6 did not help
Deactivating IP6 in Settings > Network fixed the problem for Tuya not initialising in Home Assistant.
Works for me. Thanks!
Disabling IP6 didn't help me, it doesn't work! Something is broken)
То же самое, то же самое
Disabling ipv6 and reloading the integration worked! But is it integration or HA related?
Disabling IP6 didn't help me, it doesn't work!
Отключение IP6 мне не помогло, это не работает!
Everything is working today, without any changes. Most likely, the provider had problems.
Deactivating IP6 in Settings > Network fixed the problem for Tuya not initialising in Home Assistant.
This worked for me. Could you explain how you found this fix or was it random?
This issue has been irritating the hell out of me for months too, and annoyingly I only just thought to check on here to see if anyone else was having the issue. I could always get integration up and running by reloading/refreshing the integration, eventually anyway. Sometimes it would take a few tries, and each reload would take an eternity to finish, but it would eventually work. However, as everyone on this thread knows, it's not an ideal situation a) not having Tuya work after a HA restart (especially if it happens in the night because none of your automations work and you could wake up to no hot water.....if your boiler uses a Tuya switch, like mine do), and b) having to disable IPv6 as a workaround (which did work for me. Thank you for the suggestion, I just did a restart and Tuya popped straight up, plus my restart time has been cut by 90% without the Tuya issue slowing it down).
I originally assumed that it was an issue with either my HA setup or my Tuya Core-IoT subscription, particularly as the issue started happening right after I switched back to using the Tuya integration and had to request a Core-IoT extension (before that I had been using the briefly available Smart Life (Beta) integration - which didn't need a Core-IoT sub - but it was discontinued and, allegedly, rolled into HA Core/Tuya but none of its local features/no Core-IoT requirements were actually integrated, but that's a separate, also very irritating, issue and thread lol). The timing of the issue seemed like a grade A user error type situation lol......until I exhausted every setup option I could think of and finally decided to look on here to see if anyone else was having the same issue.
However, in the course of trying to find the issue I noticed something on the Tuya Developer site. My IoT project used to be housed on the Western Europe data centre, as I'm in the UK. It's now on the Central Europe data centre, even though I'm a) still in the UK, and b) my Smart Life app is registered under the United Kingdom/Isle of Man region. I have no idea why this changed, I haven't checked a map recently but I'm guessing I didn't miss the UK being moved east of Poland while I wasn't looking, but it made me wonder if a) that was what was causing the issue with the Tuya integration, and b) where everyone else having this issue was located, is it just UK users or Worldwide?
I tried switching my data centre back to Western Europe (you have to delete the Central Europe one first, receive the slightly scary looking warning about doing so lol (but your old data is still there if you switch back later), enter a 2FA code, then add the new data centre), but when I then tried to re-link to my Smart Life app I was told my region settings didn't match and had to go back to the Central Europe data centre before I could re-link the app. Which is confusing given that the UK, barring Iceland or maybe Greenland (if you count Greenland as part of Europe), is about as far west as you can go in Europe. I have no idea if this is the cause of the issue - the Smart Life app thinking I'm in Western Europe/the UK, while my Core-IoT is housed on the Central Europe servers - but it's the only thing I've spotted (outside of searching the Tuya integration's code) that has changed.
So firstly, thank you again for the IPv6 workaround, @PV-Joe you're a legend! Secondly, where is everyone located? And, does your Core-IoT project data centre match where you are located? I'd be interested to know if mine not matching is just a random anomaly unconnected to the actual issue with Tuya.
P.s. I was getting so, so, so "fed up" with the issue I started ripping out all of my Tuya Wi-Fi devices and replacing them with Zigbee devices that I've connected directly to HA, so bypassing the Tuya app and integration, but it's nice to know I can switch them over to the Smart Life app - if I want to take advantage of the more user-friendly interface for setting up 2-way/multi-association light switches etc etc - and I won't have to worry about them not working in HA......until my Core-IoT sub needs extending again anyway 🤦♂️ lol.
@DavidMW38 There is just the Central Europe data center for most of europe now as you can read here .
Also as far as I know the integration uses a different flow now so the initial set up over tuyas iot platform should not be needed anymore but someone correct me if I'm wrong
Everything is working today, without any changes. Most likely, the provider had problems.
Сегодня всё работает без каких-либо изменений. Скорее всего, у провайдера были проблемы.
English? Rude to speak in foreign language
@knorke132 Oh cool, thanks for the info about the servers. That explains why I was moved to Central Europe. I still wonder if the server move has caused the IPv6 issue though, possibly everything wasn't redirected correctly after the move.
I'm not sure if the config flow has changed, unless it happened on an update recently (the last month or two). I'd guess I changed back to using the Tuya integration two months ago, possibly three, at the absolute most four (my memory must be slipping lol), and I had to extend my Core-IoT subscription before it would work - I hadn't extended for ages as the Smart Life version didn't require it. That said, maybe the 'Tuya won't load on start-up' issue had already begun so that made me think the IoT sub was the issue???
Although, even if the config flow has changed so that new installs don't require the Core-IoT sub (which would be an enormous improvement), I think Tuya still needs the server (although I could be wrong about that?), so can't run locally, as the Smart Life version could, which was a major selling point. I guess I'm just disappointed that Tuya (the company) said they were stopping the Smart Life development and rolling it into HA Core but only 1 of those things has happened. I was initially surprised, and disappointed, to not find a Smart Life integration available in HA Core, and then surprised/disappointed that the SL features that set it apart from Tuya hadn't been incorporated into it. Maybe I'm just being too impatient and they'll be added at some point, however, considering they had the code written already (in the SL version) that would have required little or no alteration, I would have thought it would be a very quick job to carry over the local features.
The annoying thing about it is, all my other devices on my Smart Home/IoT network (which is separate from my main network, and isolated too) can run locally so when I was using the SL integration I could block all incoming traffic on that network. Which obviously made all my IoT devices much more secure. With Tuya needing the server (as far as I know, at least as mine is set up), I've had to restore incoming traffic to that network, albeit with serious firewall limitations, so it's not quite as secure as it used to be.