Survive a dead local status URL, and go unavailable when the spa is not reporting #2

Merged
dfritz merged 3 commits from ops/local-status-fallback into main 2026-11-15 04:51:24 +00:00
Owner

Outcome

The integration no longer fails setup when its local /status URL stops answering, no longer presents blank telemetry as an idle spa, and recovers by itself from a lost broker connection.

Changes

  • Cloud fallback. A local URL that does not answer at setup, or fails four polls in a row, switches telemetry to the cloud broker. The local poll keeps running and takes over when it answers again, dropping what the cloud delivered.
  • Reconfigure step. Changes the local URL without signing in again.
  • Availability. Every entity is unavailable unless telemetry arrived in the last five minutes and carries control-box data. A module cut off from the control box serves a full document of blanks and defaults, which previously read as a working spa whose controls snapped back.
  • Watchdog. Catches silence between updates, and reloads the entry when the broker connection stays down for three minutes, because broker credentials rotate and paho reconnects with the old ones.
  • README covers the fallback, Reconfigure, the availability rules and the two-module trap.
  • Version 0.2.0.

Validation

Running on the production instance it was written for: setpoint and salt changes are applied by the spa within seconds, entities go unavailable when the URL points at a module with no control-box data and return when it points back, and an unreachable URL falls back to the cloud with a warning instead of failing setup. The fallback, staleness, watchdog and availability logic also pass a stand-in test with a fake MQTT client.

Limitations

  • The repository has no test suite; the stand-in tests are not committed.
  • The reload after a lost broker connection has not been exercised against the real broker.
  • The climate entity still uses temperature properties Home Assistant removes in 2027.11.

Attribution

Authored-By: Claude Code (Claude Fable 5.2) noreply@anthropic.com

🤖 Generated with Claude Code

## Outcome The integration no longer fails setup when its local `/status` URL stops answering, no longer presents blank telemetry as an idle spa, and recovers by itself from a lost broker connection. ## Changes - **Cloud fallback.** A local URL that does not answer at setup, or fails four polls in a row, switches telemetry to the cloud broker. The local poll keeps running and takes over when it answers again, dropping what the cloud delivered. - **Reconfigure step.** Changes the local URL without signing in again. - **Availability.** Every entity is unavailable unless telemetry arrived in the last five minutes and carries control-box data. A module cut off from the control box serves a full document of blanks and defaults, which previously read as a working spa whose controls snapped back. - **Watchdog.** Catches silence between updates, and reloads the entry when the broker connection stays down for three minutes, because broker credentials rotate and paho reconnects with the old ones. - README covers the fallback, Reconfigure, the availability rules and the two-module trap. - Version 0.2.0. ## Validation Running on the production instance it was written for: setpoint and salt changes are applied by the spa within seconds, entities go unavailable when the URL points at a module with no control-box data and return when it points back, and an unreachable URL falls back to the cloud with a warning instead of failing setup. The fallback, staleness, watchdog and availability logic also pass a stand-in test with a fake MQTT client. ## Limitations - The repository has no test suite; the stand-in tests are not committed. - The reload after a lost broker connection has not been exercised against the real broker. - The climate entity still uses temperature properties Home Assistant removes in 2027.11. ## Attribution Authored-By: Claude Code (Claude Fable 5.2) <noreply@anthropic.com> 🤖 Generated with [Claude Code](https://claude.com/claude-code)
dfritz added 3 commits 2026-11-15 04:51:19 +00:00
The dongle has no DNS name and takes its address from DHCP, so a configured
local /status URL goes stale when the lease changes. Setup treated that as
fatal: every entity went unavailable and control (which never used the local
path) went down with it.

- A local URL that does not answer at setup no longer fails the entry; the
  coordinator subscribes to the cloud broker for telemetry instead and logs a
  warning.
- After four consecutive failed local polls the coordinator switches to the
  cloud the same way, instead of holding the last local values forever.
- When the local URL answers again it takes over: the cloud subscription is
  dropped along with what it delivered, so a stale cloud value cannot shadow a
  fresh local one.
- New reconfigure step changes the local URL without signing in again.
- Version 0.1.1.

Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
A module that is online but cut off from the control box keeps serving and
publishing a full document of blank and default values. Read literally that
is an idle spa: no temperatures, salt level 0, lights and jets off, and
controls that accept a value and snap back.

- The spa counts as reporting only while telemetry is fresh (something
  arrived in the last five minutes) and carries control-box data. Otherwise
  every entity is unavailable, and the reason is logged once per change.
- The entry still loads in that state, so entities return on their own when
  the spa reports again.
- A watchdog catches silence between updates, and reloads the entry when the
  broker connection stays down for three minutes. The broker is the only
  control path and its credentials rotate; paho reconnects with the old ones,
  so only a fresh sign-in recovers it.
- Version 0.2.0.

Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
dfritz merged commit 5af5412248 into main 2026-11-15 04:51:24 +00:00
dfritz deleted branch ops/local-status-fallback 2026-11-15 04:51:24 +00:00
Sign in to join this conversation.
No Reviewers
No labels
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: homeassistant/hotspring#2