21 Commits

Author SHA1 Message Date
jessikitty bd4996492d Auto-detect URL from page origin — works on HTTP, HTTPS, LAN IP, or domain
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.
2026-05-18 12:19:21 +10:00
jessikitty b754c0cab6 Hardcode HA token in CONFIG block — set once, works on all devices
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.
2026-05-18 11:54:56 +10:00
jessikitty 9224a3fd58 Auto-detect HA auth from parent frame — no manual token entry needed
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
2026-05-18 00:12:00 +10:00
jessikitty 4142d1c9e1 Fix empty display after save (lastSaveTime guard) + OPNsense JSON payload fix 2026-05-17 00:28:26 +10:00
jessikitty 77d9e9c523 Fix: OPNsense rest_commands use JSON payload (alias_util API requires JSON not form-encoded) 2026-05-17 00:23:45 +10:00
jessikitty a566400746 Fix: use sensor.home_dhcp_leases_lan with attributes.Leases (capital L), address/hostname/expires fields 2026-05-16 19:52:37 +10:00
jessikitty 8a5fe108dc Fix: chunked storage (12x255=3060 chars), no CFG reference, clean parseCfg/saveCfg 2026-05-16 18:15:46 +10:00
jessikitty cf8d7eef7c Fix: replace single input_text (max 10000, invalid) with 12 chunked entities (max 255 each = 3060 total) 2026-05-16 18:11:00 +10:00
jessikitty 4ecdda5322 Redesign: use OPNsense DHCP lease sensor for discovery/status, fix save error handling, add HA+DHCP status indicators, cleaner UI 2026-05-16 15:13:24 +10:00
jessikitty 7c258e731e Add opnsense_leases_url for DHCP sensor 2026-05-16 15:10:11 +10:00
jessikitty 06b35aeb8c Add OPNsense DHCP lease REST sensor for device discovery and status 2026-05-16 15:09:41 +10:00
jessikitty 5593d1411b Fix: use ws.send() directly for auth — send() expects a result response but HA responds to auth with auth_ok/auth_invalid (no id), causing 60s timeout loop 2026-05-15 16:22:31 +10:00
jessikitty 76b67d3470 Fix connection timeout: use REST API for initial state load, increase WS timeout to 60s
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.
2026-05-15 16:11:44 +10:00
jessikitty 4bdb228a8c Upload files to "packages"
Uploaded failed files..
2026-05-10 21:45:35 +10:00
jessikitty fc8d1eea11 Upload files to "/"
Re-uploaded Failed Files
2026-05-10 21:44:22 +10:00
jessikitty 3c9bc381c6 Update README.md 2026-05-10 21:42:15 +10:00
jessikitty 28e2bf167f Fix: replace double-encoded file with correct HTML dashboard 2026-05-10 21:23:39 +10:00
jessikitty 22e740e754 Add parental controls dashboard HTML
- 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
2026-05-10 21:13:39 +10:00
jessikitty 5b6e9b79ff Add HA package: rest_commands, scripts, optional schedule automation 2026-05-10 20:54:59 +10:00
jessikitty e691c4a124 Add secrets example file 2026-05-10 20:53:04 +10:00
jessikitty e76c3b7e09 Add README with full setup instructions 2026-05-10 20:52:39 +10:00