Skip to the content
Shawn Smith
Subscribe
The House Project 7 min read

Putting the battery's AI to the test

Our battery is run by Sigen AI and I've never really known if it's any good. So I built a pretend battery that plans alongside it every five minutes, had the maths checked twice and found a few bugs on the way. Nine diagrams and an honest not yet.

Shawn Smith27 November 2026
Share
The Home Dash Battery page in a Safari window on a Mac, showing the live test waiting for its first day, Sigen AI's capture and the shadow's plan for the next day
Fig. 00 · The House Project

Part of the Home Dash series in The House Project. Last updated 27 November 2026.

Our battery isn't run by me or by Home Assistant. It's run by Sigen AI, the brains that came with the Sigenergy system. It decides when to charge, when to hold and when to sell to the grid, and with Amber's prices changing every five minutes that's a lot of decisions.

Here's the thing. I've never really known if it's any good. The bill looks fine, but fine compared to what? So I built something to find out, had the maths checked twice, found a few things wrong along the way and fixed them. This is the story of all that, with a lot more pictures than usual.

A shadow battery

The idea is simple enough. Leave Sigen AI completely in charge, and run a second, pretend battery alongside it. A free planner called EMHASS looks at Amber's price forecast, Solcast's solar forecast for both sides of the roof and what the house usually uses at that time of day, then works out the best plan for the next 24 hours.

That plan only ever moves a virtual battery, the same size as ours. There's no wire, real or otherwise, from the shadow to the real battery, and I wanted it that way.

Diagram. On the left Sigen AI, fed by its own forecasts, controls the real battery. On the right the shadow, fed by Amber, Solcast and our usage, only plans and moves a virtual battery. A red crossed line between the two batteries says never wired. Both report to Home Assistant, which keeps score
Two brains, one battery. Only one of them is allowed to touch it.

Five minutes at a time

The shadow doesn't make one plan a day. Every five minutes, just after Amber's new price arrives, it plans the whole next day again from wherever its virtual battery happens to be. Then it does only the first five minutes of that plan and throws the rest away. Next time round it starts fresh.

Diagram of a loop with four steps. Amber's new price arrives, the shadow plans the next 24 hours from the virtual battery's level, does the first five minutes on the virtual battery, then the cost is added up for no battery, Sigen AI and the shadow. In the middle, 288 times a day
Plan the day, do five minutes, start again. That's what lets it react to a price spike that only shows up shortly before.

Keeping score

Home Assistant keeps running totals of what each five minutes would have cost with no battery at all, what it actually cost with Sigen AI and what it would have cost with the shadow. Each night it adds one more, hindsight. That's the planner given another go once the day's over, knowing exactly how the prices and the sun turned out.

Hindsight gives a nice simple measure. How much of the best possible saving did Sigen AI actually make? Going back over the house's history from 9 November, the answer is 57 percent.

Bar diagram. The best possible saving over 17 days was 70.57 dollars. Sigen AI saved 40.56 dollars of it, leaving 30.01 dollars, which is 57 percent captured, about 2.39 dollars a day saved and 1.77 dollars a day left on the table
Sigen AI's first report card. Good, not perfect, and nobody gets 100 percent.

That $1.77 a day sounds like a lot left over, but to be fair hindsight knows when a spike is coming and the real thing doesn't. The more useful question is whether the shadow, working with forecasts just like Sigen AI, can do better than it. I set the bar at 70 cents a day, about five dollars a week. Below that, swapping the brains over isn't worth the risk or the effort.

Getting the maths checked

Before trusting any of this I wrote the whole model up, every formula, and sent it off for an independent check. I'm glad I did, because it caught real things.

The biggest was what happens at midnight. The shadow was quite happy to run its battery flatter than Sigen AI by the end of the day, which made its bill look better. But energy left in the battery is worth something tomorrow. A fair comparison has to count it.

Diagram. At midnight on 21 November Sigen AI's battery held 23.4 kWh and the shadow's 14.4 kWh. Tomorrow is planned twice from the same forecast, once from each level. From Sigen AI's level tomorrow earns 2.62 dollars, from the shadow's 2.13 dollars, so the shadow pays the difference of 49 cents
Now each night tomorrow is planned twice, once from each battery's level, and the shadow pays or is paid the difference.

The second was timing. The first version added up each five minutes just after it finished, using the price that had just arrived. That's the next slot's price, not its own. Most of the time that's a cent here or there. On 21 November there was a five minute spike at ten past three in the morning.

Diagram of four five minute slots on 21 November with the price for energy sold to the grid, 38 cents, 71 cents, 8.65 dollars and 1.09 dollars. A kWh sold between 3:05 and 3:10 should be worth 71 cents, but the first version priced it at the next slot's 8.65 dollars
One slot late, twelve times too much. The costs are now added up just before each slot ends.

It also pointed out that five days of results can't support a very confident range, and that days aren't independent of each other anyway. A run of cloudy days looks alike. So the page now uses a wider, more honest range and wants 30 days before it says anything.

The forecast nobody kept

Then, while fixing those, I found one of my own. To test the shadow on days before it existed, I replay them, rebuilding what the forecasts said at every moment from Home Assistant's history. Except Home Assistant quietly doesn't keep Solcast's half hourly forecast. It keeps the daily total and drops the detail. So every replay I'd run had the shadow planning for no sun at all. Not my finest moment.

Line chart of solar on 21 November by half hour. Solcast forecast 67 kWh and the panels made 60.5 kWh, peaking near 10 kW after lunch, while the first replays were told zero all day
What the replay was told, what Solcast actually said and what the panels made.

The live shadow was never affected, because it reads the forecast as it is right now. But it meant the house needed its own memory. Every time Solcast updates, a copy of its forecast is now saved, and each night the day's Amber forecasts and what actually happened get packed into one small file, about 85 KB a day.

The second check

I sent the fixes back for a second look. It came back with more suggestions, and this time I didn't take them on faith. I checked each one against the actual code and the house's own numbers before agreeing.

Most held up. One didn't. The reviewer worried the planner might charge and discharge the battery at the same time to game the numbers. I went and read the planner's source code, and it has a switch for each step of the plan that only allows one or the other. So that one's closed.

And checking the replay advice turned up the most important bug of the lot, which nobody had spotted. The live shadow was planning from the real battery's level but carrying out the plan on its own virtual battery. Whenever the two drifted apart, it was making decisions for a battery it didn't have. That's fixed, and the live test starts again from 27 November with everything as it should be.

Timeline from 11:55 pm to 12:45 am. Just before midnight the difference between the batteries is valued, just after the virtual battery is reset to the real one, at 12:22 hindsight runs, at 12:27 tomorrow is planned from each battery's level and at 12:40 the day is archived. Every five minutes all night the shadow plans and moves
Most of the bookkeeping happens in the first 40 minutes after midnight.

How the answer changed

Every time I fixed something I replayed the same five days, 21 to 25 November, and kept the old results rather than overwriting them. It's a good reminder of how much the answer depends on getting the plumbing right.

Bar chart of how far ahead of Sigen AI the shadow came out per day in each version of the replay. First try 37 cents. Review fixes but no solar forecast 5 cents. Solar forecast added 1.17 dollars. Same loop as the live shadow 1.14 dollars. The same without the spike day 24 cents. A dashed line marks the 70 cent bar
Same five days, four versions. The solar forecast is what moved it.

The final version copies the live shadow exactly, planning every five minutes from its own battery and valuing what's left at midnight. It has the shadow about $1.14 a day ahead. Look, that's interesting. But take out the 3 am spike day and it's 24 cents.

Where it's at

Dot chart of each day's gap between Sigen AI and the shadow, from minus 1.42 to plus 4.73 dollars, the largest being the spike day. The average is 1.14 dollars but the likely range runs from minus 1.71 to plus 3.99 dollars, crossing zero and the 70 cent bar. Without the spike day the average is 24 cents
Five days can't tell them apart. The grey band crosses zero, so it could still go either way.

So the honest answer is not yet. Five days is nowhere near enough, most of the shadow's lead comes from one spike, and those five days are rebuilt after the fact with Solcast's own records, which are a touch kinder than the forecast was on the morning.

The real test is the live one, from 27 November, with every forecast kept exactly as it was. The Battery page counts the days towards 30. The shadow only wins if its lead is clearly above 70 cents a day, it isn't behind on ordinary days and it isn't leaning on one lucky spike. If that happens I'll think about letting it drive. If it doesn't, Sigen AI is doing its job and I can stop wondering. I'll write up whichever way it goes.

The maths, for the curious

For anyone who wants the working, here are the three sums that matter, each with a real example.

Equation card. Cost equals kWh bought times buy price minus kWh sold times sell price. Worked for 3:10 am on 21 November, no battery cost 22 cents, Sigen AI about nothing and the shadow, had it sold at the 5 kW limit, would have earned 3.60 dollars
Every five minutes, costed three ways. Sigen AI's battery covered the house during the spike but didn't sell into it.
Equation card. The shadow is judged on its day plus tomorrow from its level minus tomorrow from Sigen AI's level. Worked for 21 November, minus 10.23 dollars plus 49 cents gives minus 9.74 dollars, against Sigen AI's minus 5.01 dollars
How midnight is evened up. Sigen AI is the reference, so only the shadow's number moves.
Table of the three checks for the five-day replay. The whole range above 70 cents a day, no, at minus 1.71 dollars. Not behind on ordinary days, yes, at 24 cents. Not leaning on one lucky day, yes, at 24 cents
The three checks. One no is enough, and five days is far too few to pass the first.

The full working, with every formula, table and bug, is in The maths behind the shadow battery. I'll keep it up to date as the live test runs.

Under the bonnet

  • EMHASS runs as a Home Assistant add-on and only ever makes a plan. Nothing acts on it.
  • Home Assistant automations move the virtual battery every five minutes and keep the running totals, including the 5 kW export limit and the inverter's 12 kW limit.
  • Hindsight runs each night once on electricity cost alone and once allowing for battery wear, and the replays add a five minute version too.
  • The forecast archive is a small script Home Assistant runs itself, with a notification if it ever fails.
  • Every version of the model and its results is kept, so I can always see what changed and why.

The rest of the kit is in The Home Dash kit list. The Energy page this sits next to is in The Energy page, in order, and the solar forecast it leans on is in Teaching the solar forecast which way the roof faces.

Keep reading the series

Keep reading

Everything →