home-assistant / core

:house_with_garden: Open source home automation that puts local control and privacy first.
https://www.home-assistant.io
Apache License 2.0
69.76k stars 28.91k forks source link

Tuya re-authorization problem . #120644

Closed motogon closed 2 days ago

motogon commented 1 week ago

The problem

Tuya app gives an error QR expired. Refresh it and scan again.

I have reloaded the integration but QR code is not updated

What version of Home Assistant Core has the issue?

core-2024.6.4

What was the last working version of Home Assistant Core?

--

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

home-assistant_tuya_2024-06-27T07-41-03.302Z.log.zip

Example YAML snippet

No response

Anything in the logs that might be useful for us?

No response

Additional information

No response

brofeelgood commented 6 days ago
  1. When you reconfigure, skip scanning the QR code the first time round. Instead, click submit in HA to force an error message.
  2. Refresh the HA screen and reconfigure again to get a new QR code. Scan this in your Smart Life app, then click submit in the HA session.

This was the solution that resolved a similar outage a few months back. It worked for me this time. Something worth trying in my opinion.

Edit: I spoke too soon. The device status updates have stopped, even though automations based on device statuses still work.

mansbo commented 6 days ago

Not sure if this is just co-incidence, but I had the same problem, and intended to go onto the tuya iot site to extend my access. When I got to the site, I was presented with new T&C's, privacy statement etc. to accept, which I did. I then rebooted my HA and the re-authenticate QR code was accepted and I was able to log back in. I only have one use for the core Tuya integration (a scene for IR blaster) with everything else on Tuya Local, but it's nice that it's working again (for now at least).

I wonder if this might be the solution. I did exactly the same thing yesterday (and note I DID NOT extend my trial period, just accepted the new T&Cs) and I have not had a re-auth request since. And that’s through several HA restarts while trying to get something else (unrelated) to work.

EdSpatariu commented 6 days ago

This is how the number of localtuya users will increase. Where the hell was I thinking to use cloud only integration for my IoT devices? If something was changed, and I am referring to my previous comment (https://github.com/home-assistant/core/issues/120644#issuecomment-2195598292), and we need to pay extra for 10+ controllable devices, then I would expect to be notified in advance as Tuya has our email addresses, not to "silently" change and don't give a shit on os. If there is an issue, I am expecting also that @tuya, @zlinoliver or @frenck to say few words here, not to be silent as they don't exist. Afterall, this made me realize that:

  1. Tuya is a non-reliable HA integration; I saw quicker and qualitative support form less used integrations than Tuya. There are more than 48 hours since we reported the issue and Tuya (including their contributors) are just ignoring us.
  2. It doesn't matter who is the developer behind an integration and how fancy-schmancy features provide, as long as it is cloud based I should run away and just ignore it.
  3. I should start researching for non-Tuya devices, with the goal of fully replacement. There is something Shelly based but doesn't cover all type of IoTs that Tuya covers (have a Shelly smart meter since more than one year and had no issue with that device or the integration).
  4. Chinese companies produce shity products, but also very good products. However, because nobody can audit them if they are compliant with European quality for consumers, they are just producing like copy/paste and try to make as much many as possible before that product will saturate market interest.
  5. I am very frustrated by they attitude!!!
peteS-UK commented 6 days ago

Not sure if this is just co-incidence, but I had the same problem, and intended to go onto the tuya iot site to extend my access. When I got to the site, I was presented with new T&C's, privacy statement etc. to accept, which I did. I then rebooted my HA and the re-authenticate QR code was accepted and I was able to log back in. I only have one use for the core Tuya integration (a scene for IR blaster) with everything else on Tuya Local, but it's nice that it's working again (for now at least).

I wonder if this might be the solution. I did exactly the same thing yesterday (and note I DID NOT extend my trial period, just accepted the new T&Cs) and I have not had a re-auth request since. And that’s through several HA restarts while trying to get something else (unrelated) to work.

I also didn't extend my trial - just accepted the T&Cs and then thought it might be worth giving the re-auth another try before extending.

brofeelgood commented 6 days ago

Update 2: Got it back again.

image

Click the 3 dots to reload the Tuya integration until every device and entity is successfully reloaded. Ignore the blue RECONFIGURE button for the time being. It took me 4 tries (lucky me) to get a successful reload.

image

Once you're here, click RECONFIGURE and follow this:

  1. Skip scanning the QR code the first time round. Instead, click submit in HA to force the following error message.
  2. Refresh the HA screen and reconfigure again to get a new QR code. Scan this new QR code in your Smart Life app, then click submit in the HA session.

image

Update 3: One hour in, still good. Nothing glaring in the logs. Switch and sensor status updates are responsive.

applegeeks commented 6 days ago

Not sure if this is just co-incidence, but I had the same problem, and intended to go onto the tuya iot site to extend my access. When I got to the site, I was presented with new T&C's, privacy statement etc. to accept, which I did. I then rebooted my HA and the re-authenticate QR code was accepted and I was able to log back in. I only have one use for the core Tuya integration (a scene for IR blaster) with everything else on Tuya Local, but it's nice that it's working again (for now at least).

I wonder if this might be the solution. I did exactly the same thing yesterday (and note I DID NOT extend my trial period, just accepted the new T&Cs) and I have not had a re-auth request since. And that’s through several HA restarts while trying to get something else (unrelated) to work.

I also didn't extend my trial - just accepted the T&Cs and then thought it might be worth giving the re-auth another try before extending.

How come you guys are still using the tuya cloud dev platform for device access? I thought with the new qr option, we are done away with the use of the access key and trial extensions?

I’ve revoked all my tuya project access since they implemented the QR option for the tuya integration with the latest HA and has been working for months. Except the last few days ofcourse.

applegeeks commented 6 days ago

Update 2: Got it back again.

image

Click the 3 dots to reload the Tuya integration until every device and entity is successfully reloaded. Ignore the blue RECONFIGURE button for the time being. It took me 4 tries (lucky me) to get a successful reload.

image

Once you're here, click RECONFIGURE and follow this:

  1. Skip scanning the QR code the first time round. Instead, click submit in HA to force the following error message.

image

  1. Refresh the HA screen and reconfigure again to get a new QR code. Scan this new QR code in your Smart Life app, then click submit in the HA session.

image

I was just about to test doing this and decide to reload my integration but it seemed to have reloaded ok. Is this the beginning of it working again?

NameIstSchonVergeben commented 6 days ago

OK - I see - I'am not alone

After each restart of HA the Authenification is need to do again

Where ist the solution? What works realy? ....

heibertelf commented 6 days ago

It just magically fixed itself today. I didn't touch anything, hoping that it would be fixed in Tuya itself or in the integration, and this afternoon it started working as before. image image Looks like they fixed something. I hope the problem resolves as well soon for anyone else who has encountered this.

ptgomes commented 6 days ago

It just magically fixed itself today. I didn't touch anything, hoping that it would be fixed in Tuya itself or in the integration, and this afternoon it started working as before. image image Looks like they fixed something. I hope the problem resolves as well soon for anyone else who has encountered this.

Mine is like that but still says it needs configuration. But is working

clanic70 commented 6 days ago

Hi all, here the same boring issue. Every time I restart HA, I must re-configure Tuya from the beginning also using qr code. I thought that using Tuya local I'd get ride of this problem but many times it goes offline too 😞

yngwiebach commented 6 days ago

I am still running into issues. Nothing with the tuya is working.

motogon commented 6 days ago

Where ist the solution? What works realy? ....

OK - I see - I'am not alone

After each restart of HA the Authenification is need to do again

Where ist the solution? What works realy? ....

go back to HA version 2024.1.0 above described :)

bernardofortes commented 6 days ago

UPDATE 2: instability returned. not working properly

EdSpatariu commented 6 days ago

@balloob I am curious if you see this and allow such indifference from the support team. If a method of authentication starts to fail, why don't you revert to a previous auth method that worked? And even more important, why are the hack all officials not stepping in to at least let us know that this issue is under investigation and eventually will be fixed?

ajpalm commented 5 days ago

Same as everyone else, re-scanned the QR code a few times now, all worked only for it to require re-authorization again within 24 hours generally.

miguelzx commented 5 days ago

The only thing that worked for me was deauthorizing Home Assistants from your application and so I got in the first time. Regards.

Teammie73 commented 5 days ago

Update 2: Got it back again.

image

Click the 3 dots to reload the Tuya integration until every device and entity is successfully reloaded. Ignore the blue RECONFIGURE button for the time being. It took me 4 tries (lucky me) to get a successful reload.

image

Once you're here, click RECONFIGURE and follow this:

  1. Skip scanning the QR code the first time round. Instead, click submit in HA to force the following error message.
  2. Refresh the HA screen and reconfigure again to get a new QR code. Scan this new QR code in your Smart Life app, then click submit in the HA session.

image

Update 3: One hour in, still good. Nothing glaring in the logs. Switch and sensor status updates are responsive.

Worked perfectly for me - thanks !!! Took some tries more but finally it worked !

idanuz commented 5 days ago

No luck for me. Tried to click the submit , refresh, nothing works. :(

TurboKanne commented 5 days ago

Update 2: Got it back again.

image

Click the 3 dots to reload the Tuya integration until every device and entity is successfully reloaded. Ignore the blue RECONFIGURE button for the time being. It took me 4 tries (lucky me) to get a successful reload.

image

Once you're here, click RECONFIGURE and follow this:

  1. Skip scanning the QR code the first time round. Instead, click submit in HA to force the following error message.
  2. Refresh the HA screen and reconfigure again to get a new QR code. Scan this new QR code in your Smart Life app, then click submit in the HA session.

image

Update 3: One hour in, still good. Nothing glaring in the logs. Switch and sensor status updates are responsive.

reload the integritiy with the 3 dots, tried it at least 50 times, still no luck. 106 devices still not functional

Screenshot 2024-06-30 085043

Nick-500 commented 5 days ago

Not worky for over 3 days now. F""ck! I hate Doing updates( Every time SHt happens and everyone is frastrated!!!!!!!!!!!!!!(((((((((((

Nick-500 commented 5 days ago

Did anyone made a tiket to Tuya?

caitotheonlypotato commented 5 days ago

Not worky for over 3 days now. F""ck! I hate Doing updates( Every time SHt happens and everyone is frastrated!!!!!!!!!!!!!!(((((((((((

I didn't do an update, just one morning was no longer working

TurboKanne commented 5 days ago

So many people with so many devices are affected, which shows me that "smart home" is a makeshift hobby solution and not suitable for the masses, especially when something doesn't work and you're left stranded.

pergolafabio commented 5 days ago

Switch to tuya local, so you are not dependent on cloud!! Cloud is always a risk if they change something

TurboKanne commented 5 days ago

I use Local Tuya for compatible devices (mainly the light switches), but the majority of devices, like the curtain switches, do not work with Local Tuya. Therefore, all the morning and evening routines for the curtains on all windows (and during sunny days for shading the windows) unfortunately do not work. Also the humidity sensors for the air ventialation and the door and window sensors for alerts do not work with Local Tuya either.

pergolafabio commented 5 days ago

There is also "tuya local" instead of "local tuya*, with the other integration you can easily add your own devices if those are not supported yet

TurboKanne commented 5 days ago

the alterantive local tuya integration does not work for me also, currently I am working on a bypass via Google Home, letting HA call Google to control the device instead of HA direclty talk to Tuya devices. 🙄

ggonmar commented 5 days ago

That approach sounds the most reliable, let us know how you advance with that!

El dom, 30 jun 2024, 12:27, TurboKanne @.***> escribió:

the alterantive local tuya integration does not work for me also, currently I am working on a bypass via Google Home, letting HA call Google to control the device instead of HA direclty talk to Tuya devices. 🙄

— Reply to this email directly, view it on GitHub https://github.com/home-assistant/core/issues/120644#issuecomment-2198510923, or unsubscribe https://github.com/notifications/unsubscribe-auth/ACYL6OAEB5OQ6QRKKMHEFSDZJ7MQ7AVCNFSM6AAAAABJ7LO6T6VHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDCOJYGUYTAOJSGM . You are receiving this because you are subscribed to this thread.Message ID: @.***>

JarreNejatyab commented 5 days ago

I had this issue, and I was using smart life account , I switched over to Tuya instead (patiently moving all devices) and the issue is gone now.

peteS-UK commented 5 days ago

There is also "tuya local" instead of "local tuya*, with the other integration you can easily add your own devices if those are not supported yet

I moved all of my devices to tuya local (not local tuya) a year or so again - not least because I could create my own configs for the available dps etc.. Works very nicely. I only have the Tuya integration in use these days for a "scene" to work with an IR blaster which I can't make work reliably. I might revisit that again...

PawSan commented 5 days ago

This Chinese "app" should be banned from civilized world. It's useless like almost everything from China!

TurboKanne commented 5 days ago

That approach sounds the most reliable, let us know how you advance with that! El dom, 30 jun 2024, 12:27, TurboKanne @.> escribió: the alterantive local tuya integration does not work for me also, currently I am working on a bypass via Google Home, letting HA call Google to control the device instead of HA direclty talk to Tuya devices. 🙄 — Reply to this email directly, view it on GitHub <#120644 (comment)>, or unsubscribe https://github.com/notifications/unsubscribe-auth/ACYL6OAEB5OQ6QRKKMHEFSDZJ7MQ7AVCNFSM6AAAAABJ7LO6T6VHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDCOJYGUYTAOJSGM . You are receiving this because you are subscribed to this thread.Message ID: @.>

Ok, this is working for me smoothly. I did the following (maybe useful for others having Node Red to control Tuya curtain switches depending on time, weather, temperatur, motion).

I added a Boolean Switch called "Google Tuya Bypass". If this is true it should use Google commands to use the tuya switch (with the google_assistant_sdk call). then I added a Node "current state" into my flow checking if the Boolean is true or false. If false then it should follow the original path and if true it should go to the google command, opening/closing the curtain.

Original example:

image

Example wih Bypass (so that the command to the switch goes via Google)

image

Here is a screenshot from one of the full flows (having switch operators for different parts of the year, seasons, calendar events and according to that, different delays.

image

You see it is only a small bypass at the right hand side, which lets my flow work again although Tuya is out of order. Only disadventage so far, Google commands won't let me stop the curtain after a few seconds, so it is only 100% open or 100% closed.

caitotheonlypotato commented 5 days ago

I have just come back online :/

motogon commented 5 days ago

I just noticed the door sensors aren't working. Battery level data - shows . But it does not update the status when the door is opened. Although in tuya application - the value at opening is fixed. I guess we should get rid of everything related to tuya because the service is degrading.

clanic70 commented 5 days ago

What I'm seeing from my side, is that with SmartLife all devices are working well in HA until I reboot it; then I must start over with Smartlife configuration (adding new Hub using user code and QR). So, I would recommend to migrate all your Tuya devices into SmartLife. Cheers

rsmatias commented 5 days ago

Hi everyone,

I have just reloaded Tuya integration, then clicked on "Reconfigure" and in the tuya app on IOS click on "+" and scanned the QR CODE. It came back online and I already see my devices and entities again.

Cheers!

TobiasPSP commented 5 days ago

Every time I install a HA update, tuya integration requires re-auth. I am software engineer and love what HA does but it puzzles me why there are so many updates in such short intervals. That feels unsafe and unprofessional as the update intervals are just too short to thoroughly test for regressions. Why isn’t there a dev/beta schedule and a mainstream schedule with the latter limiting itself to bi-annual updates? This would keep the platform so much more stable, and although probably not the root cause, would trigger much less tuya re-auths.

mplugge commented 5 days ago

still the same re-auth problem :(

MondMann2019 commented 5 days ago

After a restart of Home assistant everything works nicely again.

Don't know, what the problem was. Before I had the same problem.

caitotheonlypotato commented 5 days ago

I speak too soon, my success didn't last long. Maybe this means someone's poking around behind the scenes trying to fix what's broke!

applegeeks commented 5 days ago

mine still reports re-configure when HA is restarted and fails for the integration to come online but I've just been reloading the integration without touching the authentication and after the second or third reload, the integration seems to come online ok without any problem now. image

EdSpatariu commented 4 days ago

What I'm seeing from my side, is that with SmartLife all devices are working well in HA until I reboot it; then I must start over with Smartlife configuration (adding new Hub using user code and QR). So, I would recommend to migrate all your Tuya devices into SmartLife. Cheers

I am using SmartLife and I already reported this issue since the beginning. In my case, other versions for HA core are not acceptable as restoring them from a backup removes all the readings and statistics I have recorded in HA. As I am using Hassio (HA on Pi 5), downgrading from terminal is not an option (and is not working). So, either make some time for migrating everything to Tuya local (couple of days) or live with this issue and the hope that maybe the issue will be fixed, unless I will be frustrated enough and forcibly dedicate few days for migration. As @TobiasPSP and many of you mentioned, HA core updated each week shows lack of professionalism and proves that nobody is testing the build before being released. Everybody wants integrations for their godforsaken IoT devices, but in my case, I would prefer to wait 3 - 4 months for a working integration and for an update that is not breaking anything that already is working!

applegeeks commented 4 days ago

So far still an issue. Restarted my HA Integration Failed to load Reconfigure prompt for authentication.

Ignored reconfigure prompt. Reloaded tuya integration 3 times and loaded successfully on the 3rd time. So it seems to work after re-trying to reload the tuya integration a few times.

Anyone else encountering the same results?

diverPaul commented 4 days ago

You should log in to iot.tuya.com and confirm the new privacy options. At least that did the Trick for me.

applegeeks commented 4 days ago

You should log in to iot.tuya.com and confirm the new privacy options. At least that did the Trick for me.

I logged into it already and I didn't see the privacy options people are referring to. Maybe because I don't have any smart home projects or authorizations enabled.

Delete them since the QR account linking was made available

TobiasPSP commented 4 days ago

It‘s not the need to re-auth every now and then (which is bad enough).

What currently disqualifies HA/Tuya for real home automation (versus hobbyist fiddling around as a toy) is the complete failure of tuya re-authentication - it hits randomly, can last for minutes or many days, cuts all access to home automation and can repeatedly hit you any second again after wasting hours of rebuilding. That’s the rather helpless feeling from a users perspective (in lack of any facts).

At minimum, we need information about what exactly happens during tuya auth - instead of wildly guessing whether i.e. a smartlife or tuya account is beneficial.

Facts are needed. Is this a tuya api issue, or a bug in HA? Is there an overview of the api used? Is there api documentation and i.e. ways to independently troubleshoot/test the api from own scripts to isolate problems?

I am more than glad to help and test/provide info. Enable me.

Toker101 commented 4 days ago

mine wont let me re-authenticate, keeps telling me the QR code has expired, lost access to @ 20 devices now :-(

Same...

StevusPrimus commented 4 days ago

You should log in to iot.tuya.com and confirm the new privacy options. At least that did the Trick for me.

This did the trick for me as well. Login to iot.tuya.com and accept the new terms. Afterwards restart HA via Developer tools. As a result I could login successfully.

Toker101 commented 4 days ago

I'm not getting a request to confirm the new terms...

Op ma 1 jul 2024 om 08:05 schreef StevusPrimus @.***>:

You should log in to iot.tuya.com and confirm the new privacy options. At least that did the Trick for me.

This did the trick for me as well. Login to iot.tuya.com and accept the new terms. Afterwards restart HA via Developer tools. As a result I could login successfully.

— Reply to this email directly, view it on GitHub https://github.com/home-assistant/core/issues/120644#issuecomment-2199309997, or unsubscribe https://github.com/notifications/unsubscribe-auth/AIY4CXVSWLCF6S4KC2KJ2ZTZKDWT3AVCNFSM6AAAAABJ7LO6T6VHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDCOJZGMYDSOJZG4 . You are receiving this because you commented.Message ID: @.***>