Peak shaving at home: two batteries, a charger and Home Assistant
Since 2023, electricity bills in Flanders include a capacity tariff: you pay for the average of your highest quarter-hour per month, about 60 euro per kW per year. A heat pump, an induction hob and a car charger running at the same moment make that number expensive.
The digital meter's P1 port gives the data for free. My monthly peaks over the past year: between 8 and 12 kW, almost always between 17:00 and 22:00.
The idea
Peaks are short. A typical bad evening is one or two hours above the limit, not the whole day. So you don't need a huge battery, you need enough power at the right moment, and a charger that knows when to back off.
The parts:
- Two Marstek Venus E batteries (about 5 kWh each).
- An Etrel charger that speaks Modbus TCP.
- Home Assistant on an old Intel NUC, next to the Loxone Miniserver that already runs the house.
- The HomeWizard P1 meter for live grid power, and the solar inverters for production.
Batteries: from app to Modbus
Out of the box the batteries follow their own CT meter: charge on solar surplus, discharge to keep the grid at zero. Fine for self-consumption, but they don't know about peaks: by the evening they're often empty.
I moved both units to wired Ethernet, opened Modbus TCP, and let Omnibattery (a Home Assistant integration) drive them. It has a capacity protection mode: below a state of charge threshold the batteries stop doing self-consumption and only shave what goes above the limit. Above it, they work as normal.
On top of that, two small automations:
- Day and night thresholds. During the day the batteries keep a high reserve; after sunset they may go lower. The evening peak is the one that counts.
- A reserve for the evening. On a grey day the sun doesn't fill them. At 15:00, if the reserve isn't there, one unit tops up from the grid at a low rate, never above the peak limit itself.
The charger: slow down instead of stop
The car is the biggest single load I can actually move. The rule: the car may never cause a peak, and the batteries never charge the car.
Every minute Home Assistant computes the room for the car:
textroom = peak limit - 500 W - (grid + battery discharge - car)
That's the house without the car and without the batteries. The current follows that room in steps of 6, 8, 10, 13 and 16 A. Down within 15 seconds when the house load jumps, up at most once a minute. If even 6 A doesn't fit, the charger pauses and resumes when there's room again.
The first version forgot the batteries in that formula. The result: the batteries covered the house, the grid looked quiet, and the car happily took 13 A. Without the batteries that would have been a peak. Count what your batteries deliver as grid load when you decide how much else may run.
What I ran into
- Two controllers on one device. The charger paused every hour at about 40 seconds past the hour. Home Assistant wasn't doing it. The Loxone config still had Modbus actuators for the charger, with a repeat rate of one hour. Two systems writing setpoints to one device is a fight neither of them wins.
- Pause is not stop. The charger's "pause" register paused it in a way nothing over Modbus could undo. A 0 A setpoint pauses cleanly, and releasing the setpoint resumes it, but only 10 to 50 seconds later. Write a new setpoint in that window and the resume silently fails.
- A setting that resets itself. Modbus said 2500 W, the battery never gave more than 800. The maximum output in the manufacturer's app had gone back to 800 W, and that one wins.
- VLANs and UDP. One unit was plugged into a switch port in the wrong VLAN and replied from an unexpected address. The local API integration used a fixed source port with port reuse, so after deleting and re-adding a device the replies landed on an orphaned socket. Restart, then add.
- The data knew before I did. Analysing a year of quarter-hours showed that half of the monthly peaks came from one weekday: the heat pump's weekly legionella cycle switching on its electric heater. That was a setting, not a battery problem.
Results so far
November 2026: 5.7 kW, against 9.4 kW a year earlier. And that 5.7 was set on the 6th, before peak shaving was even switched on; the rest of the month stayed under 5 kW. Early December sits at 4.8 kW with the limit at 4.8.
One month is not a year, and winter evenings are the real test. But the approach works: measure first, find what actually causes the peaks, and only then decide what to buy and what to automate.