Charge in the cheap hours. Cover the expensive ones.

Smart Battery Pilot is a Home Assistant integration that plans your home battery 24 to 36 hours ahead, from your dynamic tariff, your household’s own consumption and the PV forecast. It drives any inverter you can control with a script.

  • Free, MIT licence
  • Runs locally
  • Home Assistant 2024.11+
  • Installs switched off, in dry-run
An example winter day96 quarter-hour prices in EUR/kWh, each coloured by what the pilot does in that slot

Point at a bar, or focus the chart and use the arrow keys, to read one slot.

  • Charge from the grid
  • Battery covers the house
  • Held for a pricier hour
  • Inverter on its own

A kWh charged at night for 0.10, divided by 90 % round-trip efficiency, plus a 0.10 spread, costs 0.21. That is well under the 0.50 evening peak, so the night is worth storing. The day at 0.20 is not worth spending the battery on, so the charge waits.

One planner, every season

Every 30 minutes, and whenever new prices arrive, the pilot plans the next 24 to 36 hours: the cheapest slots charge, the most expensive ones are covered from the battery, and the hours in between keep the energy for later. The same inputs always give the same plan.

The plan on your dashboard

A Lovelace card ships with the integration: planned actions, price, consumption and state of charge in one view, with three layouts from a phone column to a wall panel.

Dunkelflaute plan: charging at midday and again at night, the battery covering both evening peaks
Dunkelflaute. An eightfold price spread in one day, and the plan that uses it.
Winter arbitrage plan: charging in the cheap night, the battery held through the day for the evening peak
Winter arbitrage. Charge in the cheap night, hold through the day, cover the evening peak.
Summer plan with export: PV fills the battery and the evening peak is sold to the grid
Summer PV export. The sun fills the battery; the evening peak goes to the grid.
Plan with an overnight evcc charging session: the charging window, evcc's price limit and the battery held for the car
Planned EV charging. evcc’s overnight session, its price limit, and the battery held for the car.
Compact view with the EV tile next to SOC, next change and planned discharge
Compact view with the car. The figures first, with the next EV session as its own tile.
Balance view: PV minus consumption as an area around zero
Balance view. PV minus consumption, the quantity the planner works against.
Compact view: status, figures and a smaller chart
For phones. Status line, three figures and the curves underneath.

Six steps behind every plan

From the price list to the money it made, in the order the pilot runs them.

  1. Price forecastReads the price entity of your tariff integration: 15-minute or hourly slots, today and tomorrow.
  2. Consumption forecastA small model trained daily on your own history: hour, weekday and, with a heat pump, outdoor temperature.
  3. PV forecastExpected solar production comes off the demand, and surplus refills the battery in the simulation.
  4. OptimisationPairs the cheapest charge slots with the most expensive hours, within capacity, power, SOC limits and efficiency.
  5. ExecutionAt each slot boundary it calls your scripts: charge, block discharge, auto or export.
  6. AccountingFrom your battery meters it reports what the battery is worth and, separately, what the pilot added.

Careful with your battery, honest about the money

Vendor neutral: the pilot drives your inverter through Home Assistant scripts you write, so it works with any battery Home Assistant can control.

  • Learns your consumptionTrained daily on your history, aware of weekdays, temperature and heat pumps.
  • Uses the PV forecastWill not lock the battery on a day the sun refills it anyway.
  • Plans around your carSessions evcc has planned show up ahead of time, and the battery can stay out of the car.
  • Backup reserveA floor arbitrage never spends, refilled by a deadline after an outage.
  • Cold-weather chargingPlans with the charge power a cold battery really accepts, and learns it.
  • Two honest numbersWhat the battery is worth, and what the pilot added on top.
  • Safe by defaultInstalls switched off and in dry-run. A missing price or SOC hands the battery back to auto.
  • Ten languagesEnglish, German, Dutch, Danish, Swedish, Norwegian, Finnish, Estonian, Latvian, Lithuanian.
Prices from
NordpoolTibberaWATTarEPEX SpotENTSO-E
Batteries, via your scripts
FroniusVictronSMASungrowE3DCany inverter Home Assistant can control

Install from HACS

Smart Battery Pilot is in the HACS default repository, so there is no custom repository to add. It installs switched off and in dry-run: the first days are a plan to read, nothing more.

Open in HACS
  1. Search for Smart Battery Pilot in HACS, download it and restart Home Assistant.

  2. Add the integration under Settings, Devices & services.

    Pick your price sensor, battery, control scripts, consumption meter and PV forecast.

  3. Put the card on a dashboard.

    Switch the pilot on once the plan makes sense to you.