Power Monitoring with Home Assistant: Tracking What Your Home Lab Actually Costs
Stop guessing at your electricity bill: meter the home lab and watch the numbers ruin your day
I used to wave away questions about what my home lab cost to run with a confident “oh, not much”. Then I put a meter on it. The rack idles at 140 watts, which doesn’t sound like a lot until you do the maths: 140W is roughly 1,226 kWh a year, and at my tariff that’s about £370 just to keep the lights blinking. Measuring it didn’t make it cheaper, but it stopped me lying to myself, and it surfaced a couple of genuine surprises.
1 Getting a number into Home Assistant
You need a meter that reports power draw and something to read it. The cheapest credible option is a smart plug running local firmware — a Tasmota or ESPHome flash on something like a Sonoff or Shelly. Avoid cloud-only plugs; you want the data on your own broker, not Tuya’s.
A Shelly Plug S, for example, exposes its power reading over its local HTTP API and integrates natively. For a Tasmota-flashed plug, the values arrive over MQTT, and a template sensor pulls the wattage out:
mqtt:
sensor:
- name: "Rack Power"
state_topic: "tele/rack_plug/SENSOR"
value_template: "{{ value_json.ENERGY.Power }}"
unit_of_measurement: "W"
device_class: power
state_class: measurementThe two fields that matter for the Energy dashboard are device_class: power and state_class: measurement. Get those wrong and Home Assistant will refuse to integrate the reading into kWh, and you’ll spend an hour wondering why your shiny dashboard is empty.
2 From watts to money
Home Assistant can integrate instantaneous power into cumulative energy, but it’s cleaner to use a plug that reports a lifetime kWh total directly. If yours only gives you watts, the Riemann sum integration bridges the gap:
sensor:
- platform: integration
source: sensor.rack_power
name: rack_energy
unit_prefix: k
round: 2
method: trapezoidalThat produces a sensor.rack_energy in kWh that only ever climbs. Feed that into the Energy dashboard (Settings → Dashboards → Energy → Add Consumption). Set your tariff in the same place — a flat rate, or a more elaborate cost-tracking sensor if you’re on a time-of-use plan and want to know whether your nightly backup job is sneaking into the cheap window.
3 The surprises
Three things jumped out once I had a week of data.
First, idle is most of the bill. My lab almost never does anything strenuous, so the 140W floor — drives spinning, fans turning, a couple of NVMe pools, the switch and the UPS — accounts for the overwhelming majority of the cost. Chasing peak efficiency on workloads that run for ten minutes a day is pointless when the baseline runs 24/7.
Second, one machine was a pig. An old Xeon box I kept “just in case” was pulling 65W on its own to do nothing. I’d been telling myself it was free because it was already paid for. It was costing me £170 a year to sit in standby. It’s now off, and I haven’t missed it once.
Third, the UPS lies a little. Conversion losses mean the wall meter reads higher than the sum of what’s plugged into the UPS. Worth knowing if your numbers don’t add up — you’re not going mad, you’re just paying for the UPS’s own overhead.
4 Making the data nag you
A number you have to go and look at is a number you’ll ignore. I added a template sensor that turns this month’s consumption into a running cost, and a simple automation that pings me if the lab’s draw stays above a threshold for an hour — usually a sign something kicked off a runaway job or a fan controller failed.
template:
- sensor:
- name: "Lab Cost This Month"
unit_of_measurement: "GBP"
state: >
{{ (states('sensor.rack_energy_monthly') | float(0) * 0.30) | round(2) }}Drop that on your main dashboard. There’s nothing like watching a real money figure tick upward to cure the urge to leave three idle VMs running.
5 Is it worth it / who is this for
If your home lab is a single low-power mini PC, honestly, don’t bother — it’s costing you a few pounds a month and the meter won’t tell you anything you can act on. The juice isn’t worth the squeeze.
But if you’re running a rack, multiple machines, or anything with spinning disks and a UPS, metering is the most clear-eyed thing you can do. It cost me one smart plug and an evening of YAML, and it directly led to decommissioning a machine that was burning £170 a year for nothing. The verdict: for anyone whose lab has crept past “one box in a cupboard”, power monitoring pays for itself almost immediately — not in saved watts, but in the lies it stops you telling yourself.




