Replacing a Dead Dashboard: Standing Up VictoriaMetrics and Grafana
Standing up VictoriaMetrics and Grafana took an afternoon. Turning the result into dashboards that actually say something useful about washers, dryers, and a UPS took two more weeks of small, unglamorous fixes.
Table of contents
The small dashboard that already existed for this - Home Assistant's own History page - has a short memory by design. It's fine for "did the fridge's compressor cycle an hour ago," and useless for "how has whole-home power draw trended over the last month," because the underlying recorder purges old data on its own schedule. That gap is why I stood up a dedicated long-term metrics stack on top: VictoriaMetrics for storage, Grafana for the dashboards. Getting both running took an afternoon. Making the result actually useful took a lot longer.
Why VictoriaMetrics, and why two separate boxes
VictoriaMetrics over plain Prometheus mostly for the long-term-retention story: Prometheus's own storage engine is tuned for a shorter retention window and gets heavier to run the further you stretch it, while VictoriaMetrics is built around cheap long-term storage with a smaller footprint - and it still speaks Prometheus's own scrape and query protocol, so nothing downstream has to know the difference. It's a drop-in swap for the storage layer, not a new thing to learn.
Running VictoriaMetrics and Grafana on two separate machines instead of one doing both isn't necessary at this scale, but it buys something real: Grafana is the piece with a login page and a hostname behind single sign-on, so it's the one actually exposed to anything outside the metrics stack itself. Keeping it separate from the box holding months of time-series data means a Grafana restart, upgrade, or misconfiguration never touches the data store directly - and the data store itself never needs a public-facing hostname at all.
The endpoint that already existed, except not really
Home Assistant ships a /api/prometheus endpoint out of the box, which made the Home Assistant scrape target feel like it should be free. It wasn't - the integration that actually enables that endpoint wasn't turned on, so the scrape job sat there logging 404s until someone edited Home Assistant's own configuration directly and restarted it.
Worth saying plainly: whatever provisions the infrastructure around Home Assistant has no path to make that specific edit itself. Turning on Home Assistant's own config is a job for whoever has a hands-on session with Home Assistant, full stop - not something the automation standing up the metrics stack around it can reach into and do on its own.
Once the endpoint was live and authenticated with a long-lived access token, the first dashboards went up fast: one for general energy and power draw, a second for device and battery health. Both looked reasonable on day one. Neither one was actually useful yet.
What "useful" turned out to require
The real time sink wasn't the scrape config, it was looking at the dashboard for a week and fixing what day-to-day use exposed. A washer/dryer run-state timeline needed its own panel before "is the dryer still going" was answerable at a glance - and that led straight into adding real cost panels once run-state and power draw were both on screen together, which is where a wattage number without a dollar figure attached stops being interesting.
The gotchas were the kind you only find by looking. One UPS's power contribution was invisible in the whole-home graph entirely - not low, just absent - because of how its sensor was named relative to everything else being summed. Two circuits, the dishwasher and the dryer, were being counted twice because near-identical sensors existed on both and nothing had deduplicated them. High-power circuits sat scattered across the same panel as sensors reading effectively zero, which buried the graphs actually worth looking at until they got grouped and stacked together - and a show/hide toggle let the zero-value noise drop out entirely instead of just visually competing for space.
The smallest-sounding fix mattered the most day to day: linking crosshair and time-range zoom across every panel on the energy dashboard, so dragging to zoom on one graph zooms all of them together. Comparing "what was total power draw doing at the exact moment the dryer cycle started" across separate panels is the entire point of a dashboard like this, and none of it actually worked until the panels moved in sync.
Honest status
Home Assistant is now a real, exercised Prometheus source - not a checkbox, an actively-tuned dashboard with several rounds of fixes behind it. The second data source from the original plan, Pi-hole's own DNS query stats, hasn't happened yet; it's still on the list, not wired in. Calling this "done" would be the less interesting and less honest version of this post - a metrics stack earns its keep in the fixes nobody plans for, not the install step.