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
74.06k stars 31.08k forks source link

Tuya Integration - Expired Barcode When Authentication Expires #115250

Open ifflanb opened 7 months ago

ifflanb commented 7 months ago

The problem

I started to get a message to re-authenticate my Tuya integration. I choose to doo so but when I scan the QR code that is provided, the Tuya app tells me that the QR code has expired.

What version of Home Assistant Core has the issue?

core-2024.4.2

What was the last working version of Home Assistant Core?

core-2024.4.1

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[bot] commented 7 months ago

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)

andreasbuff commented 7 months ago

Same here. Integration is expiering (for some reason). Reconfiguring with QR code is failing, -> "Code expired". Therefore you have to DELETE the whole integration and ADD it from scratch... very annoying. Happening every 2-3 days?!

dubrox commented 6 months ago

It happened to me and the workaround was to press submit button shown just below the QR code anyway. This popped an error message, about QR code expiration, just above the QR code image itself. Once that happened, I reloaded the page and a new, fresh QR code appeared. Scanning that with Tuya app was finally successful.

I hope my workaround will help others.

I still consider this user experience to be couterintuitive and cumbersome, so @tuya , or any of the other code owners, should fix it.

Nezz commented 5 months ago

I just had the same issue. Surprisingly even restarting Home Assistant wasn't enough to resolve the issue, but @dubrox's submit button press did the trick.

accessiblepixel commented 4 months ago

@dubrox You're an absolute star, thank you for discovering that!

HA said I needed to 'reauthenticate', so tried to in the SmartLife app and it said 'non mobile device' and it had expired when I scanned it...

When I saw Login error (E0020002): The QR code has expired, please close the page and reinstall the integration. I was like please nooooooo, reinstalling integrations breaks everything even if it works you have to spend time renaming everything... so thank you very much! Clicking submit on the QR code, then coming back out of it all, and going back into reconfigure, then scanning it with the app and it's all fixed :) I'm using 2024.06.02 (not updated to the latest yet).

I do mostly use localtuya for not having to deal with this kinda stuff, but the climate stuff still doesn't work too well with it.

kobi111 commented 3 months ago

Like Dubrox wrote, When you get Code expired in tuya phone app, click submit in home assistant. that action will build a new QR.

ChipperActual commented 3 months ago

@ dubrox Much appreciated!

Feriman22 commented 1 month ago

This will solve the problem (for me at least)

Click on your picture/name on the bottom left, look at the theme and change it back. I had to change it from black to light and then try again with the QR code.

renatopagan commented 3 weeks ago

I just faced the same issue. The workaround from here did the trick: https://github.com/home-assistant/core/issues/115250#issuecomment-2224591373