Part 2 · Software
The stack
Everything below runs on a £50 refurbished Dell OptiPlex 3050 Micro sitting next to the router. It plans every half hour of battery activity against live Agile prices and a solar forecast, joins Saving Sessions on its own, and pushes this site's data every night. The software cost nothing.
The pieces
| Layer | What | Job |
|---|---|---|
| OS | Home Assistant OS (x86-64) | Runs on the OptiPlex's SSD, which the statistics database is far happier on than a Pi's SD card |
| Inverter link | Sigenergy ESS integration (HACS) | Modbus TCP to the inverter on port 502. Over 250 entities, all local, no cloud |
| Tariff | Octopus Energy integration (HACS) | Live Agile half-hourly rates, export rate, Saving Sessions, consumption |
| Forecast | Solcast (HACS) | 7-day rooftop PV forecast, both roof faces, free hobbyist tier |
| Brain | Predbat (add-on mode) | Plans charge/discharge against prices + forecast + learned consumption |
| Bridge | Three small HA automations | Map Predbat's requested mode onto Sigenergy's EMS controls. See configs |
How a typical day runs
| When | Typical Agile | What Predbat does |
|---|---|---|
| Cheapest slots (dynamic, often overnight) | ~13–15p | Charge the battery from the grid, but only as much as tomorrow's forecast says we'll need |
| Morning / daytime | ~20p | Run the house on solar, store the surplus, and export only genuine overflow at 12p |
| Evening peak (typ. 16:00–19:00) | mid-20s to high 30s p | Discharge to cover our own load. Avoiding peak-rate import beats a 12p export every time |
| Late evening | varies | Run the house down on battery, then repeat |
The one rule that explains everything: the export rate is a flat 12p at all times, so there are no export peaks to chase. The battery is there to supply the house, not the grid. For each kWh the order of value is: avoid evening peak import, then capture £1/kWh VPP events, then avoid standard-rate import, and only export at 12p as a last resort. Predbat works all of this out from the rates on its own. None of it is hard-coded.
The extras
Octopus Saving Sessions
The Octopus integration joins every session automatically. Predbat knows about them too: it charges the battery up beforehand, then force-discharges through the session window. A one hour session typically shifts about 7 kWh, and the Octopoints work out at £3 to £4 per kWh against the 10-day baseline.
Axle VPP (events-only)
Axle dispatches the battery four to eight times a month during grid stress and pays £1/kWh. It talks directly to Sigenergy's cloud, so Home Assistant isn't involved at all, and there's a £10/month minimum. If an Axle event happens to land inside a Saving Session you genuinely earn from both: Axle pays for the dispatch and Octopus rewards the metered export. The two schemes don't know about each other.
Load shifting
Tapo P110 smart plugs on the washing machine, dryer and dishwasher, plus a phone notification when solar surplus goes over 2 kW. Low-tech, worth about £65 a year.
The pipeline behind this site
The stats page is fed by Home Assistant itself. There are no spreadsheets and no cloud service in the middle:
- Six daily utility_meter helpers wrap the Sigenergy cumulative energy
sensors. When they reset at midnight, yesterday's total survives in the
last_periodattribute, which is the trick that makes a 00:15 read reliable. - Yesterday's costs come from Predbat's own tracking sensors
(
cost_yesterdayand its no-solar comparison), which are ready right after midnight. The Octopus cost sensors lag a day behind, so they can't be used here. - At 00:15 an automation builds one JSON file for yesterday and pushes it
to this site's GitHub repo with a single
rest_commandagainst the GitHub Contents API. One file per day, retried five times with backoff if the network blips. - GitHub Actions rebuilds the site and rsyncs it to the server. The commit history doubles as an audit log of every day's data.
The full pipeline YAML is on the configs page if you want it for your own install.
Maintenance reality
| Cadence | Task |
|---|---|
| Weekly | Glance that HA is up (an uptime monitor pings it) |
| Monthly | HACS updates, and a sanity check of earnings against the Octopus bill |
| Quarterly | Compare flat 12p export earnings with what Agile Outgoing would have paid. Switching is free |
| Annually | Full backup, battery cycle count, panel inspection |