Writing an automation to heat and charge during the cheapest hours — why does "pick the N cheapest hours" perform so badly?
I am on an hourly spot price tariff and I have the prices for tomorrow available in my automation system each afternoon. I want to shift the water tank, the heating and the car charging into the cheap hours.
My first attempt was the obvious thing: sort tomorrow's hours by price, take the cheapest N, run everything during those.
It works in the sense that it runs when prices are low. But the house is cold at the wrong times, the tank sometimes runs out mid-evening, and one day the car did not finish charging because the cheap hours were scattered across the night with gaps.
What is the actual shape of this problem? I get the feeling I am solving it wrong rather than tuning it wrong.
@thermal_mass_theo · 2h ago
You are solving it wrong, and the reason is a good one to internalise because it applies to all three of your loads differently.
"Cheapest N hours" optimises price and ignores the constraint. Each of your loads is really a storage problem with its own rules, and the rules are what make the schedule feasible:
So the correct framing is: for each load, what is the minimum energy needed, by when, subject to what constraints — and then place that energy in the cheapest hours that satisfy the constraints. Price is the objective; the constraints come first.
A concrete shape that works and is not hard to implement:
On the heating specifically, this is where "cheapest hours" fails worst. Preheating works, but only if the building holds it. A well-insulated house with underfloor heating can coast for hours; a leaky one with radiators loses it in forty minutes and you have paid for heat that went outside. Measure your own coast rate before designing around it: heat to the top of the band, turn everything off, and time how long it takes to fall to the bottom. That number is the only thing that tells you how much preheating is worth doing.
Start with a threshold rather than an optimiser — run when the price is below some percentile of the day — measure for a fortnight, and only then decide whether the extra complexity pays. It frequently does not.
Reply
Report