solar by numbers

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

LayerWhatJob
OSHome 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 linkSigenergy ESS integration (HACS)Modbus TCP to the inverter on port 502. Over 250 entities, all local, no cloud
TariffOctopus Energy integration (HACS)Live Agile half-hourly rates, export rate, Saving Sessions, consumption
ForecastSolcast (HACS)7-day rooftop PV forecast, both roof faces, free hobbyist tier
BrainPredbat (add-on mode)Plans charge/discharge against prices + forecast + learned consumption
BridgeThree small HA automationsMap Predbat's requested mode onto Sigenergy's EMS controls. See configs

How a typical day runs

WhenTypical AgileWhat Predbat does
Cheapest slots (dynamic, often overnight)~13–15pCharge the battery from the grid, but only as much as tomorrow's forecast says we'll need
Morning / daytime~20pRun 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 pDischarge to cover our own load. Avoiding peak-rate import beats a 12p export every time
Late eveningvariesRun 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:

  1. Six daily utility_meter helpers wrap the Sigenergy cumulative energy sensors. When they reset at midnight, yesterday's total survives in the last_period attribute, which is the trick that makes a 00:15 read reliable.
  2. Yesterday's costs come from Predbat's own tracking sensors (cost_yesterday and 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.
  3. At 00:15 an automation builds one JSON file for yesterday and pushes it to this site's GitHub repo with a single rest_command against the GitHub Contents API. One file per day, retried five times with backoff if the network blips.
  4. 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

CadenceTask
WeeklyGlance that HA is up (an uptime monitor pings it)
MonthlyHACS updates, and a sanity check of earnings against the Octopus bill
QuarterlyCompare flat 12p export earnings with what Agile Outgoing would have paid. Switching is free
AnnuallyFull backup, battery cycle count, panel inspection