homelab-codex-ws/services/ha-diag-agent/src/ha_diag
Oskar Kapala 31b48d162a feat(ha-diag-agent): WebSocketMonitor for real-time HA liveness
- persistent WS connection to HA with auth + state_changed subscription
- watchdog detects silence > 5min → emits ha_websocket_dead
- immediate ha_websocket_dead on disconnect, exponential reconnect with jitter
- cooldown prevents alert spam (10min repeat window while HA stays down)
- ha_websocket_recovered emitted on reconnect after a dead alert (allows
  supervisor to clear active incidents in Phase 5)
- new monitors/ subpackage for long-running tasks (vs interval checks/)
- /health endpoint now includes ws_connected field
- 26 unit tests, 3 integration tests (real HA + container stop/restart)

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-05-29 15:00:18 +02:00
..
checks feat(ha-diag-agent): three REST diagnostic checks + Phase 3 flag fixes 2026-05-29 14:43:10 +02:00
monitors feat(ha-diag-agent): WebSocketMonitor for real-time HA liveness 2026-05-29 15:00:18 +02:00
__init__.py feat(ha-diag-agent): scaffold service with HA REST client and event emitter 2026-05-29 12:26:34 +02:00
api.py feat(ha-diag-agent): WebSocketMonitor for real-time HA liveness 2026-05-29 15:00:18 +02:00
config.py feat(ha-diag-agent): WebSocketMonitor for real-time HA liveness 2026-05-29 15:00:18 +02:00
event_emitter.py feat(ha-diag-agent): test environment with dual HA Docker instances 2026-05-29 12:56:13 +02:00
ha_client.py feat(ha-diag-agent): three REST diagnostic checks + Phase 3 flag fixes 2026-05-29 14:43:10 +02:00
main.py feat(ha-diag-agent): WebSocketMonitor for real-time HA liveness 2026-05-29 15:00:18 +02:00
models.py feat(ha-diag-agent): WebSocketMonitor for real-time HA liveness 2026-05-29 15:00:18 +02:00
storage.py feat(ha-diag-agent): three REST diagnostic checks + Phase 3 flag fixes 2026-05-29 14:43:10 +02:00