core icon indicating copy to clipboard operation
core copied to clipboard

Tuya Integration - Expired Barcode When Authentication Expires

Open ifflanb opened this issue 1 year ago • 8 comments

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

ifflanb avatar Apr 08 '24 22:04 ifflanb

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)

home-assistant[bot] avatar Apr 14 '24 23:04 home-assistant[bot]

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?!

andreasbuff avatar Apr 24 '24 04:04 andreasbuff

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.

dubrox avatar May 14 '24 10:05 dubrox

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.

Nezz avatar Jun 11 '24 07:06 Nezz

@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.

accessiblepixel avatar Jul 12 '24 04:07 accessiblepixel

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

kobi111 avatar Aug 09 '24 08:08 kobi111

@ dubrox Much appreciated!

ChipperActual avatar Aug 13 '24 23:08 ChipperActual

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.

Feriman22 avatar Oct 11 '24 10:10 Feriman22

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

renatopagan avatar Nov 05 '24 20:11 renatopagan

Core 2025.1.2 still has the same issue.

The workaround from @dubrox works! Thank you!

SebastiaanVBH avatar Jan 17 '25 10:01 SebastiaanVBH

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.

Issue still exists, fortunately the workaround from @dubrox still works.

36grad avatar Mar 07 '25 14:03 36grad

There hasn't been any activity on this issue recently. Due to the high number of incoming GitHub notifications, we have to clean some of the old issues, as many of them have already been resolved with the latest updates. Please make sure to update to the latest Home Assistant version and check if that solves the issue. Let us know if that works for you by adding a comment 👍 This issue has now been marked as stale and will be closed if no further activity occurs. Thank you for your contributions.