Guides

Home Assistant energy dashboard from scratch

Build a local-first Home Assistant energy dashboard from scratch: real hardware (P1 meter, smart plugs, panel meters), how long-term statistics work, and turning kWh into decisions.

On this page
  1. How the built-in Energy dashboard works
  2. Start with the right hardware
  3. Get the data into Home Assistant
  4. Hubitat and HomeKit notes
  5. Turn the data into decisions
  6. Real-world tradeoffs

Building a Home Assistant energy dashboard from scratch is a rewarding way to see where your power goes while keeping the data on your own network: which loads matter, when they cost the most, and what’s quietly eating kilowatt-hours. Home Assistant ships with a built-in Energy dashboard (Settings > Dashboards > Energy), so most of the work is choosing hardware that reports accurate kWh, feeding those sensors in, and wiring up the cost numbers. This guide focuses on Home Assistant, keeps the hardware and integration facts straight so your dashboard reflects reality, and notes where Hubitat or HomeKit fit in.

Start with a P1 reader for instant whole-home visibility where your meter has the port, or a metering smart plug for a single appliance, then add a panel meter with CT clamps when you want circuit-level detail. Keep it local: local-API meters, Zigbee plugs, or ESPHome-flashed Wi-Fi plugs. Because the Energy dashboard is built in, the hard part is picking hardware that reports real kWh locally.

How the built-in Energy dashboard works

Home Assistant’s Energy dashboard is not a generic chart. It consumes long-term statistics from sensors that report cumulative energy (kWh) with the correct device_class: energy and state_class: total_increasing. You configure grid consumption, return to grid (solar export), solar production, individual devices, and gas/water in the Energy settings page. Once configured, it builds daily, monthly, and yearly views automatically, plus a “monitor individual devices” section.

A point that trips people up: because the dashboard is powered by long-term statistics, which are stored compactly, its data is not deleted by your recorder’s purge_keep_days. So you get months of energy trends even if you keep only a week or two of detailed history (and if that detailed history is ballooning the database, my recorder tuning guide covers trimming it safely). You do not need a separate “long-term storage” hack for the energy dashboard, though InfluxDB + Grafana is a fine option if you want custom long-range charts.

The practical takeaway: pick hardware that exposes a proper energy (kWh) sensor, not just instantaneous watts. Most devices below do both.

Start with the right hardware

Accurate data beats fancy dashboards. For a local-first setup, the best sources are whole-home meters and per-device plugs that report to Home Assistant over your LAN, with no cloud round-trip.

Whole-home: P1 smart meter reader

If your utility meter has a P1 port - standard on modern meters in the Netherlands, Belgium, Luxembourg and Switzerland, and reachable in Denmark, Sweden and Norway with HomeWizard’s HAN converter (Luxembourg and Austria also need a decryption key from the network operator) - the HomeWizard P1 Meter clips onto that port and reads your entire home’s import/export and power over a fully local API. It exposes the data over a local HTTP REST API, and Home Assistant’s official HomeWizard integration polls it locally - note it’s HTTP/REST, not MQTT. Don’t go hunting for the “Local API” toggle in the HomeWizard app for this one: the P1 Meter is one of three devices (with the kWh Meter and the Plug-In Battery) that skip it and authenticate differently - you press the button on the meter during setup and select Continue within 30 seconds. The integration creates power and energy sensors that drop straight into the Energy dashboard’s grid section. No panel work required. If you have rooftop solar, my guide to energy monitoring for solar homes covers tracking production and export too.

Per-outlet: smart plugs with metering

For tracking a single appliance, a metering smart plug is the easiest entry point:

  • HomeWizard Energy Socket - Wi-Fi plug with the same local HTTP API and per-outlet energy reporting. This is a device that does need the “Local API” toggle switched on in the HomeWizard app first. EU socket only: HomeWizard sells it in a single Type-F (Netherlands/Belgium) form factor, with no US or UK version.
  • Shelly Plug US Gen4 - Wi-Fi plug that reports power and energy. It is Shelly’s current US plug (15 A / 1800 W), it runs Shelly’s own (Allterco) firmware, and it is read locally via the Shelly integration or MQTT; that firmware is Matter-certified by default and switches to Zigbee with five presses of the device button. The older Gen2 Shelly Plus Plug US is still a fine plug if you already own one, but it is Wi-Fi and MQTT only with no native Matter, and flashing Tasmota on it is an optional advanced step, not the default. Do not confuse it with the Shelly Plug S, which is the European Type-F version of that plug and does not fit a US outlet.
  • Sonoff S31 - a 2.4 GHz Wi-Fi plug with energy monitoring (it is not Zigbee). Out of the box it’s cloud-tied (the stock firmware is eWeLink/cloud-oriented), and the reason it shows up on so many lists is that you can reflash it with ESPHome or Tasmota for fully local power/current/voltage reporting straight into Home Assistant. I haven’t run one. The Sonoff S40 is also Wi-Fi with energy monitoring, but don’t assume it flashes the same way: the S40 series uses a Bouffalo Lab BL602 chip rather than an ESP, so ESPHome and Tasmota don’t run on it (its local path is the eWeLink LAN integration instead).
  • Zigbee plugs - plenty of plugs (various frient, Aqara, Third Reality, and other Zigbee outlets) report power and energy through ZHA or Zigbee2MQTT. A Zigbee plug needs a Zigbee coordinator on your Home Assistant host - for example a Connect ZBT-2 stick or a ConBee III (which is a Zigbee coordinator, with optional Thread firmware - not Z-Wave).

Whatever you choose, prioritize a device that reports a real cumulative energy (kWh) value, not just instantaneous watts - the energy dashboard needs the cumulative figure.

Per-load: Shelly relays with metering

For a single hardwired load - a water heater, a well pump, a garage circuit - a Shelly relay with metering is the simplest way to get a kWh sensor, and the thing that trips people up is the model name: “PM” means power metering. A non-PM relay such as the Shelly Plus 1 - discontinued now, but the point stands for the Shelly 1 Gen4 that replaced it - switches the load and reports nothing about it. The current one-channel metered relay is the Shelly 1PM Gen4 (15 A on the US model, Wi-Fi and Bluetooth, Matter-certified out of the box and switchable to Zigbee with five presses of the device button); the older Gen2 Shelly Plus 1PM meters the same way and is still fine if you own one, with no native Matter. The Shelly Plus 2PM has two independently metered channels (10 A per channel, 16 A total), and its successor the Shelly 2PM Gen4 keeps that metering and adds Matter and Zigbee 3.0 as alternative radio profiles, one at a time - switching to Zigbee drops Wi-Fi. All of them report power, voltage, current and accumulated energy, which is everything the Energy dashboard needs.

Per-circuit / whole-panel

To measure circuits in your breaker panel you need a panel meter with current transformer (CT) clamps. The Shelly Pro 3EM is a DIN-rail three-phase meter that ships with CT clamps and reports per-phase voltage, current, and energy locally - see how to add energy monitoring to an old panel if your breaker box predates smart metering. Note: the inline Shelly Plus 2PM - discontinued, and replaced by the Shelly 2PM Gen4 - has built-in metering for its two switched channels (no external clamps) and is meant for controlling/monitoring specific loads, not clamping around panel busbars.

The Pro 3EM is a three-phase meter, so for the split-phase panel in a typical North American home the more common circuit-level answer is the Emporia Vue 3: two 200A mains CTs, one per leg, plus a set of 50A branch CTs in 8- or 16-circuit kits. It runs through Emporia’s own app out of the box, but you can flash it with ESPHome and turn it into a fully local Home Assistant sensor with no cloud. Both the Gen 2 and Gen 3 need a one-time wired serial flash with a USB-to-TTL adapter on the board’s UART pads (do not connect the Vue’s own power lead while flashing); only later updates go over Wi-Fi.

Get the data into Home Assistant

The integration path depends on the device:

  • Local HTTP/REST - HomeWizard P1 Meter and Energy Socket (official HomeWizard integration).
  • Zigbee - power-monitoring Zigbee plugs via ZHA or Zigbee2MQTT (the latter uses a local Mosquitto MQTT broker).
  • Wi-Fi + ESPHome/Tasmota - flashed Sonoff S31, an ESPHome-flashed Emporia Vue, and similar ESP-based gear, reporting locally over your network (ESPHome talks natively to Home Assistant; Tasmota typically via MQTT).
  • Shelly - the Shelly integration or MQTT, for the plugs, the PM relays and the Pro 3EM.

A few Shelly-specific notes, since that is the path most people take. Setup does not involve scanning a QR code: once a Shelly is on your Wi-Fi, Home Assistant usually finds it over mDNS and shows a discovered-device prompt under Settings > Devices & Services, and if it doesn’t, add the Shelly integration by hand and enter the device’s IP or hostname. Either way, give each Shelly a static or DHCP-reserved address in your router. The integration relies on a stable address, and a lease that changes after a reboot is the most common reason a Shelly goes “unavailable”. If you ever troubleshoot the protocol side, newer Plus and Gen2+ devices talk to Home Assistant over RPC, while first-generation Shellys use CoIoT, which has to be enabled on the device.

Once your energy sensors exist, open Settings > Dashboards > Energy and assign each kWh sensor to the right slot (grid consumption, production, individual device, etc.). If a sensor doesn’t show up as selectable, it’s almost always because it lacks device_class: energy and state_class: total_increasing - fix that and it’ll appear. For custom views beyond the built-in dashboard, add Energy cards, the Statistics graph card, or the History/Statistics cards to any normal dashboard.

Hubitat and HomeKit notes

Hubitat (e.g. the Hubitat Elevation C-8, discontinued in March 2026 and replaced by the standard C-8 Pro, which carries the same radios; Hubitat’s Thread Special Edition of the Pro swaps Zigbee out for Thread) runs automations locally and supports Z-Wave and Zigbee metering devices. Zooz makes metering Z-Wave hardware - for example the Zooz ZEN30 Double Switch for control, or Zooz’s energy-monitoring smart plugs for plug-in loads. You can bridge Hubitat into Home Assistant via the community Hubitat integration to surface those sensors on the Energy dashboard. (Note: the Zooz ZEN72 is a Z-Wave dimmer switch, not a plug or energy meter - don’t rely on it for consumption data.)

HomeKit has a basic energy view but no dashboard comparable to Home Assistant’s. If you want Shelly or other metering entities visible in Apple Home, the realistic route is Home Assistant’s HomeKit bridge re-exposing them, and HomeKit’s data model does not surface arbitrary energy metering as cleanly as Home Assistant does, so expect a more limited view. The same goes for Hubitat’s community Shelly drivers, which expose less than the Home Assistant integration; if metering is the priority, let Home Assistant own those devices and bridge to the other ecosystems for control only. Thread-capable HomePods (the mini and the second-generation model) act as Thread border routers and speakers - they cannot run Home Assistant, and neither can an Amazon Echo; none of them are energy monitors. There’s no “HomeKit energy bridge” either: if you want HomeKit-exposed plugs in your dashboard, you read them into Home Assistant via their native integration (Wi-Fi/Zigbee/Matter), then surface the kWh sensor. Run Home Assistant on a Home Assistant Green, a Raspberry Pi, or a mini PC, and add a Home Assistant Connect ZBT-1 (now discontinued and replaced by the Connect ZBT-2, which is the one to buy new) for Zigbee/Thread devices.

Turn the data into decisions

Once data is flowing, find your baseline and spikes. Look at the daily curve; evening cooking and heating or cooling are usually the big movers, and the “individual devices” section shows which plugs account for what. Then add tariffs. Enter your rate (and export rate, if you have solar) so the dashboard shows cost, not just kWh, and on a time-of-use plan this is where you see when running the dishwasher or charging an EV is cheapest. Finally, automate around it: build automations that defer high-draw loads to off-peak hours, or alert you when a circuit’s draw is abnormally high (a sign something’s been left on). For per-appliance control, a monitored smart plug doubles as the switch.

From there it’s about acting on what you see rather than collecting ever more sensors.

Real-world tradeoffs

  • Cost - A P1 reader or a couple of metering plugs is cheap; a panel meter with CTs plus (ideally) an electrician costs more.
  • Granularity vs. effort - Whole-home (P1) is easiest but won’t tell you which circuit is expensive. Per-circuit metering is more work and may require opening your panel.
  • Maintenance - Keep Home Assistant and Z-Wave JS / Zigbee firmware updated, and back up your config regularly.
  • Local vs cloud - The energy dashboard runs entirely on your Home Assistant instance; there’s no cloud requirement. The only “cloud” question is whether a given device phones home, which is why reflashing Wi-Fi plugs with ESPHome/Tasmota, or using local-API devices like HomeWizard and Zigbee plugs, fits a local-first build best.

Keep going

All articles →
Article

How to add energy monitoring to an old panel

Adding energy monitoring to legacy electrical panels using a P1 meter, a CT-clamp panel meter, or metering plugs, all local with Home Assistant.

Read article →
Article

How to build a Frigate NVR from scratch

Build a local Frigate NVR for Home Assistant from scratch or on an old PC: hardware and detector picks, app vs Docker install, RTSP cameras, and tuning.

Read article →
Article

Home Assistant database recorder tuning guide

Tune the Home Assistant recorder: purge_keep_days, exclude rules, SQLite vs a MariaDB add-on in Docker, and the statistics behind the energy dashboard.

Read article →
New guides and product notes, no inbox required. Follow via RSS →