Bridge sensor accuracy, HomeKit re-pair recovery, and a tracker regression fix
A bug-fix release. The Bridge connected sensor now reflects the bridge itself rather than the cloud call behind it, HomeKit pairing can recover from a wrong code without the disable/re-enable dance, the mobile presence trackers that broke on v4.1.2 are working again, and a batch of sensors now report unavailable instead of showing a stale reading when their own data goes away. No config changes needed.
Bug fixes
Bridge connected sensor now reflects the bridge, not the cloud (#275 - @50494554524F). The "Bridge connected" sensor read whether the last call to Tado's cloud succeeded, not whether the bridge itself was online. Because that call is cloud-hosted, an offline bridge still got a reply and the sensor stayed on "connected" indefinitely, even across a reload. It now reads the bridge's own online status from Tado's response: its on/off state tracks the bridge, and if the Tado cloud itself can't be reached the sensor shows unavailable rather than a stale reading. Only affects setups using the bridge connection with a serial and auth key. Thanks to @50494554524F, whose debug log pinned the real cause.
HomeKit pairing recovers from a wrong code (#313 - @Siiya27). Entering the wrong code on the first pairing attempt (for example the 4-digit auth code instead of the 8-digit setup code) left HomeKit switched on but never actually paired, with no way back to the code prompt short of disabling and re-enabling it. Two fixes: the setup code is now checked for the right format before pairing is attempted, with a message naming the code you need, and a new "Pair again" option in the HomeKit settings reopens the code prompt directly so you can recover.
Mobile presence trackers no longer show unavailable (#314 - @arnoslag). A regression in v4.1.2: after the tracker change in that release, the per-user phone trackers (device_tracker.anne and the like) all read "unavailable", while the home-wide presence sensor stayed correct. The new tracker type keys its identity on a hardware address, which Tado phones don't have, so each tracker registered with no identity and Home Assistant couldn't attach or restore it. The trackers now keep their own stable identity and report home / not_home per user again. If you downgraded to v4.1.1 to work around it, this removes the need.
Sensors show unavailable instead of a stale reading when their own data goes away. A handful of sensors could keep displaying their last value as if it were current after the thing behind them disappeared. The battery, connection and child-lock entities for a TRV you've removed from your account held the old reading, and the outside temperature, solar and weather-state sensors kept their last value when a poll came back without weather data. These now report unavailable and drop the stale reading. Individual thermal-model sensors (heating rate, inertia, and so on) also go unavailable when a poll fails, rather than showing a value from before the failure.
How to Update
From v4.1.2 or v4.1.1: HACS → Tado CE → ⋮ → Redownload → select v4.1.3 → Restart HA.
Fresh install: See Quick Start in the README.
Thanks to everyone who supported the project through Buy Me a Coffee. It genuinely helps.
Full changelog: v4.1.2...v4.1.3