No description
Find a file
jedarden af64a30af6 feat: home automation integration (MQTT and webhooks)
Add comprehensive MQTT and webhook integration for Home Assistant and external services:

MQTT Client (internal/mqtt/client.go):
- Optional MQTT client with exponential backoff reconnect (5s-120s)
- TLS support for mqtts:// connections
- Home Assistant auto-discovery for persons, zones, fall detection, system health, system mode
- Topic structure: spaxel/{mothership_id}/person/{id}/presence, zone/{id}/occupancy, etc.
- LWT (Last Will and Testament) for availability
- Dynamic configuration updates via API
- Retained messages for presence and occupancy states

MQTT Publisher (internal/mqtt/publisher.go):
- Event bus subscriber publishing zone entry/exit, fall alerts, anomalies
- Person presence tracking across zones with home/not_home states
- Zone occupancy counting with occupants list
- Periodic system health publishing (60s interval)
- HA discovery methods for all entity types
- Person and zone discovery removal on delete

System Webhook (internal/webhook/publisher.go):
- Single webhook URL receiving all events with X-Spaxel-Event header
- JSON payload with event_type, timestamp, zone, person, blob_id, severity, detail
- Retry policy: one retry after 30s on 5xx errors
- Test webhook endpoint for configuration verification

API Integration Handler (internal/api/integrations.go):
- GET/POST /api/settings/integration for MQTT and webhook configuration
- POST /api/settings/integration/test for testing connections
- Settings persisted in database settings table
- Integration with existing MQTTClient and WebhookPublisher interfaces

Dashboard Integration UI (dashboard/integrations.html, js/integrations.js):
- Settings panel with MQTT broker URL, username, password (masked), TLS toggle
- Discovery prefix configuration
- Test Connection and Publish Discovery buttons
- System webhook URL configuration with enable toggle
- Connection status indicator with error messages

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-04-11 06:29:51 -04:00
.beads test: morning digest tests passing 2026-04-11 05:23:34 -04:00
.github/workflows feat: wire anomaly detection & security mode API endpoints 2026-04-07 15:09:34 -04:00
.marathon ci: set VERSION to 0.1.0 for image build 2026-04-06 08:53:25 -04:00
dashboard feat: home automation integration (MQTT and webhooks) 2026-04-11 06:29:51 -04:00
docs init: spaxel project — docs, plan, and marathon infrastructure 2026-03-26 06:43:25 -04:00
firmware feat: implement firmware LED blink handler for identify command 2026-04-09 07:01:42 -04:00
mothership feat: home automation integration (MQTT and webhooks) 2026-04-11 06:29:51 -04:00
tests/e2e feat: complete anomaly detection & security mode dashboard UI 2026-04-07 15:50:25 -04:00
.dockerignore feat(deploy): Docker packaging with multi-stage build and compose orchestration 2026-03-26 07:46:15 -04:00
.gitignore feat(deploy): Docker packaging with multi-stage build and compose orchestration 2026-03-26 07:46:15 -04:00
.needle-predispatch-sha test: morning digest tests passing 2026-04-11 05:23:34 -04:00
.needle.yaml feat: trigger CI build and verify deployment 2026-04-06 09:54:08 -04:00
API_IMPLEMENTATION_STATUS.md docs: verify REST API implementation completeness 2026-04-09 18:18:42 -04:00
docker-compose.yml feat(deploy): Docker packaging with multi-stage build and compose orchestration 2026-03-26 07:46:15 -04:00
Dockerfile feat: implement comprehensive /healthz endpoint 2026-04-07 11:09:36 -04:00
fix_ble_handlers.py feat: implement spatial quick actions with follow camera 2026-04-09 22:54:36 -04:00
PROGRESS.md docs: document Phase 7 completion - presence prediction implementation 2026-04-09 10:17:32 -04:00
VERSION ci: auto-bump version to 0.1.170 2026-04-11 09:23:48 +00:00