Skip to content

Tado migrate to OAuth Device Flow #140761

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

Merged
merged 36 commits into from
Mar 24, 2025

Conversation

erwindouna
Copy link
Contributor

@erwindouna erwindouna commented Mar 16, 2025

Breaking change

Tado made a notice of deprecation, that they will be removing the password from from their OAuth server and switch to the device flow.
This PR has an updated version of PyTado and now handles setting up the integration in Home Assistant via the device flow.
This also includes:

  • Migration of entry (major version)
  • Re-authentication
  • Removed reconfigure step; no longer applicable
  • User step

Proposed change

Type of change

  • 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)
  • Breaking change (fix/feature causing existing functionality to break)
  • Code quality improvements to existing code or addition of tests

Additional information

Checklist

  • The code change is tested and works locally.
  • Local tests pass. Your PR cannot be merged unless tests pass
  • There is no commented out code in this PR.
  • I have followed the development checklist
  • I have followed the perfect PR recommendations
  • The code has been formatted using Ruff (ruff format homeassistant tests)
  • Tests have been added to verify that the new code works.

If user exposed functionality or configuration variables are added/changed:

If the code communicates with devices, web services, or third-party tools:

  • The manifest file has all fields filled out correctly.
    Updated and included derived files by running: python3 -m script.hassfest.
  • New or updated dependencies have been added to requirements_all.txt.
    Updated by running python3 -m script.gen_requirements_all.
  • For the updated dependencies - a link to the changelog, or at minimum a diff between library versions is added to the PR description.

To help with the load of incoming pull requests:

@brokenp87
Copy link

I have a HA Green and receive this error when trying the workaround, can someone suggest a way to solve this?

image

@oscahie
Copy link

oscahie commented Mar 23, 2025

Same here Not a Home Assistant folder error when running the workaround 🤔 Using HAOS

@brokenp87
Copy link

Same here Not a Home Assistant folder error when running the workaround 🤔 Using HAOS

Tried a restart of the Terminal add-on, then I was able to run the workaround after three restart and cache cleaning (at first 500 error, then after a second restart timeout error, a third restart was the successful one).
Thanks to everyone for the support

@oscahie
Copy link

oscahie commented Mar 23, 2025

Thanks, restarting the Terminal add-on did the trick indeed! Weird how before the restart the config folder (which is a link to /homeassistant) was completely empty.

@erwindouna erwindouna mentioned this pull request Mar 24, 2025
@userdema
Copy link

userdema commented Mar 24, 2025

i had success to run the script, now i can authenticate, but after authentication success i'm encountering this error and entities doesn't load:

Device login flow status is PENDING. Starting re-authentication

And from logs:

Config entry 'Casa' for tado integration could not authenticate: Device login flow status is PENDING. Starting re-authentication.

@FrankBurgenstein
Copy link

Hey guys,
I am very grateful - worked immediately and easily as described.
HA OS on an INTEL-NUC-like Lenovo

@Moxser
Copy link

Moxser commented Mar 24, 2025

Thank you so much guys everything works great. 😃😃😃

@werfpsa
Copy link

werfpsa commented Mar 24, 2025

It works for me, but after reboot you have to reconnect Tado again.

@erwindouna erwindouna mentioned this pull request Mar 24, 2025
@joostlek joostlek merged commit 358f78c into home-assistant:dev Mar 24, 2025
48 checks passed
@erwindouna
Copy link
Contributor Author

The fix has been merged and this means it will be made available shortly! The earliest possibility will be in the Beta, on Wednesday the 26th of March. For those we didn't felt comfortable or were unable to get the custom component fix in (provided by @Dillton, again thanks for your great work around!), this is the easiest way to get the new code.
The other opportunity will be the release of 2025.4.0. Currently this PR is still qualified to be part in this release.

How to opt-in for the Beta?
First a short disclaimer: it's a Beta. Please treat it like a Beta. It might show some instabilities and hick-ups in parts of Home Assistant.

  1. Go-to your system settings:
    image

  2. Go-to updates:
    image

  3. On the top-right, find the three dots and click "Join Beta channel":
    image

  4. Confirm to join the Beta channel:
    image

I have installed the custom component/work around. What should I do?
You have to remove the customer component/work around. Why? The custom component will also be the first referenced to be used. Effectively meaning if you don't remove it, the old code will always be called and future updates of the Tado integration will not be made effective. If this is what you intend, feel free to do so. If you wish to get back on track, you have to remove the work around.
Please use the following command in your terminal:

rm -rf /config/custom_components/tado

Let me close of with thanking all the collaborators who were very eager to tinkering a long and find solutions and being very supportive to help other users! A great example, even in a dire situation, how the Open Source community tries to help each other!

Let's now focus on the Beta and onwards to the official release. Feel free to ask for support in this thread, which I will monitor to help around as best as I can. 😃

@ROB-SEN
Copy link

ROB-SEN commented Mar 24, 2025

It works...

THANKS!

@pservais
Copy link

The custom component fix worked for me :)!

@EACourts
Copy link

For those of us that need a little hand-holding, is there anything we need to explicitly do now? Does the fix work for both legacy Tado devices and the new Tado X devices?

@TDCroPower
Copy link

For those of us that need a little hand-holding, is there anything we need to explicitly do now? Does the fix work for both legacy Tado devices and the new Tado X devices?

For tado x we need to wait for this PR to merge…
wmalgadey/PyTado#183

@erwindouna erwindouna mentioned this pull request Mar 25, 2025
@github-actions github-actions bot locked and limited conversation to collaborators Mar 25, 2025
@erwindouna erwindouna deleted the tado-oauth-deviceflow branch March 26, 2025 19:20
@frenck
Copy link
Member

frenck commented Mar 26, 2025

Small heads up! This change is now available in our beta!

Some help testing the Home Assistant beta containing this, would be greatly appreciated.

More information on how to test the beta, can be found here:

https://github.com/home-assistant/core/releases/tag/2025.4.0b0

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

Successfully merging this pull request may close these issues.