I noticed earlier today that one of my Tuya switches was offline in HA (but showed online in the Smart Life app) and I couldn’t get it back online by reloading the integration or even restarting HA.
When checking Tuya’s IOT website the device showed up offline there
I wasn’t sure what to do but this clearly seems the reason why my switch shows up as unavailable in HA, so I raised ticket with Tuya.
Just wanted to check here if anybody else’s Tuya devices have gone offline at around 2am PT this morning.
Just as quickly as it was unavailable in HA it reappeared - shows back as online in Tuya as it should, looks like it was back online within 24h.
hey, i have the same problem.
I restarted and updated HA, unlink and link smart life in Tuya iot but the problem continue.
Do you have any suggestion to do?
J.Soko
(Joachim Sokolowski)
February 3, 2024, 7:03am
4
And here ist the solution:
Tuya has provided an easier and improved login method for Home Assistant users. Having a developer account with Tuya is no longer required; instead, you can scan a QR code with your Tuya Smart of Smart Life app to authenticate it with Home Assistant.
After the upgrade, Home Assistant will ask you to re-authenticate your Tuya Smart or Smart Life account using the new method.
home-assistant:dev
← home-assistant:tuya-sharing-sdk
opened 07:10PM - 30 Jan 24 UTC
<!--
You are amazing! Thanks for contributing to our project!
Please, DO N… OT DELETE ANY TEXT from this template! (unless instructed).
-->
## Breaking change
<!--
If your PR contains a breaking change for existing users, it is important
to tell them what breaks, how to make it work again and why we did this.
This piece of text is published with the release notes, so it helps if you
write it towards our users, not us.
Note: Remove this section if this PR is NOT a breaking change.
-->
Tuya has provided an easier and improved login method for Home Assistant users. Having a developer account with Tuya is no longer required; instead, you can scan a QR code with your Tuya Smart of Smart Life app to authenticate it with Home Assistant.
After the upgrade, Home Assistant will ask you to re-authenticate your Tuya Smart or Smart Life account using this new method.
## Proposed change
<!--
Describe the big picture of your changes here to communicate to the
maintainers why we should accept this pull request. If it fixes a bug
or resolves a feature request, be sure to link to that issue in the
additional information section.
-->
This PR moves the Tuya integration onto the new sharing SDK, which removes the need for a developer account and can directly log users in by scanning a QR code using the Smart Life or the Tuya app.
![QR Code](https://github.com/home-assistant/core/assets/195327/840a653b-8e09-4b3a-a935-6d71d85c8bf1)
![QR Code Migration](https://github.com/home-assistant/core/assets/195327/391bfd31-2c16-413d-8d86-6e8b6269fb93)
This is powered by their new package: <https://github.com/tuya/tuya-device-sharing-sdk/>
This PR offers a migration path. On upgrade, a re-auth will be triggered that will request the user to log in using their Smart Life / Tuya Smart app. After re-auth, everything will continue to work as usual.
This PR is a combination of the work done in #103007 and #104767, updated to handle our latest features/standards.
Tested against both Tuya Smart and Smart Life accounts, with new integration setups and migrating ones, with a variety of devices (heater, AC, a bunch of bulbs, Christmas lights, doorbell camera, and siren).
## Type of change
<!--
What type of change does your PR introduce to Home Assistant?
NOTE: Please, check only 1! box!
If your PR requires multiple boxes to be checked, you'll most likely need to
split it into multiple PRs. This makes things easier and faster to code review.
-->
- [ ] Dependency upgrade
- [ ] Bugfix (non-breaking change which fixes an issue)
- [ ] New integration (thank you!)
- [ ] New feature (which adds functionality to an existing integration)
- [ ] Deprecation (breaking change to happen in the future)
- [x] Breaking change (fix/feature causing existing functionality to break)
- [ ] Code quality improvements to existing code or addition of tests
## Additional information
<!--
Details are important, and help maintainers processing your PR.
Please be sure to fill out additional details, if applicable.
-->
- This PR fixes or closes issue: fixes #
- This PR is related to issue:
- Link to documentation pull request: https://github.com/home-assistant/home-assistant.io/pull/31153
## Checklist
<!--
Put an `x` in the boxes that apply. You can also fill these out after
creating the PR. If you're unsure about any of them, don't hesitate to ask.
We're here to help! This is simply a reminder of what we are going to look
for before merging your code.
-->
- [x] The code change is tested and works locally.
- [x] Local tests pass. **Your PR cannot be merged unless tests pass**
- [x] There is no commented out code in this PR.
- [x] I have followed the [development checklist][dev-checklist]
- [x] I have followed the [perfect PR recommendations][perfect-pr]
- [x] The code has been formatted using Ruff (`ruff format homeassistant tests`)
- [x] Tests have been added to verify that the new code works.
If user exposed functionality or configuration variables are added/changed:
- [ ] Documentation added/updated for [www.home-assistant.io][docs-repository]
If the code communicates with devices, web services, or third-party tools:
- [x] The [manifest file][manifest-docs] has all fields filled out correctly.
Updated and included derived files by running: `python3 -m script.hassfest`.
- [x] New or updated dependencies have been added to `requirements_all.txt`.
Updated by running `python3 -m script.gen_requirements_all`.
- [x] For the updated dependencies - a link to the changelog, or at minimum a diff between library versions is added to the PR description.
- [ ] Untested files have been added to `.coveragerc`.
<!--
This project is very active and we have a high turnover of pull requests.
Unfortunately, the number of incoming pull requests is higher than what our
reviewers can review and merge so there is a long backlog of pull requests
waiting for review. You can help here!
By reviewing another pull request, you will help raise the code quality of
that pull request and the final review will be faster. This way the general
pace of pull request reviews will go up and your wait time will go down.
When picking a pull request to review, try to choose one that hasn't yet
been reviewed.
Thanks for helping out!
-->
To help with the load of incoming pull requests:
- [x] I have reviewed two other [open pull requests][prs] in this repository.
[prs]: https://github.com/home-assistant/core/pulls?q=is%3Aopen+is%3Apr+-author%3A%40me+-draft%3Atrue+-label%3Awaiting-for-upstream+sort%3Acreated-desc+review%3Anone+-status%3Afailure
<!--
Thank you for contributing <3
Below, some useful links you could explore:
-->
[dev-checklist]: https://developers.home-assistant.io/docs/development_checklist/
[manifest-docs]: https://developers.home-assistant.io/docs/creating_integration_manifest/
[quality-scale]: https://developers.home-assistant.io/docs/integration_quality_scale_index/
[docs-repository]: https://github.com/home-assistant/home-assistant.io
[perfect-pr]: https://developers.home-assistant.io/docs/review-process/#creating-the-perfect-pr
See also this thread:
Hey guys, I did the integration as it’s explained here… I can control the devices, but the automations I have are not working because the devices are still missing in the automations…
Do I have to go through each automation to adjust it again?!
This would take forever…
Or should I do something with the old tuya integration?
How this thing is going with you guys?
Thanks
2 Likes
Maybe I’m just too blind, but how do I activate the new tuya SDK? Install via pip3 is already done…
J.Soko
(Joachim Sokolowski)
February 3, 2024, 10:56am
6
Go to configuration - system - updates and choose beta chanel.
After upgrading to 2024.2b3 and restarting leave the beta chanel.
…
4 Likes
gege79
(luigi campanelli)
February 3, 2024, 11:09am
7
i deleted tuya from HA i try to readd it, but the configuration process is the same. i dont see any scan qr in HA
J.Soko
(Joachim Sokolowski)
February 3, 2024, 11:10am
8
Go to beta chanel (see above)…
1 Like
gege79
(luigi campanelli)
February 3, 2024, 11:34am
9
thanks sir, excuseme again for asking but beta chanel where? HA, Tuya panel or Smart Life app? really cant find
gege79
(luigi campanelli)
February 3, 2024, 11:49am
11
found thanks so after i join this chanel have to upgrade HA supervisor, core and OS, and after that theres a new Tuya Integration? thakns in advance
I believe so, I’m just doing it myself now too.
1 Like
When the updated HA loads you’ll see a notification by system which states an integration needs reconfiguring, this will be Tuya. Once you go in to it you’ll need to enter the code from your phones app then scan the QR code. Worked first time for me.
1 Like
gege79
(luigi campanelli)
February 3, 2024, 11:58am
14
WOW this is MAGIC. This worked, and now i see and can controll all devices
I might be being dumb here but do you mean Settings | System | Updates? Because if I go there it’s just blank “No updates available”
Upper right, three buttons. There you can enter beta channel.
Wayl25
(Adam)
February 3, 2024, 6:22pm
17
Thanks for your advice, it seems to be working. But why the did something like this, without coinformation with HA users, and why users have been forced to use beta version? I lost my trust for tuya platform, i think its possible that soon we have to pay for subscription to use Tuya devices in HA. I think yesterday i bought last tuya device
Rayc
(Ray Carter)
February 3, 2024, 6:28pm
18
Very excited to get this working since my trial period expired yesterday and I lost all my Tuya devices.
I have got to the point where I need to reconfigure the integration - and I need the user code from my phone app… but I am using the smart life app and the account and security section does not seem to have a user code… it has: Region, email address, project, alexa, password, fingerprint id, pattern lock, delete account. Is it somewhere else in the Smart life app? or can I get it from my online Tuya account perhaps?
Help!
CaptMauser
(Matthias Mauser)
February 4, 2024, 10:58am
19
Hello,
I did the update to new Tuya ingetration, nearly everything is working.
I have a 230V switch plug which can also monitor the power consumption. With new integration the power consumption has disappeared…
Would be great to have this solved. Thx
Geedsen
(Ben Geerdes)
February 4, 2024, 9:54pm
20
This is what I see in the beta channel, not the one mentioned: