One Year of Letting a Python Script Buy My Electricity

One Year of Letting a Python Script Buy My Electricity

A year ago today, on 18 July 2025, I plugged a battery into a Python script and more or less stopped thinking about when to buy electricity. Since then the script has made 3,901 decisions — one every half hour — about whether to charge from the grid now, wait for a cheaper slot later in the day, or hold out until tomorrow. I forgot it was there most days. It didn't.

Over the year it saved about £233 against what the same electricity would have cost on the price cap — and it did that by buying cleverly, not by using less. The battery pulled around 1,060 kWh from the grid at an average of 11.7p a unit, while the cap charged more than double that for the identical kilowatt-hours. The gap between those two prices is the entire game.

The best moments were the ones where the grid paid me to take power. Octopus Agile went negative across 391 half-hours over the year — wholesale electricity so oversupplied the price drops below zero — and the planner caught them, filling the battery while I was effectively paid to charge. The most extreme slot hit minus 12.05p a unit. On days like that the battery isn't saving money, it's earning it.

Solar joined the story a few weeks later, on 10 August, once the panels in the garden were logging properly. The array grew all year — I started with three panels on salvaged frames and kept adding more until it reached seven, a full 700 watts.

Across those eleven months it generated 390 kWh, peaking at 3.45 kWh on a clear July day once the whole array was up. About 126 kWh of that fed straight into the battery: free electricity displacing units I'd otherwise have bought.

By any normal measure the array is trivial. A typical home install is a 4-kilowatt roof of ten or twelve big panels — mine is 700 watts of seven small ones on salvaged frames at ground level. But it's sized for how I actually live: in a one-bed flat I use about 5.4 kWh of electricity a day, and the panels averaged 1.2 kWh — roughly a fifth of everything I used, without leaving the garden.

That yearly average flatters the winter and hides the summer. In December and January the panels were almost decorative, covering 2 to 5% of a day's use. By May and June they were covering half the month's electricity outright — the same 700 watts, just pointed at a higher sun.

And it was cheap to build. The whole system came to £2,203 — around £750 of panels and £1,450 of battery and electronics — against the £8,000 to £10,000 a roof-mounted solar-and-battery install with a certified fitter would run. No scaffolding, no MCS paperwork, no roof: just a garden, some salvaged frames, and a battery on a board indoors.

What surprised me most wasn't the money, it was the composure. The battery never once fell through its floor all year — the lowest it ever reached was 22.3%, and on eight occasions a safety-net rule quietly topped it up before a grey afternoon could run it flat. It deferred charging 226 times, gambling that a cheaper slot was coming. Mostly the gamble paid off.

There's an uncomfortable truth under all of this. The kit has shrunk the energy half of my bill so far that the fixed daily standing charge now dominates what's left. In my best month the electricity I actually used cost £26 against a £75 cap equivalent — but the standing charge doesn't care whether I generate my own power or not. The battery won the part of the bill it's allowed to fight.

The year in numbers
£233saved vs the price cap
1,899 kWhelectricity used over the year
3,901half-hourly charge decisions
1,060 kWhbought for the battery at 11.7p avg
391negative-price half-hours caught (low −12.05p)
390 kWhsolar generated (best day 3.45 kWh)
22.3%lowest the battery ever got — floor never breached
Savings are electricity units against the price-cap unit rate (what the same kWh would have cost with no battery and no Agile) — not the dual-fuel bill, which also carries gas and the standing charge the kit can't touch.

A year in, the thing I'd tell anyone weighing this up is that the battery is only half of it. The other half is an unglamorous script that never sleeps, never forgets to read the overnight rates, and treats every half-hour as a small decision worth getting right. £233 isn't a fortune — but I did nothing to earn it except let the machine pay attention.

Thinking of switching energy supplier? We both get £50.

Switch to Octopus Energy →