Repository navigation
Conversation
Balanced now reserves battery charging in real time, like Battery First, when the remaining PV forecast cannot cover the missing energy to the target SoC plus the expected house load until the target time. With a sufficient forecast, appliances keep the full surplus. Without an available forecast, Balanced behaves as before.
MonsterD1
force-pushed
the
feat/73-balanced-forecast-reserve
branch
from
November 13, 2026 13:15
335aea9 to
bb036b4
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Problem
With Balanced, the configured target SoC and target time only reach the planner. In real-time control,
_power_for_optimizer()reserves battery charging only for Battery First, so Balanced (with Plan Influence = None) hands the whole charging power to appliances, even on a dull winter day with the battery far below target and almost no export. On such a day a low-priority load can run for hours on power that would otherwise have charged the battery, and briefly on battery discharge until its switch interval expires.Change
Balanced now uses the existing Battery First reservation in real time, but only when the forecast is not enough:
forecast_sufficient).battery_first_budget()is applied unchanged (charge cap, live limit, measured charging).Code:
power_policy.forecast_reserve_needed()(pure function),coordinator._balanced_forecast_reserve(), two constants inconst.py, docs indocs/energy-policy.md.Open for discussion
The 0.5 kW base load and 0.5 kWh buffer are constants. If you prefer, I can expose them as options or make the behavior opt-in instead of default for Balanced.
Validation
tests/test_power_policy.py: decision table, missing inputs, insufficient/sufficient forecast, no forecast unchanged, missing SoC fallback, hysteresis.scripts/check_public_tree.py: 0 findings.Closes #73