Repository navigation
feat(loadpoint): tell the driver Core's current cap per phase - #1809
Merged
Merged
Conversation
Each ev_set_current order now carries cap_amps_per_phase: the most current per phase Core allows this charger on the phases the order names. It is the charger's share of the EV fuse/import cap and of the busiest phase's room after the split between chargers, within the order's max_amps_per_phase and the charger's maximum, and not limited by what the plan or a hold wants. Room that no charger took goes to the first charger with a share, so two chargers are never told the same room. Omitted on a 0 W order, without a fuse budget, or without a voltage. max_amps_per_phase is the fuse rating. easee_cloud (srcfl/device-drivers#190) needs the room left to start a 6 A order at 7 A only when 7 A fits. No order changes. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
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. |
frahlg
added a commit
to srcfl/device-drivers
that referenced
this pull request
Oct 22, 2026
The 7 A start for a 6 A order now needs Core's cap_amps_per_phase (srcfl/ftw#1809) to allow 7 A, besides max_amps_per_phase and the charger's static limit. max_amps_per_phase is the fuse rating, not the room left: on a phase with room for 6.4 A the car drew 7 A, Core cut to 0 W, and the next start boosted again. A Core that sends no cap gets no boost. Review findings on #190: - P1: every 6 A order during a boost checks the gate again; one that no longer fits writes 6 A at once and ends the boost. - P2: the 90 s window ends in driver_command too, and driver_poll ends it before reading observations, so a failed read cannot keep 7 A. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
frahlg
added a commit
to srcfl/device-drivers
that referenced
this pull request
Oct 22, 2026
The 7 A start for a 6 A order now needs Core's cap_amps_per_phase (srcfl/ftw#1809) to allow 7 A, besides max_amps_per_phase and the charger's static limit. max_amps_per_phase is the fuse rating, not the room left: on a phase with room for 6.4 A the car drew 7 A, Core cut to 0 W, and the next start boosted again. A Core that sends no cap gets no boost. Review findings on #190: - P1: every 6 A order during a boost checks the gate again; one that no longer fits writes 6 A at once and ends the boost. - P2: the 90 s window ends in driver_command too, and driver_poll ends it before reading observations, so a failed read cannot keep 7 A. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Signed-off-by: Fredrik Ahlgren <fredrik@sourceful-labs.com>
frahlg
added a commit
to srcfl/device-drivers
that referenced
this pull request
Oct 22, 2026
* fix(easee_cloud): start a 6 A order at 7 A (1.3.7) Signed-off-by: Lödkolven <lodkolven@users.noreply.github.com> * fix(easee_cloud): boost only with a read static limit (Codex review) Signed-off-by: Lödkolven <lodkolven@users.noreply.github.com> * docs(changelog): wrap easee_cloud 1.3.7 Signed-off-by: Lödkolven <lodkolven@users.noreply.github.com> * fix(easee_cloud): boost only when Core's cap allows 7 A The 7 A start for a 6 A order now needs Core's cap_amps_per_phase (srcfl/ftw#1809) to allow 7 A, besides max_amps_per_phase and the charger's static limit. max_amps_per_phase is the fuse rating, not the room left: on a phase with room for 6.4 A the car drew 7 A, Core cut to 0 W, and the next start boosted again. A Core that sends no cap gets no boost. Review findings on #190: - P1: every 6 A order during a boost checks the gate again; one that no longer fits writes 6 A at once and ends the boost. - P2: the 90 s window ends in driver_command too, and driver_poll ends it before reading observations, so a failed read cannot keep 7 A. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Signed-off-by: Fredrik Ahlgren <fredrik@sourceful-labs.com> --------- Signed-off-by: Lödkolven <lodkolven@users.noreply.github.com> Signed-off-by: Fredrik Ahlgren <fredrik@sourceful-labs.com> Co-authored-by: Lödkolven <lodkolven@users.noreply.github.com> Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
This was referenced Oct 23, 2026
frahlg
added a commit
that referenced
this pull request
Oct 23, 2026
…#1811) Move the device-drivers pin from 5cc7bb1a to 219c462e (srcfl/device-drivers#190 and #191). Between the two pins only easee_cloud changed. An Easee Cloud charger given a 6 A order now starts at 7 A per phase when Core's cap_amps_per_phase (#1809) allows 7 A, which avoids Easee's roughly five-minute delay at 6 A, and steps down to 6 A once the charger reports charging or after 90 s. 1.3.8 adds two review fixes: no 7 A before the first poll, and a pause or stand-down cannot leave 7 A for the phaseMode re-assert. Signed-off-by: Fredrik Ahlgren <fredrik@sourceful-labs.com> Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
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
srcfl/device-drivers#190 makes easee_cloud start a 6 A order at 7 A, because Easee firmware waits about 5 minutes before it starts a car at 6 A (Göran's runs, 22 Oct 2026; evcc does the same). The driver can only tell whether 7 A fits from
max_amps_per_phase. Core sends the site's main fuse rating there (for example 25 A), or a manual hold's limit, never the room Core has left.So when Core orders 6 A because a phase only has room for 6.4 A, the driver still writes 7 A. The car draws 7 A until the next reading, Core sees an overage, cuts to 0 W, and the next start boosts again. The car cycles on and off in exactly the tight case.
Change
Each
ev_set_currentorder now carriescap_amps_per_phase: the most current per phase Core allows this charger right now, on the phases the order names. Core already decides this infreezeFuseBudget; this PR only reports it. No order changes, and no fuse rule is added.The value, in amps, rounded down to two decimals, is the least of:
control.EVFuseBudget: fuse, total import and the hour's import limit), over voltage × phases;control.EVFusePhaseRoomA), when the meter reports phase currents. This is the same credit and roomphaseRoomCapWuses;MaxChargeWover voltage × phases;max_amps_per_phase, after the hold's limit, the installation limits and the one-phase charger limit. The field never exceeds it.It is not limited by what the plan or a hold wants, so it can be above the order. A plan or a hold that asks for 6 A on a phase with room for 15 A gives
cap_amps_per_phase: 15. A hold'smax_amps_per_phasedoes limit it.Between chargers, each keeps its own share. Room that no charger took goes to the first charger with a share in the split's order, so two chargers are never told the same room. With 13 A of room and two 6 A orders, the first gets 7 and the second 6.
The field is absent on a 0 W order, when no fuse budget is wired (no site meter or fuse), and without a voltage. A driver must read a missing field as "no room above the order".
Evidence
New
go/internal/loadpoint/controller_cap_amps_test.go, run throughTick:cap_amps_per_phasecap_amps_per_phase missing.go vet ./...: clean.go test ./internal/... ./cmd/ftw/...: 60 packages ok, 0 failed (bundled drivers synced withscripts/sync-bundled-drivers.sh).go test ./internal/control/ -run TestSiteSimFieldMatrix: 340 cases, 29 fail an invariant (idle 23, own-raise 6), all known. That is the same count as master without this change.Limits
Pairing
floor(cap_amps_per_phase) >= 7. Without this Core it never boosts, which is the safe default. This PR changes nothing for drivers that ignore the field.drivers/BUNDLED_SOURCE.jsonpin must move for the bundled copy.Open PRs on the same files
controller.go,controller_fuse_budget.go,manual_limits.goandsnap.go. No textual overlap with these hunks is expected. After it lands,commandPhasescan return 2, and this field then divides by two phases, which is correct.controller.goandcontroller_fuse_budget.go. Its loadpoint hunks (capReason,tickFuseReason) are already on master. A rebase may touch the same deferred cleanup line inTickWithDispatch.go/internal/control. It can change the room this field reports, but not this code.Do not merge without Fredrik's explicit yes.
🤖 Generated with Claude Code