Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Tuya requires regular revalidation after 2024.2.1 update #110713

Open
rleatherb opened this issue Feb 16, 2024 · 27 comments
Open

Tuya requires regular revalidation after 2024.2.1 update #110713

rleatherb opened this issue Feb 16, 2024 · 27 comments
Assignees

Comments

@rleatherb
Copy link

The problem

After installing version 2024.2.1 of Home Assistant, where the Tuya account setup changed, I successfully validated my account via SmartLife and all was fine. However, on two separate occasions since then, Home Assistant has disconnected from Tuya. There was no apparent warning, but Tuya devices just didn't work from Home Assistant. On restarting Home Assistant (but not before), on each occasion there was a system message that I needed to revalidate my account, which I did using the QR code. Once revalidated all Tuya devices worked again.

Revalidating my Tuya account every week is simply unworkable. The QR code method means I cannot do this when out of the office as you need a display for the QR code and your phone to input this into SmartLife. Between the connection failing and revalidation no automations involving Tuya devices work, which is unacceptable. The "old" Tuya authentication method worked without issue prior to the latest release.

Am I the only one finding this?

What version of Home Assistant Core has the issue?

core-2024.2.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

No response

Anything in the logs that might be useful for us?

No response

Additional information

No response

@home-assistant
Copy link

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)

@rleatherb
Copy link
Author

It happened again today.
WhatsApp Image 2024-02-17 at 07 45 14_05e30d1e

Home Assistant appeared to be locked up and I couldn't connect. After restarting it seems that all Tuya devices had stopped responding some time before I needed to restart.

The first time I tried I also got the following error, which persisted until I restarted Home Assistant again, after which I finally managed to reauthenticate successfully.
2024-02-17 07 48 56

@HaraldGithub
Copy link

Same here after update from 2024.2.1 to 2024.2.2

But it happened only once after update. After the next restart of HA, there was no new authentication required.

@ancjsd
Copy link

ancjsd commented Feb 17, 2024

This is occurring frequently for me on restarting Home Assistant.

@gmhall506
Copy link

All my Tuya lights say “Entity not available.”

@rleatherb
Copy link
Author

All my Tuya lights say “Entity not available.”

If you don't have a "reauthenticate integration" showing under settings, it might appear after restarting Home Assistant. Not a solution, but might get your Tuya integration working again

@matthewbarr
Copy link

I just had this happen. I will say.. this is reinforcing my desire to avoid all wifi devices, and I just ordered 2 tuya zigbee smart plugs instead.

@syersjr
Copy link

syersjr commented Feb 18, 2024

I am also having this problem, Tuya authentication required - I have the Tuya app, my Tuya developers account seems fine. I have spent hours trying to get the Tuya QR code to get accepted by the Tuya app, Tried everything showing QR code on my iPad, changing my DNS servers back to 8.8.8.8 (Google) - I can't get past the Home Assistant Tuya QR code, keep getting the QR code has expired, please refresh and try again. I would like to be able to skip the QR code and enter my Tuya User Code directly into the Home Assistant Tuya integration.

@jorenmartijn
Copy link

I have had this happen a few times too on my new HA install on TrueNAS Scale. It's the only integration that has these problems and it's annoying to have to reload the integration (twice) each time to get it to function properly again. Maybe I should figure out how to do a local control instead. But I'd rather the integration just worked properly instead. Hope you guys can figure it out. Thanks. :)

@Jmphiphi85
Copy link

I have similar problem, Yesterday After update

@dvinciguerra
Copy link

When I update my Home Assistant, the Tuya integration notify that I need to reconfigure.

Then, I tried to reconfigure, but the QR Code doesn't load properly.

To try solve the problem, I opened browser devtool at network tab and proceed to generate QR Code until the rendering error.

Next, I get the response payload and find by an auth token.

When I found, I copied the token and generate the QR Code using a secure app.

I opened the smart life app and scan QR Code generated.

Now I'm about 2 days with my integration running stable again. =)

@gmhall506
Copy link

gmhall506 commented Feb 21, 2024 via email

@esotere
Copy link

esotere commented Feb 21, 2024

Any updates on this issue? Been having the same problem since the 2024.2 update, So far the only lasting solution is downgrading the update to 2024.1.~ otherwise one would have to keep reloading the integration or restart HA continuously in order for some automations to work.

I have attempted ALL the steps and/or solutions suggested. Yes, my automations seem to work at first, and yes the states and entities are available but then for some reason they just cease to work. For instance after reloading the integration the motion sensors turn on the lights as expected, however, when the sensor is cleared the lights remain on indefinitely until I manually turn them off or reload the integration or restart my instance.

Any assistance or suggestion will be much appreciated.

Edit**
Note: This is neither a configuration nor authentication issue.

@AriaRobav
Copy link

I am also having this problem (Tuya authentication required every reboot) also after updating to 2024.2.2 version.

@sjc073
Copy link

sjc073 commented Feb 29, 2024

This is happening to me too. Every time I update HA I get the following notification.
Authentication expired for “username”

Core - 2024.2.5
Supervisor - 2024.02.0
Operating System - 12.0
Frontend - 20240207.1

@AlainPeccable
Copy link

Same here since last update, prior to that it was working fine.
Core: 2024.2.5
Supervisor: 2024.02.1
Operating System: 12.0
Interface utilisateur: 20240207.1

  1. if no immediate action you need to restart again as QR expire and there is no way to regenerate a new one.
  2. you need to be using 2 devices as from a mobile phone only you can't reauthenticate.

@n00b12345
Copy link

Facing the same issue sadly.

@Mukh-Samum
Copy link

I've been facing the same problem since the last update: each HASS reboot needs the Tuya integration to be reauthenticated via QR.

@JDBalogh
Copy link

According to https://github.com/tuya/tuya-smart-life :
"This project has now officially been integrated into the Home Assistant official project core repository, corresponding to version 2024.2."
AKA: No more Tuya "Authenticate" needed - just use Home Assistant to discover and add these devices.

@andreasbuff
Copy link

andreasbuff commented Apr 10, 2024

Same problem here!? Yes, Tuya authentication moved to Home Assistant. I 2 deleted whole Tuya integration and installed and authenticated from within the Home Assistant App. BUT after some days, an error Message is poping up, saying "Authentication has expired 1 Month (or so) ago! Need to reauthenticate Tuya?????
I am running two separate HA Instances with 2 separate Smart Life (Tuya, different users) Integrations. Two HWs (identical configuration), same OS- and HA-Levels, but only 1 (one) is showing this error? The other is working fine..
Please help! Thanks

@oopiicaa
Copy link

oopiicaa commented May 12, 2024

Happened to me today also - my virtual instance for HA was unresponsive, clogging up my CPU. Had to restart the virtual machine. Never happened before.

Core
2024.5.3
Supervisor
2024.05.1
Operating System
12.3

@spanzetta
Copy link

Same issue here..
Running HA OS on RPI PI3A+
Any way to fix it?

@spanzetta
Copy link

Solved by "forcing" a submit in HA without reading the QRcode in SmarLife app.. then the QRcode is renewed and the reauthentication on SmartLife app did work..

@anderconsu
Copy link

Same here

@spanzetta
Copy link

It is now happening quite frequently..
Almost every week..
Why?

@Nebneb
Copy link

Nebneb commented Jun 9, 2024

Same issue here, now happening every day 😢
Here's the log chunk:

2024-06-09 09:23:26.431 ERROR (SyncWorker_0) [tuya_sharing] net work error = network error:(1010) token is expired
2024-06-09 09:23:26.497 ERROR (MainThread) [homeassistant.config_entries] Error setting up entry <my_email_address> 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

@ajcorrea
Copy link

ajcorrea commented Jun 9, 2024

Same issue here, now happening every day 😢 Here's the log chunk:

2024-06-09 09:23:26.431 ERROR (SyncWorker_0) [tuya_sharing] net work error = network error:(1010) token is expired
2024-06-09 09:23:26.497 ERROR (MainThread) [homeassistant.config_entries] Error setting up entry <my_email_address> 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

Same error here;;;

Core 2024.6.1
Supervisor 2024.06.0
Frontend 20240605.0

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests