Commit graph

8 commits

Author SHA1 Message Date
Sam
c6db0ab569 refactor: replace GraphQL/REST with MQTT-only for Unraid server data
All server stats (CPU, RAM, Docker, shares, disks, array) now come
directly from MQTT topics published by the Unraid MQTT Agent. This
eliminates the need for API keys, HTTP polling, and the GraphQL/REST
fallback chain.

- Rewrote unraid_service.py to read from MQTT store (no httpx needed)
- Simplified servers router (no cache, no enrichment hack)
- Added mqtt_prefix field to UnraidServer config
- Updated DB: both Daddelolymp and Adriahub with mqtt_prefix, no api_key
- Data is always fresh (MQTT pushes every ~15s)

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-02 23:25:57 +01:00
Sam
5d3d4f4015 MQTT-based live CPU/RAM metrics + remove auth from HA control
- Enrich server data with MQTT system topics (cpu_usage_percent,
  ram_usage_percent, temp, model etc.) published by Unraid MQTT Agent
- Works for both Daddelolymp and Adriahub topics
- MQTT overlay runs on every request (even cached) for fresh metrics
- Remove JWT auth from /api/ha/control — local dashboard doesn't need it
- Add cpu brand field to GraphQL query

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-02 22:41:16 +01:00
Sam
f5b7c53f18 HA controls + wider layout: toggle lights/switches, cover controls, more sensors
- Backend: call_ha_service() for controlling entities via HA REST API
- Backend: POST /api/ha/control with JWT auth + cache invalidation
- Backend: Parse switches, binary_sensors, humidity, climate entities
- Frontend: HA card now xl:col-span-2 (double width)
- Frontend: Interactive toggles for lights/switches, cover up/stop/down
- Frontend: Temperature + humidity sensors, climate display, binary sensors
- Frontend: Two-column internal layout (controls left, sensors right)

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-02 19:30:20 +01:00
Sam
d3305a243c Weather: Replace wttr.in with Open-Meteo + structured logging
- Replace wttr.in (unreachable from Docker) with Open-Meteo API
  (free, no API key, reliable) with geocoding cache
- WMO weather codes mapped to German descriptions + emoji icons
- Add [WEATHER], [NEWS], [UNRAID], [DASHBOARD] log prefixes
- Structured integration status table on startup
- Suppress noisy httpx INFO logs (services log their own summaries)
- Add logging to unraid_service (was completely silent on errors)

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-02 17:45:23 +01:00
Sam
6651bfaf60 feat: Setup Wizard for first-run configuration
Container starts with only DB credentials. On first visit, a step-by-step
wizard guides through admin password, weather, HA, Vikunja, Unraid, MQTT,
n8n and news configuration. Backward-compat: ADMIN_PASSWORD env skips wizard.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-02 16:06:10 +01:00
Sam
f6a42c2dd2 feat: add Admin Panel with JWT auth, DB settings, and integration management
Complete admin backend with login, where all integrations (weather, news,
Home Assistant, Vikunja, Unraid, MQTT) can be configured via web UI instead
of ENV variables. Two-layer config: ENV seeds DB on first start, then DB
is source of truth. Auto-migration system on startup.

Backend: db.py shared pool, auth.py JWT, settings_service CRUD, seed_service,
admin router (protected), test_connections per integration, config.py rewrite.

Frontend: react-router v6, login page, admin layout with sidebar, 8 settings
pages (General, Weather, News, HA, Vikunja, Unraid, MQTT, ChangePassword),
shared IntegrationForm + TestButton components.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-02 10:37:30 +01:00
Sam
89ed0c6d0a feat: add MQTT integration for real-time entity updates
- aiomqtt async client with auto-reconnect and topic store
- MQTT router: GET /api/mqtt, GET /api/mqtt/topic/{path}, POST /api/mqtt/publish
- MQTT entities included in /api/all + WebSocket broadcast
- MqttCard frontend component with category filters, entity list
- Configurable via ENV: MQTT_HOST, MQTT_PORT, MQTT_USERNAME,
  MQTT_PASSWORD, MQTT_TOPICS (comma-separated or JSON array)
- Gracefully disabled when MQTT_HOST is not set

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-02 10:13:50 +01:00
Sam
9f7330e217 refactor: complete rewrite as React+FastAPI dashboard
Replace monolithic Jinja2 template with modern stack:

Backend (FastAPI):
- Modular router/service architecture
- Async PostgreSQL (asyncpg) for news from n8n pipeline
- Live Unraid server stats (2 servers via API)
- Home Assistant, Vikunja tasks, weather (wttr.in)
- WebSocket broadcast for real-time updates (15s)
- TTL cache per endpoint, all config via ENV vars

Frontend (React + Vite + TypeScript):
- Glassmorphism dark theme with Tailwind CSS
- Responsive grid: mobile/tablet/desktop/ultrawide
- Weather cards, hourly forecast, news with category tabs
- Server stats (CPU ring, RAM bar, Docker list)
- Home Assistant controls, task management
- Live clock, WebSocket connection indicator

Infrastructure:
- Multi-stage Dockerfile (node:22-alpine + python:3.11-slim)
- docker-compose with full ENV configuration
- Kaniko CI/CD pipeline for GitLab registry

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-02 01:48:51 +01:00