spaxel/dashboard
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
..
css test: enhance floor-plan renderer tests with precise coordinate and color verification 2026-04-11 04:29:13 -04:00
js feat: home automation integration (MQTT and webhooks) 2026-04-11 06:29:51 -04:00
node_modules feat: implement repeated-setting change detection with guided calibration 2026-04-11 00:18:19 -04:00
ambient.html fix: resolve iOS Safari passive event listener warnings and double-tap zoom 2026-04-11 03:10:21 -04:00
fleet.html test: enhance floor-plan renderer tests with precise coordinate and color verification 2026-04-11 04:29:13 -04:00
help_articles.json feat: implement contextual help system with searchable overlay 2026-04-11 00:44:54 -04:00
index.html feat: use FXAA instead of MSAA on mobile devices 2026-04-11 03:33:29 -04:00
integrations.html feat: home automation integration (MQTT and webhooks) 2026-04-11 06:29:51 -04:00
jest.config.js feat: implement spatial quick actions context menu for 3D scene 2026-04-10 22:56:17 -04:00
package-lock.json feat(dashboard): interactive onboarding wizard for ESP32-S3 node provisioning 2026-03-28 02:36:58 -04:00
package.json feat(dashboard): interactive onboarding wizard for ESP32-S3 node provisioning 2026-03-28 02:36:58 -04:00
simple.html fix: resolve iOS Safari passive event listener warnings and double-tap zoom 2026-04-11 03:10:21 -04:00