Repository navigation
[FEATURE] Rolling 24-Hour Window (Receding Horizon MPC) for Dynamic Tariffs #489
Replies: 6 comments 2 replies
|
Thanks for the suggestion! 🙌 Here's how this works:
If your idea is very specific to your setup, it may not make it into the core integration — I'll try to suggest a workaround in that case. Feel free to discuss details or alternatives below. |
|
Thanks for the detailed write-up — but the premise needs correcting, and the good news is that the problem behind it is already fixed. The midnight boundary is gone. The planning horizon now ends at the next local sunrise, not at 00:00: overnight consumption past midnight is budgeted, the discharge reserve is held through to sunrise, and the plan is rebuilt when tomorrow's prices are published (~13:00 CET). That lands in the next release — it's exactly what #410 asked for. The plan is not static. It's rebuilt whenever an input it was built on actually moves: prices published, solar forecast revised, an excluded device's solar claim changes, SOC falls below the evaluated level, evening solar wind-down, a configuration knob changes, plus a pre-slot re-check one hour before every window. Each of those rebuilds the full remaining horizon. So we already re-plan on fresh telemetry — we just don't re-plan on a clock. And that's deliberate. Three reasons a fixed 15-minute rebuild would be worse here:
So I'm going to close this one as covered by the sunrise horizon work. The part that isn't covered is your point about exporting high-priced morning solar before charging — that's a real and separate idea, and it's already your own #237. It doesn't need an MPC rewrite, just a price-aware gate on solar charging. Let's keep that conversation there. |
|
That is exactly where you are wrong: for dynamic contracts "solar production takes over" is not a suitable horizon. As long as it is profitable to export solar energy, i.e. export price is higher than the value of the energy in the battery, we still want to run of the battery even though the panels are producing energy and export all solar energy generated. For doing that we need more energy in the battery than you anticipated using the predictions made based on the sun up horizon. |
Two different things are being mixed here, and neither is a "no". This discussion (#489) is about when the plan is recomputed — a rolling 24h window recalculated every 15 minutes. That's what I answered: the plan is already rebuilt on every input that actually moves (new prices, revised solar forecast, SOC drop, pre-slot re-check), and the midnight boundary is gone as of 1.5.0. A fixed 15-minute loop would add cycles without adding information. What you describe in your follow-up is a different feature: running the house off the battery while exporting expensive morning solar. That is the opportunity-cost strategy from your own #237, and the deliberate-export half of it is #270. Nobody has said those won't be implemented. Where they actually stand:
So the sunrise horizon was never meant to be the final word on solar economics — it's the prerequisite the rest is built on. These are large features and they land one at a time, each with hardware validation behind it. Let's keep #489 to the re-evaluation cadence and take the export-economics discussion back to #270, where the spec work already is. |
|
@rrozema before 1.5.0 goes stable (planned in the next few days): the weekly 100% day you described (3+ kWh bought after 21:45) was addressed in b3. The weekly day now reserves the cheapest slot after the solar window closes, sized for the whole gap, and cancels it if the sun fills the pack. If you've had a weekly day on 1.5.0b5 since, could you tell me whether it behaved? |

Uh oh!
There was an error while loading. Please reload this page.
Area of the proposal
Energy management or control strategy
What problem would this solve?
Current predictive charging strategies create a static plan at the start of the day for when and how to charge/discharge up until the next day. For users on dynamic energy contracts, this leaves very little room for optimization:
The Midnight-to-Sunrise Gap: Between midnight and sunrise, there are typically few cheap charging opportunities, yet demand continues.
Morning Deficit & Loss: High-priced electricity slots frequently occur right before the new day begins, often causing households to start the morning with an energy deficit or a financial loss.
Inflexible Planning Horizon: While extending the plan further out (e.g., until the next sunrise) could help, solar and price forecasts are often unreliable or unavailable that far in advance. Furthermore, dynamic contracts often reward delaying battery charging when early-day solar production is active—meaning it can be more lucrative to export initial solar production while running off the battery until market prices drop sufficiently.
Proposed solution
Implement a rolling (moving) 24-hour optimization window based on a receding-horizon approach (Model Predictive Control style):
Recalculate Every 15 Minutes: Trigger an automated re-computation of the optimal 24-hour charging and discharging plan every 15 minutes (aligned with price change intervals).
Incorporate Fresh Telemetry: Feed the latest available data into each re-calculation, including newly updated usage patterns, live dynamic prices, updated solar generation forecasts, and current battery State of Charge (SOC).
Execute and Repeat: Execute the first 15-minute slice of the newly computed 24-hour plan, and then repeat the loop 15 minutes later using the newest known information up to 24 hours into the future.
Example use case
Example Scenario: The Midnight Boundary and the Unplanned Night Deficit
The Static / Midnight-Reset Problem (Current Behavior):
The Rolling Window Solution (Proposed Behavior):
Who would benefit from this?
Most Omnibattery users
Alternatives or workarounds
Extending the horizon to the next sunrise: Helps capture morning spikes, but suffers from inaccurate or even unavailable long-range weather/price forecasting and cannot dynamically react to sudden intraday shifts or delayed solar-charging opportunities. Plus it does not allow exporting high-prized morning solar before starting to charge the battery.
Additional context
This approach would significantly enhance profitability and efficiency for users on hourly or 15-minute dynamic tariffs, preventing morning losses and ensuring the battery adapts smoothly to changing intraday (market) conditions.
Confirmations
All reactions