Power Dash
A home energy dashboard. It combines the retailer's smart-meter data with live readings from the solar inverter, smart plugs and circuit monitors, so I can see what the house uses, what it generates and where the money goes.




Why
The inverter's software is hosted in Europe, is slow and bloated, and does not work with the smart plugs I use. I wanted something light that runs on a Worker, not a complicated app that needs a server running in the house. I also wanted to reconcile what the inverter and smart plugs report against what the utility says we used. Other tools probably do this, but they all looked like a lot of setup.
Smart plugs only help with things that plug in. The biggest loads in the house, such as the aircon and the hot water, are hardwired or too heavy for a plug, so they needed a different kind of sensor. That is what the circuit monitors are for.
What it does
- Usage: hourly and daily smart-meter data from the electricity retailer, paged by day, month or year or shown as a rolling 30 days or all time. Imports are split by tariff (peak and off-peak), exports are shown below zero, cost includes the daily supply charge, and an hour-of-day heat map shows when the grid is used.
- Live home: solar generation, house load and grid import or export from the inverter, with a stacked chart that splits the load by smart plug and shows the rest as unmonitored. Ranges run from six hours to 30 days, or any single day.
- Devices: latest watts and 24-hour energy per smart plug, temperature and humidity sensors, inverter and poller health, the washing machine's current cycle and recent runs, and, if enabled, a robot vacuum card. Each device has its own page.
- Circuit monitors: small ESP32 units that measure the real power on a single circuit with a clamp around the live wire. They report to the dashboard like a smart plug, so a circuit shows up in the same stacked chart, and each has its own page for live readings, an over-power alarm and settings.
- UPS status: a small separate page showing the battery charge, runtime, input voltage and state of the UPS.
- Events: finds sustained steps in the load that no plug accounts for (an oven, a cooktop, the hot water heat pump) and lists them with a small trace. Each can be tagged by hand, and once a few are tagged the page suggests a tag for the rest, based on power, length, cycling and time of day. Runs that overlap a washing machine cycle are labelled automatically, and kilowatt-hours are totalled by tag.
- Where meter data exists for a period, it is overlaid on what was recorded locally so the two can be reconciled. The meter data arrives one to two days late.
Under the hood
- A Cloudflare Worker with static assets and a D1 database, with each part switched on or off by a feature list. Three crons: a sync of the meter data every six hours, a washing-machine poll every five minutes and an hourly rollup.
- The meter sync uses the retailer's customer web login, which rotates its session cookie on every refresh. The Worker saves the new cookie before doing anything else, and re-fetches the last few days each time because recent data gets revised.
- An ESP32 board reads the inverter and the smart plugs every 15 seconds and posts batches to the Worker with a bearer token. It speaks the plugs' encrypted local protocol itself in C++, serves a status page and a small switch API for the household's remote apps, and takes over-the-air updates.
- The circuit monitors use PZEM-004T modules, which report real power over a serial Modbus link from a split-core current transformer. Several share one ESP32 and one serial port, each with its own address, and each circuit keeps its slot and name in flash.
- A monitor queues readings in flash and retries with a cap if the Worker is unreachable, takes its time from the network, and restarts itself if it hangs. The Worker merges its readings into the nearest sample so they stack with the plugs.
- The clamp is the safe part: the module's mains side sits in a closed, fused enclosure and was first tested on a plug-through box with a real appliance.
- The UPS page runs on a Raspberry Pi that reads the UPS over USB through Network UPS Tools in a read-only mode, so the Pi never shuts anything down. It is a small Python script on the standard library with its own address on the network, and it hides any tile the UPS does not report.
- Raw 15-second rows serve the short ranges. An hourly job folds them into 5-minute rows that the longer ranges read, which keeps D1 reads low.
- Event detection works on the house load minus every monitored plug, as a one-minute series against a rolling low-percentile baseline. A reading only counts when every plug that normally reports did, so a plug dropping off Wi-Fi never looks like an appliance switching on.
- The charts are hand-written SVG with no charting library or framework. Parsing, series, event and washer logic are pure functions covered by Node's test runner.
A personal tool for one household, behind a login. Screenshots use invented data generated for the purpose.