I built a small free tool for Home Assistant users who have PV, a home battery and a dynamic electricity tariff.
The basic question is simple:
“My battery is at 30%, electricity is cheap tonight and tomorrow looks cloudy – how far should I charge?”
Instead of using a fixed rule like cheap electricity = charge to 100%, the calculator combines:
- current battery SOC
- battery capacity and reserve
- PV forecast for the next 24 h
- expected consumption
- charging efficiency
- cheap electricity price
- later electricity price
It then calculates a suggested target SOC, required grid energy, approximate charging time and the effective price after charging losses.
Example with the default values:
10 kWh battery · 30% SOC · 3 kWh PV forecast · 10 kWh expected consumption · 92% efficiency · 18 ct/kWh cheap price · 32 ct/kWh later price
Result:
Target SOC ≈ 80%
Grid energy ≈ 5.4 kWh
Charging time at 3 kW ≈ 1.8 h
The important part for me is leaving enough room in the battery for expected PV instead of blindly filling it from the grid.
The tool also generates a simple Home Assistant YAML starting point with placeholder entities for SOC, PV forecast, electricity prices, target SOC and grid charging.
Felix Speicherkapitän:
It is currently in German, but the calculation itself should be understandable internationally.
I would especially appreciate feedback on the logic:
- Would you include an estimated battery cycle cost in ct/kWh?
- How would you calculate the target SOC from tomorrow’s PV forecast?
- Which battery/inverter integrations would be useful to support first?
This is deliberately intended as a beginner-friendly planning tool, not as a replacement for EMHASS or more advanced optimization systems.