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

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

Description and use

The Balboa BWA Wi‑Fi module frequently hung, causing Home Assistant to timeout, leak memory, and leave entities stale. By adding a connection manager with heartbeat detection, zombie‑socket rejection, and exponential backoff, crashes were eliminated, stale states cleared within 30 s, and automations became reliable.

Problem

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.

Outcome

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

Workflow

  • 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.

Evidence

Effective uptime 33.85 %

Source

No more crashes / memory leaks

Source

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

Source

  • Record date: 2026-09-07T23:52:45.574Z