Replies: 2 comments 1 reply
-
|
You really put some great effort in this RFC, thanks @micsco ! I'll have to find time to read through and give it the time it deserves - but it's on my list! :) |
Beta Was this translation helpful? Give feedback.
-
|
Overall I think this makes sense and there's a long desire from the community to integrate Tado X. From the library's perspective that's a technical capability we can facilitate. It will put a burden on ones API rate limit, but that's the personal choice people can make. :) I do have a question on the home ID and generation: why do users need to supply this manually? From a library point of view this could make sense, but from a user experience if integrated in HA, it would be another step to manually perform. Provided we update the instructions, there are some users who're tech savy enough to easily obtain it, others will have difficulties. The goal should be that the more we can automate, the better. :) |
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
-
Hi @erwindouna — I put together this RFC after seeing how well other projects document bigger changes and because I wanted to sanity-check my own approach. I leaned on LLMs for some of the research/writing scaffolding, but everything here is heavily edited and I’ve done my best to keep it free of AI-slop. Please treat this as a friendly proposal rather than a finished spec; I’m keen to hear what you think. I originally hoped to land this in the upstream pyTado library, but given your ongoing Home Assistant core work (especially home-assistant/core#151933), I figured it made more sense to collaborate directly here. Selfishly, I just finished a home renovation and switched my entire house over to Tado X, so I’m motivated to help unblock support.
1. TL;DR
tadoasyncinto a shared engine plus plug-in strategies so it can talk to bothmy.tado.comandhops.tado.comwithout exposing branching to callers.home_id+ generation during setup, skipping redundant discovery calls while picking up the new canonical helpers (with caching/instrumentation hooks to respect Tado’s rate limits).2. Background & Goals
Tado confirmed in GitHub issue #151223 that Tado X is the long-term platform and that cloud usage will be rate-limited. Right now Home Assistant only talks to the legacy API via
tadoasync, so brand-new Tado X installs show nothing. The missing pieces:hops.tado.com.Goals
hops.tado.comwithout breaking existing consumers.Non-goals Firmware reverse-engineering, Matter/HomeKit feature parity, or UX redesign beyond collecting
home_id+ generation.3. Architecture Overview
Here’s how I picture the moving parts fitting together.
3.1 Shared Engine
Tadostays the public entry point and now owns authentication, the master_request, caching hooks, and instrumentation.3.2 Pluggable Strategies
TadoHomeStrategydefines the contract for home-scoped actions (async_get_rooms,async_set_manual_control, etc.).LegacyHomeStrategykeeps the currentmy.tado.comlogic.HopsHomeStrategyadds thehops.tado.comimplementation.flowchart LR Client(["Client (Home Assistant)"]) --> Engine["Tado Engine<br/>(auth, cache, metrics)"] Engine --> Detect{"Strategy selection"} Detect -->|"Caller supplied<br/>home_id + generation (legacy)"| Legacy["LegacyHomeStrategy<br/>(my.tado.com)"] Detect -->|"Caller supplied<br/>home_id + generation (LINE_X)"| Hops["HopsHomeStrategy<br/>(hops.tado.com)"] Detect -->|"Need metadata"| MeAPI["GET /api/v2/me<br/>+ /api/v2/homes/{id}"] MeAPI --> Gen{"generation == LINE_X?"} Gen -- yes --> Hops Gen -- no --> Legacy Hops -->|"canonical rooms, etc."| Engine Legacy -->|"canonical rooms, etc."| Engine Engine --> Client3.3 Strategy Selection Flow
The selection logic mirrors the Tado web client: rely on the
generationflag exposed byGET /api/v2/me(and the follow-upGET /api/v2/homes/{id}), which always comes frommy.tado.comregardless of hardware generation. No calls tohops.tado.com/homes/{id}are required for detection.home_id+home_generationGET /api/v2/me/GET /api/v2/homes/{id}reportsgeneration == "LINE_X"HopsHomeStrategyand marksupports_tadox = True.generationexists but is notLINE_XLegacyHomeStrategy.The chosen strategy flag is cached on the
Tadoinstance so detection happens once per session, and trusted clients can avoid even that by supplying metadata up front.4. Capability Coverage
Core capabilities (derived from the Tado web-client capture) that both strategies must expose:
/api/v2/homes/{id}/zones,/zones/{id}/state/homes/{id}/rooms,/rooms/{id}zoneshelpers adapt canonicalRoommodels. Newroomshelpers return canonical models directly./zones/{id}/overlay,/zones/{id}/overlayDELETE/rooms/{id}/manualControl,/rooms/{id}/resumeSchedule,/quickActions/*overlaymethods are adapted from newmanualControlandquickActionscanonical methods./zones/{id}/schedule/rooms/{id}/schedule/hotWater/*endpoints/programmer/domesticHotWater/*/homes/{id}/settings/*/homes/{id}/settings/*/presenceLock/quickActions/{action}presenceLockwhere applicable.5. Model Strategy & Open Questions
Tado have stated in multiple forums that legacy devices are not being deprecated today, although the feature velocity clearly favours Tado X. I propose leaning toward Tado X terminology, but I also want feedback on whether that is the right long-term bet or whether a “neutral” naming scheme would serve the community better.
5.1 Proposed approach
Zone,ZoneState) via adapters. This keeps Home Assistant and downstream projects stable while I introduce the new nomenclature in parallel.async_get_rooms(),async_get_room_state(), etc., returning newRoom,RoomState,ManualControlRequestmodels that match the Tado X payloads and aggregate the superset of fields.async_get_zones()would call the canonical helpers and down-convert. I propose marking the legacy names as deprecated once Home Assistant and other major consumers migrate, targeting removal in a future major release.5.2 Open question
HomeRoom) to avoid picking sides? Feedback here will shape the adapter and deprecation timeline.The adapters, canonical dataclasses, and aliasing utilities will live beside the new
tadox_modelspackage described earlier.6. Implementation Plan
TadoHomeStrategy,LegacyHomeStrategy, shared cache + metrics hooks, baseline call-count docGET /api/v2/me+GET /api/v2/homes/{id}, cachedsupports_tadox, constructor overrides (home_id,home_generation), detection testsHopsHomeStrategy,tadox_models, canonical room dataclasses,*_canonical()helpers, adaptersI welcome all feedback on this proposal.
8. Appendices
Appendix A – Data source
All capability notes in this RFC come from a fresh capture of the official Tado web client while operating a Tado X installation. The raw capture is private, but I’m happy to share an anonymised version if anyone needs it; key findings are summarized here and fixtures will ship with the implementation PRs.
Appendix B – Example usage (post-refactor)
Legacy consumers can continue calling
async_get_zones()until they switch to the canonical helpers.Beta Was this translation helpful? Give feedback.
All reactions