You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
fix(mpc): score remaining slot time in forecastLoadWh after #1130 #1144
#1130 plans only the remaining time in the current price slot. forecastLoadWh still multiplies LoadW by the full LenMin.
Found on master 6eadec3f (go/internal/mpc/load_bounds.go).
What happens
trimFirstExecutionSlot sets ExecutionStartMs so DurationHours() is the remainder. Action energy, EV budgets, and dispatch intent use that remainder.
forecastLoadWh does:
wh+=math.Max(0, s.LoadW) *float64(min) /60.0
with min = s.LenMin (default 60). After trim, first-slot LoadW is a remaining-interval average. Rain-check then integrates it as a full 15 minutes.
Horizon-scale error is small on a 24h plan. It is the one leftover that can still rewrite load energy for the current quarter, which is the failure #1130 was closing.
LoadpointPlanWindows similarly reports energy from ExecutionStart to slot end, not remaining-from-now, so the UI can overstate leftover EV Wh after a mid-slot plan.
What a fix needs
forecastLoadWh / rain-check must use DurationHours() (or remaining hours), same as ValidatePlan.
Test: first slot ExecutionStartMs 10 minutes in, LenMin=15 — rain-check energy is 5 minutes of load, not 15.
Optionally the same remaining-from-now for LoadpointPlanWindows.
Open PR overlap: #1131 is the version-packages PR for #1130 only. Do not fold this into that changelog bump.
Activity