core
core copied to clipboard
tuya integration could not authenticate
The problem
I keep getting " tuya integration could not authenticate: Authentication failed. Please re-authenticate". Once I re-authenticate it works for a day or two, then I get the message again. This has been going on for the last couple of months
What version of Home Assistant Core has the issue?
core-2024.4.4
What was the last working version of Home Assistant Core?
No response
What type of installation are you running?
Home Assistant Supervised
Integration causing the issue
tuya
Link to integration documentation on our website
No response
Diagnostics information
No response
Example YAML snippet
No response
Anything in the logs that might be useful for us?
Logger: homeassistant.config_entries
Source: config_entries.py:575
First occurred: April 26, 2024 at 10:00:06 PM (1 occurrences)
Last logged: April 26, 2024 at 10:00:06 PM
Config entry '[email protected]' for tuya integration could not authenticate: Authentication failed. Please re-authenticate
Additional information
No response
Hey there @tuya, @zlinoliver, @frenck, 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)
This just started happening to me too. Same issue.
Issue with Tuya integration here too. Have had it installed and working for many months.
Integration error message is "Failed to set up"
When I try to reconfigure I get a Tuya QR code that is supposed to be scanned with Tuya Smart app. But Tuya Smart app will not approve QR code, error here is QR code too old.
Working now after finally figuring out how to reenable integration through Toya Smart app
Issue with Tuya integration here too. Have had it installed and working for many months. Integration error message is "Failed to set up"
When I try to reconfigure I get a Tuya QR code that is supposed to be scanned with Tuya Smart app. But Tuya Smart app will not approve QR code, error here is QR code too old.
You need to press submit in HA, and then it generates a new qr code, it will show a error in red above the qr, but just ignore, rescan and press submit, it will be working for a day
In my case the integrating works. I just keep getting this every couple of day or so, " tuya integration could not authenticate: Authentication failed. Please re-authenticate".
New user here. I was having this issue since I got HA and then I tried disabling "automatically poll for updates" in Tuya integration settings. It seems to work so far, about a week. If this is how it's going to be I might get rid of Tuya.
New user here. I was having this issue since I got HA and then I tried disabling "automatically poll for updates" in Tuya integration settings. It seems to work so far, about a week. If this is how it's going to be I might get rid of Tuya.
Thanks, will try this one. I have only 6 tuya wifi devices, so i don't want to hack everything into something else and local tuya and tuya local where both very slow for me. It took a minute sometimes to turn on a light, and with tuya or smartlife integration it is instant. I just wait to the devices die, so i can replace them for zigbee
New user here. I was having this issue since I got HA and then I tried disabling "automatically poll for updates" in Tuya integration settings. It seems to work so far, about a week. If this is how it's going to be I might get rid of Tuya.
Thanks, will try this one. I have only 6 tuya wifi devices, so i don't want to hack everything into something else and local tuya and tuya local where both very slow for me. It took a minute sometimes to turn on a light, and with tuya or smartlife integration it is instant. I just wait to the devices die, so i can replace them for zigbee
After seeing your post, I thought I would give it a try. Sorry it doesn't work for me...
New user here. I was having this issue since I got HA and then I tried disabling "automatically poll for updates" in Tuya integration settings. It seems to work so far, about a week. If this is how it's going to be I might get rid of Tuya.
Thanks, will try this one. I have only 6 tuya wifi devices, so i don't want to hack everything into something else and local tuya and tuya local where both very slow for me. It took a minute sometimes to turn on a light, and with tuya or smartlife integration it is instant. I just wait to the devices die, so i can replace them for zigbee
After seeing your post, I thought I would give it a try. Sorry it doesn't work for me...
It worked for me for couple days and than it asked for it again. But its better than before where i had to do it for 2 times a day. I have already replaced one device for zigbee so one more problem less for me. Try rebooting your system not only restarting HA
New user here. I was having this issue since I got HA and then I tried disabling "automatically poll for updates" in Tuya integration settings. It seems to work so far, about a week. If this is how it's going to be I might get rid of Tuya.
Thanks, will try this one. I have only 6 tuya wifi devices, so i don't want to hack everything into something else and local tuya and tuya local where both very slow for me. It took a minute sometimes to turn on a light, and with tuya or smartlife integration it is instant. I just wait to the devices die, so i can replace them for zigbee
After seeing your post, I thought I would give it a try. Sorry it doesn't work for me...
It worked for me for couple days and than it asked for it again. But its better than before where i had to do it for 2 times a day. I have already replaced one device for zigbee so one more problem less for me. Try rebooting your system not only restarting HA
A reboot is only temporary. Also, sometimes it works, but most of the time it doesn't. I already have dozens of Zigbee and Zwave devices. But, unfortunately many Tuya devices as well. Hopefully this will get fixed soon...
possibly related - https://github.com/home-assistant/core/issues/115344
Similar issue - here's what I captured:
After HA update: • Core 2024.6.1 • Supervisor 2024.06.0 • Operating System 12.3 • Frontend 20240605.0 seeing these errors and SmartLife hub disconnects every few hours, losing access to all SmartLife entities. Entering User Code as new SmartLife HUB re-enables all entities, until error repeats. Appreciate any insight on how to resolve. Polling updates is enabled.
Logger: homeassistant.config_entries Source: config_entries.py:858 First occurred: 3:12:23 AM (1 occurrences) Last logged: 3:12:23 AM Error calling entry remove callback "######" for smartlife Traceback (most recent call last): File "/usr/src/homeassistant/homeassistant/config_entries.py", line 858, in async_remove await component.async_remove_entry(hass, self) File "/config/custom_components/smartlife/init.py", line 197, in async_remove_entry await hass.async_add_executor_job(hass_data.manager.unload) File "/usr/local/lib/python3.12/concurrent/futures/thread.py", line 58, in run result = self.fn(*self.args, **self.kwargs) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/usr/local/lib/python3.12/site-packages/tuya_sharing/manager.py", line 218, in unload self.user_repository.unload(self.terminal_id) File "/usr/local/lib/python3.12/site-packages/tuya_sharing/user.py", line 40, in unload self.api.post("/v1.0/m/token/terminal/expire", None, { File "/usr/local/lib/python3.12/site-packages/tuya_sharing/customerapi.py", line 192, in post return self.__request("POST", path, params, body) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/usr/local/lib/python3.12/site-packages/tuya_sharing/customerapi.py", line 121, in __request raise Exception(f"network error:({ret['code']}) {ret['msg']}") Exception: network error:(-9999999) sign invalid Logger: tuya_sharing Source: /usr/local/lib/python3.12/site-packages/tuya_sharing/customerapi.py:160 First occurred: 3:02:17 AM (4 occurrences) Last logged: 3:12:23 AM net work error = network error:(1010) token is expired Logger: homeassistant.backports.enum Source: helpers/deprecation.py:197 First occurred: 3:02:12 AM (2 occurrences) Last logged: 3:11:52 AM StrEnum was used from smartlife, 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 'smartlife' custom integration Logger: homeassistant.config_entries Source: config_entries.py:594 First occurred: 3:02:17 AM (2 occurrences) Last logged: 3:10:53 AM Error setting up entry "#######" for smartlife Traceback (most recent call last): File "/usr/src/homeassistant/homeassistant/config_entries.py", line 594, in async_setup result = await component.async_setup_entry(hass, self) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/config/custom_components/smartlife/init.py", line 69, in async_setup_entry await hass.async_add_executor_job(smart_life_manager.report_version, version, smart_life_version, sharing_sdk) File "/usr/local/lib/python3.12/concurrent/futures/thread.py", line 58, in run result = self.fn(*self.args, **self.kwargs) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/usr/local/lib/python3.12/site-packages/tuya_sharing/manager.py", line 69, in report_version self.user_repository.user_version_report(ha_version, integration_version, sdk_version) File "/usr/local/lib/python3.12/site-packages/tuya_sharing/user.py", line 46, in user_version_report self.api.post("/v1.0/m/life/home-assistant/qrcode/versions", None, { File "/usr/local/lib/python3.12/site-packages/tuya_sharing/customerapi.py", line 192, in post return self.__request("POST", path, params, body) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/usr/local/lib/python3.12/site-packages/tuya_sharing/customerapi.py", line 121, in __request raise Exception(f"network error:({ret['code']}) {ret['msg']}") Exception: network error:(-9999999) sign invalid
I'm having the same issue as @jd3073 Smartlife hub disconnects and deleting and creating a new hub enables it again for only a short time.
homeassistant | [2024-06-26 09:33:05,485] [customer-customerapi] net work error = network error:(1010) token is expired homeassistant | 2024-06-26 09:33:05.485 ERROR (SyncWorker_45) [tuya_sharing] net work error = network error:(1010) token is expired homeassistant | [2024-06-26 09:33:05,536] [customer-customerapi] net work error = network error:(1010) token is expired homeassistant | 2024-06-26 09:33:05.536 ERROR (SyncWorker_45) [tuya_sharing] net work error = network error:(1010) token is expired homeassistant | 2024-06-26 09:33:05.596 ERROR (MainThread) [homeassistant.config_entries] Error calling entry remove callback gg-106867482375564454372 for smartlife homeassistant | Traceback (most recent call last): homeassistant | File "/usr/src/homeassistant/homeassistant/config_entries.py", line 858, in async_remove homeassistant | await component.async_remove_entry(hass, self) homeassistant | File "/config/custom_components/smartlife/__init__.py", line 197, in async_remove_entry homeassistant | await hass.async_add_executor_job(hass_data.manager.unload) homeassistant | File "/usr/local/lib/python3.12/concurrent/futures/thread.py", line 58, in run homeassistant | result = self.fn(*self.args, **self.kwargs) homeassistant | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ homeassistant | File "/usr/local/lib/python3.12/site-packages/tuya_sharing/manager.py", line 218, in unload homeassistant | self.user_repository.unload(self.terminal_id) homeassistant | File "/usr/local/lib/python3.12/site-packages/tuya_sharing/user.py", line 40, in unload homeassistant | self.api.post("/v1.0/m/token/terminal/expire", None, { homeassistant | File "/usr/local/lib/python3.12/site-packages/tuya_sharing/customerapi.py", line 192, in post homeassistant | return self.__request("POST", path, params, body) homeassistant | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ homeassistant | File "/usr/local/lib/python3.12/site-packages/tuya_sharing/customerapi.py", line 121, in __request homeassistant | raise Exception(f"network error:({ret['code']}) {ret['msg']}") homeassistant | Exception: network error:(-9999999) sign invalid
I turned off the polling like another user suggested and this fixted the problem for me.
I turned off the polling like another user suggested and this fixted the problem for me.
isn't that kind of pointless? Doesn't that mean your device state in HA is not reflective of reality?
I turned off the polling like another user suggested and this fixted the problem for me.
isn't that kind of pointless? Doesn't that mean your device state in HA is not reflective of reality?
No man i thought that too but it just works the same, only thing is sometimes there is now a delay of a couple seconds not always
same issues here, "could not authenticate" and "failed to set up".
I turned off "Enable polling for updates" in system options like another user suggested and this has got the integration working again for now.
Same issue here since 2 days. Have turned off “the polling for updates” but didn’t solve the problem. Does anyone has another solution to fix it? I now need to re-authenticate almost every 30-45min which is offcourse unworkable, but have many tuya devices so can’t switch to something else :(
Same issue here since 2 days. Have turned off “the polling for updates” but didn’t solve the problem. Does anyone has another solution to fix it? I now need to re-authenticate almost every 30-45min which is offcourse unworkable, but have many tuya devices so can’t switch to something else :(
I have (had) 70+ devices that initially were on Tuya then I converted to SmartLife. Re-autheticating on Smartlife "only" required after HA restart or HA upgrade, so not every 45 minutes. Still inconvenient and the occasional "contact the custom component developer" messages are annoying , considering HA indicates SmartLife and Tuya are supposed to be in HA Core now, but I've yet to see HA Core respond on that. I've also had no luck disabling polling for updates or skipping the QR code and submitting through the error - and it continues to work. Uninstalling all Smartlife/Tuya custom components doesn't solve it either.
I just reboot HA when I Tuya needs to re-authenticate. It fixes it for awhile, but it does come back sooner or later with the same error. An automation to reboot HA when it needs to be re-authenticated would be a partial solution. Unfortunately I can't seem to get such automation to work due to my lack of knowledge here.... Does someone else know how to do this that they can share ?
Ok, after i wrote that turning off polling worked for me, after couple weeks/months, i also have the same problem again. I think it came after the last HA update.
I just upgraded my working HA core 2024.5.5 to the latest version HA core 2024.6.4 and immediately got the authentication errors. Restored the HA core 2024.5.5 and immediately got the authentication errors on an install that was error free 5 minutes ago.
I think i am going to discconect them from the cloud with flashing, i just have 5 devices left which I can't swap out now because of the prices, so flashing 5 devices shouldn't be that much of a problem. Maybe also an idea for others to do this for the wifi tuya stuff. I already have all my tuya zigbee connected through z2m, so they are not a problem. Someone here said they have over 200 devices if I'm not mistaken, i guess for that person it would take for ever to do something like that
Ok, i have the warning that i need to log in for 2 days now, but all my devices from tuya just work without re authenticate, so that's weird
I can't get back online no matter what with my existing smart life account it authenticates on the qr fine and says its working. It then trial to initialize and but then it gives the error Failed to setup, Authenticate Failed. Please re-authenticate.
Things I have tried:
- Reauthenticate via the QR in original account
- Deleted previous iot cloud project
- Reauthenticate via the QR in original account about 20 more times.
- Turned off polling etc. as mentioned above.
- Restarted home assistant a lot.
- I created a new smart life account, transferred my home ownership to it (173 devices...). Still same authenticate failed.
- Created another smart life account with 10 devices in it. Added it via the QR code. Authenticated fine and works.
I dont want to repair 170 devices! Please help if You can! :)
We've been informed by the Tuya team that they have fixed the issue on their end, causing the occasional signature errors.
Closing this issue on our end.
../Frenck