Repository navigation
fix(loadpoint): a duty quarter runs the car for the plan's on-time - #1827
Merged
Merged
Conversation
Codex Review SummaryThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
6 tasks done
The home box on 25 Oct 2026 ran at 230.8 V, so the car drew 10386 W against the plan's 10350 W and spent the quarter's energy about 3 s early. Core ordered 0 W; the stop reached the Easee in the next quarter, which wanted 8970 W. With Core's own offer at 0, the EV hard limit took the start path and read the car's own current still on L1 as house load: fuse_cap_w=0 for 84 s, then 9 A, then charging.interrupted and a replan that moved the car an hour later. A duty slot now commands its on-power for the plan's on-time, the slot's energy at that power from the plan's interval start, and on until the energy is spent. A car that draws more than its step keeps running for the on-time; one that draws less runs until the energy is spent, as before. The extra on-time only continues a running order, so a car something else stopped stays stopped. An off-time shorter than CommandSettle would reach the charger only in the next slot, so the car runs to the slot's end. The deadline reserve keeps its own rule. The sitesim rows replay the night at 230.8 V and 237 V and fail on master. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
At 237 V the car spends the 02:45 quarter's energy at 02:59:33 and the on-time keeps it on. At 02:59:40 the hour's ceiling leaves 5 kW for the rest of the hour. The EV hard limit's cap applies after the loadpoint's order, so the car goes to 0 W on import_limit at the next tick and stays off: the spent energy keeps it there. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
frahlg
force-pushed
the
fix/ev-keeps-order-at-quarter-end
branch
from
October 25, 2026 09:27
2a5c978 to
56f0108
Compare
This was referenced Oct 25, 2026
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.
Field case
Home box, 25 Oct 2026, v0.155.1-beta.1. The site is 3 × 20 A with an Easee charger, a 9.6 kWh Sungrow battery and planner mode. I read the box read-only: the journal,
/api/series,/api/mpc/diagnose/*and/api/status.fuse_cap_w=0 … below minimum stepfrom 02:45:00 to 02:46:24, then a cap of 5 936 W (9 A).charging.interruptedfired and a fuse-saturated replan ran. The new plan put the battery at 5 kW in the 02:45 quarter and moved the car to 03:45.The battery did not take the room. It charged 260 W when the cap went to 0, and rose to its planned 2 091 W only after the car stopped. Its 3.8 kW from 02:47 was the new plan, made while the car was idle.
Change
computeCommandForBudget, duty branch:CommandSettle(20 s) would reach the charger only in the next slot, so the car runs to the slot's end.docs/energyplan-contract.mdnow says the same.The order still passes every clamp after this point: the fuse clamp, surplus, vehicle completion and the deadline reserve's stop when power is missing.
The extra charge is what the car's extra draw gives over the plan's on-time: about 3 % at 237 V, which is 70 Wh in a full quarter at 10 kW. A dropped off-time adds at most 20 s at on-power.
Deleted: nothing. Production code: +18/−2 lines in
computeCommandForBudget.Scenario numbers
TestDutySlotRunsItsOnTime, ticks every 3 s:Closed loop and field matrix:
The import ceiling wins
The on-time only shapes what the loadpoint asks for. The EV hard limit's cap carries both the fuse and the hour's import ceiling.
freezeFuseBudgetandapplyFuseClampapply that cap aftercomputeCommandForBudget, so a ceiling cut always wins. Once it has cut the car, the spent energy keeps the car off: the extra on-time only continues an order that is still running.TestSiteSimDutyOnTimeYieldsToTheImportCeiling(sitesim, realEVFuseBudgetand hour logic):import_limit, and no order above 0 W follows before 03:00.Two independent Sonnet reviews ran on this branch.
make verifypasses.Not in this PR
fuseHeat.levelA:max(reading, heat) + pending). After the car's own stop, that kept it off 84 s with 14 A of room on the reading. Under the first-order model, a rise is safe when the heat is under the limit and reading + pending + rise is too. The heat also slows an EV rise into room the battery's discharge made, so this is a fuse-model change for a separate decision.Hardware
Not yet run on the box. Real-hardware evidence is still needed: a quarter boundary on the home box with the car at a full step.
🤖 Generated with Claude Code