Home Assistant custom integration for monitoring the home server "megalageret" (OMV-based). Provides a sidebar panel and a compact mobile card showing power/energy, RAM/GPU, disk health, Docker containers, OMV services, and server actions (reboot/shutdown/prune).
custom_components/server_monitor/— the integration itself:__init__.py— sets up the config entry, registers the frontend static path and sidebar panel, forwards sensor platform setup.coordinator.py—DataUpdateCoordinatorthat polls (every 30s) whether the ~70 entities the frontend depends on (owned by other integrations: OMV, energy meter, Docker container sensors, ...) are present and available. It does not fetch server metrics itself.sensor.py— exposessensor.server_monitor_entity_health, a diagnostics sensor reporting how many monitored entities are missing/unavailable.const.py— includesMONITORED_ENTITIES, the list of entity IDs the frontend depends on. Kept in sync manually with the frontend JS files, which read the same entities directly viahass.statesfor rendering.frontend/—server-monitor-shared.js(single source of truth for entity IDs + value/health helpers, loaded via dynamicimport()),server-monitor-panel.js(full sidebar panel) andserver-monitor-card.js(compact card), served as static files.
packages/server_monitor.yaml— HA template sensors: Docker running/total container counts, monthly kWh, and monthly cost (fixed average price, not live spot price — see comments in the file for why).
- Color palette: sky/indigo (
--accent: #38bdf8,--accent2: #818cf8). - The integration does not own or poll the server's actual metrics (disk, CPU, GPU, network) — those come entirely from the OMV integration and are read directly by the frontend. The coordinator's role is entity-health monitoring, not data collection.
- The list of entity IDs the panel depends on is hardcoded in both
const.py(for health checks) andfrontend/server-monitor-shared.js(for rendering, shared between panel and card). If OMV or another integration renames an entity, both places need updating. - The panel/card are served via
js_url(classic script), notmodule_url, soserver-monitor-shared.jsis loaded via dynamicimport()at runtime rather than a staticimportstatement at the top of the file. This works in all modern browsers but means the shared module loads asynchronously on first render (a loading spinner covers this gap — see CHANGELOG 1.3.0).