batcontrol
batcontrol controls your PV battery based on dynamic electricity prices, a solar forecast and your consumption profile. It charges the battery from the grid when electricity is cheap and saves stored energy for the expensive hours — fully automatic, and without an IP-based meter.
Key features
- Price-aware charging — buy cheap, use it when prices peak
- Works with any inverter — Fronius GEN24 (Solar API), Fronius Modbus TCP, or any system via the generic MQTT driver
- No extra meter required
- Solar & consumption forecasting built in
- Home Assistant integration via MQTT auto-discovery and a dedicated add-on
- Peak shaving to keep battery capacity free for the midday PV peak (since 0.8.0)
- evcc coordination for EV charging
- Resilient operation — survives short inverter or network outages
- Open source (MIT), runs as a Docker container
How it works
batcontrol runs in a short loop and combines three forecasts:
- Electricity price from your dynamic tariff (next 24–48 h)
- Solar production from a PV forecast service
- Consumption from a load profile scaled to your annual usage
From these it computes your expected net consumption and decides each cycle whether to charge from grid (prices are low and will rise), hold the battery (save it for the expensive hours), or discharge normally. It then sets your inverter accordingly — and restores your original settings on shutdown.
Supported hardware & services
| Category | Supported |
|---|---|
| Inverters | Fronius GEN24 (Solar API), Fronius Modbus TCP, any inverter via MQTT |
| Dynamic tariffs | Tibber, aWATTar, evcc, zone-based tariffs (e.g. Octopus) |
| Solar forecast | Forecast.Solar, Solarprognose, evcc, Home Assistant sensor |
| Consumption | CSV load profile (scaled to annual kWh) or Home Assistant sensor |
| Home automation | MQTT, Home Assistant (auto-discovery + add-on) |
Get started
batcontrol runs as a Docker container and is configured through a single YAML file.
- Install & run: see the README
- Full configuration reference: the Documentation
- Home Assistant users: the batcontrol add-on
batcontrol is experimental software that controls real hardware and is provided without warranty. Start with conservative limits and monitor the logs during initial setup.
