Loading page...Загружаем страницу...正在加载页面...
AtlasRepo

Three years of a hot tub lying to Home Assistant — and the 200 lines that finally shut it up

Описание и применение

Устройство Balboa BWA Wi‑Fi часто становилось безответным, вызывая тайм‑ауты и сбои в Home Assistant. Добавив менеджер соединения с проверкой сердцебиения, отклонением «зомби»‑соединений и экспоненциальным откатом, удалось устранить падения, сократить время недоступности до 30 секунд и восстановить надёжность автоматизаций.

Задача

The Balboa BWA Wi‑Fi Module (50350) in a hot tub frequently became unresponsive, causing Home Assistant to experience timeouts, memory leaks, and stale entity states for up to 104 minutes, leading to automation failures and system restarts.

Результат

The new connection manager reduced module downtime impact, prevented memory leaks, and restored reliable automations, though the module firmware remains flaky.

Рабочий процесс

  • 1. Measure module reliability with a Python harness using the same connection.py as HA.
  • 2. Identify that the module stops sending data after ~30s, leaving sockets open.
  • 3. Design a supervised connection: (a) heartbeat loop to detect silence > stale_after, (b) reject connections that do not deliver a first frame within connect_timeout, (c) apply exponential backoff with cap for reconnection attempts.
  • 4. Wrap pybalboa in SpaConnectionManager and modify HA integration to use it.
  • 5. Deploy and observe improved stability: no crashes, timely Unavailable state, and reliable automations.

Доказательства

Effective uptime 33.85 %

Источник

No more crashes / memory leaks

Источник

Entity states flip to Unavailable within 30 seconds of the module going silent

Источник

  • Дата записи: 2026-09-07T23:52:45.574Z