Removed CONFIG_HA_URL. The dashboard now always uses window.location.origin
so it adapts to however you access HA:
- https://ha.hideawaygaming.com.au → wss:// WebSocket
- http://10.0.0.55:8123 → ws:// WebSocket
Same token, no config change needed.
Replaced parent-frame auto-detect (blocked by HA iframe sandboxing)
with a CONFIG_HA_TOKEN constant at the top of the script.
Set it once in the file, works on every device automatically.
Falls back to localStorage/manual entry if CONFIG is empty.
When loaded as panel_iframe inside HA, the dashboard now automatically
grabs the session token from the parent frame. This means:
- No setup screen on new devices — just log into HA and it works
- Token refreshes automatically on reconnect (session tokens rotate)
- If auto-auth fails, retries with fresh token before showing error
- Falls back to localStorage/manual entry if not inside HA iframe
- Settings modal shows auto-auth status indicator
Large HA instances with many entities cause get_states to exceed the 12s
WebSocket timeout. Now loads all states via /api/states HTTP endpoint first
(much more reliable for large payloads), with WebSocket get_states as fallback.
Also bumped WS send timeout from 12s to 60s for slow HA responses.
- HA WebSocket connection with auto-reconnect
- User cards with colour coding and per-user block toggle
- Device assignment by MAC (pick from discovered devices or enter manually)
- Per-device block toggle with online/offline indicator
- Weekday/weekend schedule blocking (overnight ranges supported)
- Auto re-block on device reconnect with new IP
- First-time setup screen, credentials stored in localStorage