Commit Graph

2 Commits

Author SHA1 Message Date
tarcourt 58ca57a627 feat: dashboard token auth + README v2/v3 payload sections split
Dashboard:
- Optional DASHBOARD_TOKEN env var (K8s secret 'snek-dashboard-secret')
- Flask before_request check via Authorization header or ?token= param
- /webhook and /healthz remain public (SNEK POST needs to reach webhook)
- Frontend prompts for token on first load, stores in localStorage
- Token forwarded on fetch() calls and EventSource URL

README decoding section:
- Split into two full sub-sections for Sens'it Discovery (v3) and Sens'it v2
- Explicit bit ordering note (MSB-LSB v3 vs LSB-MSB v2)
- Byte-by-byte tables, formulas per mode, worked examples
- Note that auto-detection uses byte 0 bits 2-0 == 0b110 marker for v3

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
2026-07-03 18:27:33 +02:00
tarcourt a77776d6d8 feat: web dashboard for live device data
Small companion service that receives SNEK callbacks, decodes Sens'it
Discovery payloads for all 6 modes (Standby, Temperature, Light, Door,
Vibration, Magnet), stores in SQLite, and serves a responsive dashboard.

Backend (Python Flask):
- POST /webhook: receive SNEK callback
- GET /api/devices, /api/messages, /api/decode
- GET /events: Server-Sent Events for live push
- SQLite persistence at /data/messages.db

Frontend:
- Tailwind CSS via CDN, Chart.js for temp/humidity graph
- Live updates via SSE
- Device cards with icons per mode
- Message log with human-readable summaries

Deploy:
- Separate deployment (snek-dashboard) with own PVC
- LoadBalancer on 192.168.1.213:80
- SNEK callback URL: http://snek-dashboard.snek.svc.cluster.local/webhook

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
2026-07-03 17:43:11 +02:00