Homelab Haven

Home Battery Simulator in Home Assistant

September 5, 20264 min read

Every "which home battery size do I need" article online does the same thing: takes an average household's daily usage, assumes a flat solar curve, and hands you a number in kWh. None of those calculators have seen my actual smart meter data: my real import/export pattern, my actual solar production, the actual shape of the day I use power on.

Batteries aren't cheap, and the right size depends entirely on how much solar I'm already throwing away and how lumpy my evening consumption really is. So instead of trusting a generic calculator, I'm simulating the answer with my own data, before spending a cent on hardware.

battery_sim: six sizes, running in parallel

battery_sim is a HACS custom integration for Home Assistant that models a battery's charge/discharge behavior against real energy sensors, no physical hardware involved. Each instance is its own config entry added through the UI rather than a YAML package (unlike most of the YAML-first config editing that runs this house), so running several side by side just means adding the integration again with a different capacity each time.

I'm running six at once: 2.5 kWh, 5 kWh, 7.5 kWh, 10 kWh, 12.5 kWh, and 15 kWh. Each is wired to the same two real inputs: my smart meter's import and export sensors, the standard sensors any P1 Monitor or DSMR integration exposes. Every instance replays the same historical grid data through a battery model of a different size, so the six results are directly comparable: same house, same days, same solar, only the capacity changes.

flowchart LR
    A[Smart meter: import + export sensors] --> B1[battery_sim: 2.5 kWh]
    A --> B2[battery_sim: 5 kWh]
    A --> B3[battery_sim: 7.5 kWh]
    A --> B4[battery_sim: 10 kWh]
    A --> B5[battery_sim: 12.5 kWh]
    A --> B6[battery_sim: 15 kWh]
    B1 --> C[Compare: money saved, self-consumption, simulated grid draw]
    B2 --> C
    B3 --> C
    B4 --> C
    B5 --> C
    B6 --> C

The early numbers already show something

The simulation started on August 25, so this is under two weeks of data, and the euro amounts are still small. But a pattern is already visible.

Home Assistant "Accu Lab" dashboard showing total money saved per simulated battery capacity, with the 2.5 kWh instance marked as the sweet spot

The 2.5 kWh instance is the current sweet spot: best savings per kWh of capacity. Go bigger and the total euros saved does keep climbing, but not proportionally: 10 kWh and 12.5 kWh have saved the exact same amount so far, and 15 kWh is only marginally ahead of 10 kWh despite having 50% more capacity. The dashboard itself puts it well: the longer this runs, the clearer the point gets where a bigger battery barely saves anything extra.

None of this means "buy the 2.5 kWh one" yet. Two weeks is nowhere near enough to see a full season of solar production, and a bigger battery's advantage should widen in summer when there's more excess solar to store. What it does mean is that the diminishing-returns curve is real and visible even this early, which is exactly the kind of thing a generic sizing calculator can't tell you about your own house.

What each instance tracks

No two instances share a sensor, so they don't step on each other. Per instance: a running total of energy saved and money saved (split between avoided import cost and lost export revenue), how much the simulated battery actually charges and discharges, and a simulated post-battery import/export figure so you can see what your bill would look like. There are also controls for battery mode and charge/discharge limits, so beyond raw capacity you can model different charging strategies too.

# Example entity naming pattern (sanitized — <size> is e.g. 2_5, 5, 7_5, 10, 12_5, 15)
sensor.test_<size>kwh_total_energy_saved
sensor.test_<size>kwh_money_saved
sensor.test_<size>kwh_battery_energy_in
sensor.test_<size>kwh_battery_energy_out
select.test_<size>kwh_battery_mode
number.test_<size>kwh_charge_limit

What I'd do differently

I'd have started this months before I actually had a battery on my shortlist: the earlier the real data accumulates, the sooner the comparison means something. I'd also fix each instance's charging strategy from day one, since raw capacity is only half the sizing question: how aggressively a battery charges and discharges matters just as much as how big it is, and right now all six are running the same default strategy.

I'll revisit this once there's a few months of data: enough to actually cross a winter or summer swing, not just two weeks of late-August sun.

Related

If this saved you some time, a coffee keeps the lights on and the posts coming.

☕ Buy me a coffee

Comments

Comments are checked before they appear.