
My Smart Battery Was Charging During the Most Expensive Hours of the Day
A few days ago I caught my home battery doing something dumb. It was 8 in the morning, the electricity price was €0.278 per kWh — the expensive part of the day — and the battery was happily charging at 443W. That made no sense. I have dynamic pricing, so the whole point is to charge when power is cheap and use the battery when it’s not. Why was it pulling expensive grid power to top itself up?
I traced it back to a logic bug in the Home Assistant automation I’d built to override the battery’s built-in mode. My automation had a branch that said “if there’s solar surplus, charge the battery with it.” That branch came before the price check. So every time the sun peeked out — even for a moment — the battery started charging, and because charging pulls whatever it needs from the grid too, it was mixing in expensive power. The cheap-hours logic never got a chance to run.
The Fix Was One Line — The Lesson Was Bigger
The fix itself was almost insultingly simple. I added a price gate to the solar-surplus branch: only charge on surplus if the tariff is low enough (≤ €0.15) or it’s already a cheap hour. In expensive hours, the surplus now goes back to the grid instead of charging the battery. One condition, and the battery stopped wasting money.
But here’s what actually cost me. The automation had a second setpoint variable in a later block of the config, not the one I patched first. My first edit changed the wrong place — the automation kept running the old logic, and I didn’t notice until I checked the real setpoint that number.set_value was using. The lesson: when you patch automation logic, always verify which block actually drives the behaviour, not just where you think it should be.
The Real Inefficiency Was Me, Not the Battery
After that fix I kept going, because the battery had a second problem: it only looked at one of my two solar inverters. I have a Zonneplan One pushing 1408W and a SolarEdge adding 128W, but the automation was only reading the SolarEdge. It was ignoring almost all of my solar production. Fixing that one line roughly tripled the solar signal the automation could react to — and that’s the moment the “smart” in smart home actually started showing up.
The whole morning was a spiral of small, dumb bugs: wrong block, wrong sensor, wrong priority. Each one was trivial on its own. Together they were quietly costing me money every single day. That’s the thing about home automation — it doesn’t fail loudly. It fails as a slightly higher electricity bill and a battery that’s full at the wrong time.
What I’d Tell Anyone With a Smart Battery
If you have a home battery and dynamic pricing, don’t trust it blindly. Ask three questions: Is it charging during expensive hours? Is it seeing all of your solar production, not just one inverter? And when you tweak the automation, are you sure you edited the block that actually runs? The battery’s built-in mode is usually fine — but once you start overriding it, you’re responsible for the logic.
Does your smart home ever quietly do the opposite of what you intended? I’d love to hear the dumbest bug your automation has pulled on you — drop it in the comments below.
Wat vond je van dit bericht?