Skip to content

fix(easee_cloud): report a load-balancer limit while the car charges - #172

Draft
frahlg wants to merge 2 commits into
mainfrom
easee-load-balancer-reason
Draft

frahlg wants to merge 2 commits into
mainfrom
easee-load-balancer-reason

Conversation

@frahlg

@frahlg frahlg commented Oct 8, 2026 •

Copy link
Copy Markdown
Member

Problem

A tester on FTW v0.140.0-beta.1 (Easee Cloud, Pixii, 25 A three-phase fuse) saw "Asked for 11.0 kW, delivering 8.3 kW. The charger has not said why." The charger's load balancer had cut the car to about 12 A per phase while the battery charged 4.75 kW. FTW's requested current, the charger offer (observation 48) and the charger limit all read 16 A, so none of them showed the cut.

driver_poll drops any ReasonForNoCurrent while the charger reports charging above 100 W and the reason's timestamp is not newer than TotalPower's. Easee records an observation when its value changes. A load-balancing reason set when the limit began is older than the next power change, so the driver dropped it while the limit still held.

Change

  • While charging, keep an old reason if it is a load-balancing code and the per-phase current is at least 2 A below the offer. The offer is observation 48, or FTW's last write when 48 is missing. Every other old reason is still dropped while charging.
  • Emit current_limited_by = "load_balancer" for codes 1–5, 10 and 25–30 while a car is connected. Core reads this vendor-neutral name, not Easee's codes. Codes 77 and 78 are the charger's own limits, which Core already reads as device_limit_a and max_a; the car's codes are not the load balancer either.
  • Match the labels for codes 6, 8–11, 25–30 and 77 to Easee's published table. Code 28 read "fuse limit reached"; Easee calls it "Current limited by Equalizer".
  • Add current_limited_by to the EV keys in spec/host-api-profile.json and to the control feedback section of docs/WRITING-A-DRIVER.md. Add Easee's enumeration page to upstream_docs.
  • Bump easee_cloud 1.3.6 → 1.3.7. Current main is merged without changing this driver patch; later fixes to other drivers remain included.

What is confirmed and what is inferred

Confirmed from Easee's docs:

  • Enumerations defines 25–30 as "Current limited by circuit fuse / circuit max current / dynamic circuit current / Equalizer / circuit load balancing / offline settings", and 1–6 as load-balancing reasons for no current. The wording of 25–30 describes a reduced current, not zero. pyeasee uses the same table.
  • Observation 96 is described as "why a charger with a car connected is not offering current to the car".

Confirmed in this driver: the timestamp rule above drops any reason older than the last power change. Earlier hardware work confirmed that Easee keeps an unchanged TotalPower timestamp for minutes (#131).

Inferred, not seen: that Easee sends 25–30 while a car charges, and which code the tester's charger sent. No raw observations were captured from that site, and I have not seen a load-balanced Easee on hardware with this change. The 2 A gap is a judgement: a car may draw a little under the offer, and the per-phase current is derived from total power and one voltage.

Limits

  • The per-phase current uses the driver's committed phase count. A car charging on one phase while the driver holds 3Φ reads a third of its real current, so an old load-balancing reason would be kept. Core still requires a measured shortfall against its own command.
  • Observations 111–113 (dynamic circuit current) and 230–232 (Equalizer available current) would show the clamp directly. The driver does not read them yet; that needs a capture from a site that uses them.

Paired PR

srcfl/ftw#1537 moves the bundled driver pin to this branch's head and makes Core report load_balancer_limit as limited, with words in the UI. Merge this first, then move the FTW pin to the merge commit.

draft #159 also bumps easee_cloud to 1.3.7. It changes driver_command; this PR changes driver_poll. Whichever lands second needs 1.3.8.

Tests

  • drivers/tests/lua_harness/test_easee_cloud_load_balancer.lua with drivers/tests/test_easee_cloud_load_balancer.py: the reported case (16 A offer, 8.3 kW on three phases) keeps code 29 and reports the load balancer; codes 28 and 27 too; a car at the full offer, a gap under 2 A, an old non-balancing reason and an unknown offer drop it; FTW's last write stands in for a missing readback; a car held at zero by codes 2 or 5 is reported; 52, 100 and an unplugged charger are not. The test fails on main at its first assertion.
  • make test-driver ID=easee_cloud: 40 passed, 15 skipped.
  • make check: 4902 passed, 923 skipped.

🤖 Generated with Claude Code

Updated base — 20 October 2026

Merged main 5cc7bb1 into this branch without rewriting the original commit. The changelog keeps both histories. No charging command, phase or default-mode logic changed in this update.

On the updated tree: make test-driver ID=easee_cloud passed (40 passed, 15 skipped); make check passed (4984 passed, 936 skipped). The unsigned publication check against the current public drivers-beta manifest also passed using the public verifier from CI. No channel was signed or published.

This updates the base requested by stacked #183. Its power-ordering fix and #159's phase-flip change remain separate. The original hardware limitations above still apply; this is a source/CI update, not a hardware acceptance result.

Easee records ReasonForNoCurrent when it changes. The driver dropped any
reason older than the last power change while the car charged, so a
load-balancing limit that began earlier vanished and Core said the
charger had given no reason.

Keep a load-balancing reason while the measured per-phase current stays
at least 2 A below the offer, and tell Core with the vendor-neutral
current_limited_by = "load_balancer". Match the reason labels to
Easee's published table.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Signed-off-by: Fredrik Ahlgren <[email protected]>
frahlg added a commit that referenced this pull request Nov 24, 2026
…4.4) (#194)

* fix(easee_cloud): report Easee's load balancing below FTW's order (1.4.1)

A tester's trace (srcfl/ftw#1763, 23 Oct 2026) showed FTW ordering 15 A
and the charger reading back 15 A, while Easee's circuit allocation
(observations 70-72) and the current it signalled to the car (114) fell
to 12, 14 and 13 A. FTW said "Not following".

Read 70-72 and 114. Emit current_limit_a, the signalled current, while
the car charges and it is more than half an amp below the order the
charger holds (48), and only when it answers that order: recorded at or
after it, or unchanged for 30 s since. Emit current_limited_by =
"load_balancer" only when the allocation is below the order too and no
higher than the signalled current. ReasonForNoCurrent is not used as a
cause. Reason labels follow Easee's table (from #172).

Port the REST ordering check from #183: while a car is connected, a
reply whose power time goes back, conflicts at one instant or cannot be
read is not used. Times compare as instants across offsets. The order
starts again on disconnect or after 30 s of replies that go back, so a
stamp from the future cannot hold the driver silent.

Co-authored-by: Segran <[email protected]>
Co-Authored-By: Claude Opus 5.5 <[email protected]>
Signed-off-by: Fredrik Ahlgren <[email protected]>

* fix(easee_cloud): review fixes to the limit and the ordering check

- An unreadable power time no longer silences the driver for good:
  after 30 s of such replies they are used as they come, as before,
  until a readable time arrives.
- A late "disconnected" reply is held to the same order as any other.
- A failed poll ends a run of held-back replies, so a rejection before
  an outage does not count toward the 30 s.
- A held-back reply does not drop the session proof, which cost one of
  Easee's ten session checks an hour each time.
- Report a limit only while the charger reads back FTW's last order;
  do not name the load balancer when the charger's own static limit
  explains the pilot; a phase with no allocation is not one in use.
- Tests for each, all failing on the previous commit, plus the
  one-phase highest-allocation rule, a finished car, a pilot recorded
  in the same second as the order, and an impossible first date.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Signed-off-by: Fredrik Ahlgren <[email protected]>

* fix(easee_cloud): second review pass on the escape and one-phase cause

- A failed poll no longer restarts the 30 s count; a gap of more than
  30 s between held-back replies does. Occasional HTTP errors among
  unreadable replies kept the driver silent.
- Skip dropping the session proof only on a poll whose reply was held
  back, not whenever the count is running.
- A one-phase charger with no allocation on any phase does not name the
  load balancer.
- Tests: both cases, and no limit before FTW's first order.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Signed-off-by: Fredrik Ahlgren <[email protected]>

* fix(easee_cloud): keep the last limit while the car catches up

When Easee lets the car take the order again, the car needs a few
seconds to draw it and the cloud to report that. Core then saw no limit
and a car still below the order, and said "Not following" until the new
draw arrived. Keep the last limit for up to 20 s while the car charges
below the order. Test fails without it.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Signed-off-by: Fredrik Ahlgren <[email protected]>

* fix(easee_cloud): re-send the current limit as a command (1.4.2)

Easee puts its dynamic current back at its maximum on a resume or a
phaseMode write (32 A reported, #225). The settings write only reaches the
charger when the cloud's stored value changes, so re-sending the same order
as a setting never undid it: a 7 A order drew 16 A on a 16 A fuse. The
driver now re-sends its order as a set_dynamic_charger_current command 3 s
after a resume or start, after a phaseMode write, and whenever the charger
reports a higher limit or draws over the order (at most every 10 s).

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_0124SQZZwXFRjnTEvh4SNrjp
Signed-off-by: Erik <[email protected]>

* fix(easee_cloud): space failed re-sends and keep a failed cut (1.4.2)

A re-send that fails after a resume or phaseMode write is now retried every
10 s, not on every poll. When a lower order's settings write fails, re-sends
use that lower order, not the earlier, higher one. A 0 A order still goes out
as a 0 A command: it is the limit Easee's pause sets, and Easee accepted
every 0 A command on a real charger. The code and test now quote Easee's
documentation for minutes = 0: the limit holds until the next one.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_0124SQZZwXFRjnTEvh4SNrjp
Signed-off-by: Erik <[email protected]>

---------

Signed-off-by: Fredrik Ahlgren <[email protected]>
Signed-off-by: Segran <[email protected]>
Signed-off-by: Erik <[email protected]>
Co-authored-by: Segran <[email protected]>
Co-authored-by: Claude Opus 5.5 <[email protected]>
Co-authored-by: Erik <[email protected]>
frahlg added a commit that referenced this pull request Nov 24, 2026
)

* fix(easee_cloud): report Easee's load balancing below FTW's order (1.4.1)

A tester's trace (srcfl/ftw#1763, 23 Oct 2026) showed FTW ordering 15 A
and the charger reading back 15 A, while Easee's circuit allocation
(observations 70-72) and the current it signalled to the car (114) fell
to 12, 14 and 13 A. FTW said "Not following".

Read 70-72 and 114. Emit current_limit_a, the signalled current, while
the car charges and it is more than half an amp below the order the
charger holds (48), and only when it answers that order: recorded at or
after it, or unchanged for 30 s since. Emit current_limited_by =
"load_balancer" only when the allocation is below the order too and no
higher than the signalled current. ReasonForNoCurrent is not used as a
cause. Reason labels follow Easee's table (from #172).

Port the REST ordering check from #183: while a car is connected, a
reply whose power time goes back, conflicts at one instant or cannot be
read is not used. Times compare as instants across offsets. The order
starts again on disconnect or after 30 s of replies that go back, so a
stamp from the future cannot hold the driver silent.

Co-authored-by: Segran <[email protected]>
Co-Authored-By: Claude Opus 5.5 <[email protected]>
Signed-off-by: Fredrik Ahlgren <[email protected]>

* fix(easee_cloud): review fixes to the limit and the ordering check

- An unreadable power time no longer silences the driver for good:
  after 30 s of such replies they are used as they come, as before,
  until a readable time arrives.
- A late "disconnected" reply is held to the same order as any other.
- A failed poll ends a run of held-back replies, so a rejection before
  an outage does not count toward the 30 s.
- A held-back reply does not drop the session proof, which cost one of
  Easee's ten session checks an hour each time.
- Report a limit only while the charger reads back FTW's last order;
  do not name the load balancer when the charger's own static limit
  explains the pilot; a phase with no allocation is not one in use.
- Tests for each, all failing on the previous commit, plus the
  one-phase highest-allocation rule, a finished car, a pilot recorded
  in the same second as the order, and an impossible first date.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Signed-off-by: Fredrik Ahlgren <[email protected]>

* fix(easee_cloud): second review pass on the escape and one-phase cause

- A failed poll no longer restarts the 30 s count; a gap of more than
  30 s between held-back replies does. Occasional HTTP errors among
  unreadable replies kept the driver silent.
- Skip dropping the session proof only on a poll whose reply was held
  back, not whenever the count is running.
- A one-phase charger with no allocation on any phase does not name the
  load balancer.
- Tests: both cases, and no limit before FTW's first order.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Signed-off-by: Fredrik Ahlgren <[email protected]>

* fix(easee_cloud): keep the last limit while the car catches up

When Easee lets the car take the order again, the car needs a few
seconds to draw it and the cloud to report that. Core then saw no limit
and a car still below the order, and said "Not following" until the new
draw arrived. Keep the last limit for up to 20 s while the car charges
below the order. Test fails without it.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Signed-off-by: Fredrik Ahlgren <[email protected]>

* fix(easee_cloud): re-send the current limit as a command (1.4.2)

Easee puts its dynamic current back at its maximum on a resume or a
phaseMode write (32 A reported, #225). The settings write only reaches the
charger when the cloud's stored value changes, so re-sending the same order
as a setting never undid it: a 7 A order drew 16 A on a 16 A fuse. The
driver now re-sends its order as a set_dynamic_charger_current command 3 s
after a resume or start, after a phaseMode write, and whenever the charger
reports a higher limit or draws over the order (at most every 10 s).

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_0124SQZZwXFRjnTEvh4SNrjp
Signed-off-by: Erik <[email protected]>

* fix(easee_cloud): space failed re-sends and keep a failed cut (1.4.2)

A re-send that fails after a resume or phaseMode write is now retried every
10 s, not on every poll. When a lower order's settings write fails, re-sends
use that lower order, not the earlier, higher one. A 0 A order still goes out
as a 0 A command: it is the limit Easee's pause sets, and Easee accepted
every 0 A command on a real charger. The code and test now quote Easee's
documentation for minutes = 0: the limit holds until the next one.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_0124SQZZwXFRjnTEvh4SNrjp
Signed-off-by: Erik <[email protected]>

* fix(easee_cloud): report when load balancing holds a start (1.4.4)

Easee's Equalizer can hold a start for up to 15 minutes after household
use falls (Easee support, srcfl/ftw#1948). The car then draws nothing
while the charger reads back FTW's order, and Core reported a failed start.

While the car draws nothing and the charger holds an order of at least
6 A, report current_limit_a as the current the load balancing allows and
current_limited_by = "load_balancer" when that is below 6 A. Evidence is
the allocation on all three phases (70-72), or else a reason in which
Easee names the Equalizer (10 or 28), recorded in the charger's current
state. Reason 78 is not evidence: FTW writes that setting too.

Refs srcfl/ftw#1948. Stacked on #194.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Signed-off-by: Fredrik Ahlgren <[email protected]>

---------

Signed-off-by: Fredrik Ahlgren <[email protected]>
Signed-off-by: Segran <[email protected]>
Signed-off-by: Erik <[email protected]>
Co-authored-by: Segran <[email protected]>
Co-authored-by: Claude Opus 5.5 <[email protected]>
Co-authored-by: Erik <[email protected]>
frahlg added a commit that referenced this pull request Nov 24, 2026
…0) (#200)

* fix(easee_cloud): report Easee's load balancing below FTW's order (1.4.1)

A tester's trace (srcfl/ftw#1763, 23 Oct 2026) showed FTW ordering 15 A
and the charger reading back 15 A, while Easee's circuit allocation
(observations 70-72) and the current it signalled to the car (114) fell
to 12, 14 and 13 A. FTW said "Not following".

Read 70-72 and 114. Emit current_limit_a, the signalled current, while
the car charges and it is more than half an amp below the order the
charger holds (48), and only when it answers that order: recorded at or
after it, or unchanged for 30 s since. Emit current_limited_by =
"load_balancer" only when the allocation is below the order too and no
higher than the signalled current. ReasonForNoCurrent is not used as a
cause. Reason labels follow Easee's table (from #172).

Port the REST ordering check from #183: while a car is connected, a
reply whose power time goes back, conflicts at one instant or cannot be
read is not used. Times compare as instants across offsets. The order
starts again on disconnect or after 30 s of replies that go back, so a
stamp from the future cannot hold the driver silent.

Co-authored-by: Segran <[email protected]>
Co-Authored-By: Claude Opus 5.5 <[email protected]>
Signed-off-by: Fredrik Ahlgren <[email protected]>

* fix(easee_cloud): review fixes to the limit and the ordering check

- An unreadable power time no longer silences the driver for good:
  after 30 s of such replies they are used as they come, as before,
  until a readable time arrives.
- A late "disconnected" reply is held to the same order as any other.
- A failed poll ends a run of held-back replies, so a rejection before
  an outage does not count toward the 30 s.
- A held-back reply does not drop the session proof, which cost one of
  Easee's ten session checks an hour each time.
- Report a limit only while the charger reads back FTW's last order;
  do not name the load balancer when the charger's own static limit
  explains the pilot; a phase with no allocation is not one in use.
- Tests for each, all failing on the previous commit, plus the
  one-phase highest-allocation rule, a finished car, a pilot recorded
  in the same second as the order, and an impossible first date.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Signed-off-by: Fredrik Ahlgren <[email protected]>

* fix(easee_cloud): second review pass on the escape and one-phase cause

- A failed poll no longer restarts the 30 s count; a gap of more than
  30 s between held-back replies does. Occasional HTTP errors among
  unreadable replies kept the driver silent.
- Skip dropping the session proof only on a poll whose reply was held
  back, not whenever the count is running.
- A one-phase charger with no allocation on any phase does not name the
  load balancer.
- Tests: both cases, and no limit before FTW's first order.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Signed-off-by: Fredrik Ahlgren <[email protected]>

* fix(easee_cloud): keep the last limit while the car catches up

When Easee lets the car take the order again, the car needs a few
seconds to draw it and the cloud to report that. Core then saw no limit
and a car still below the order, and said "Not following" until the new
draw arrived. Keep the last limit for up to 20 s while the car charges
below the order. Test fails without it.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Signed-off-by: Fredrik Ahlgren <[email protected]>

* feat(easee_cloud): expose separately confirmed pilot current (1.5.0)

Pair fresh per-observation pilot evidence with Core feedback for srcfl/ftw#1874.

Signed-off-by: Segran <[email protected]>

* fix(easee_cloud): re-send the current limit as a command (1.4.2)

Easee puts its dynamic current back at its maximum on a resume or a
phaseMode write (32 A reported, #225). The settings write only reaches the
charger when the cloud's stored value changes, so re-sending the same order
as a setting never undid it: a 7 A order drew 16 A on a 16 A fuse. The
driver now re-sends its order as a set_dynamic_charger_current command 3 s
after a resume or start, after a phaseMode write, and whenever the charger
reports a higher limit or draws over the order (at most every 10 s).

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_0124SQZZwXFRjnTEvh4SNrjp
Signed-off-by: Erik <[email protected]>

* fix(easee_cloud): space failed re-sends and keep a failed cut (1.4.2)

A re-send that fails after a resume or phaseMode write is now retried every
10 s, not on every poll. When a lower order's settings write fails, re-sends
use that lower order, not the earlier, higher one. A 0 A order still goes out
as a 0 A command: it is the limit Easee's pause sets, and Easee accepted
every 0 A command on a real charger. The code and test now quote Easee's
documentation for minutes = 0: the limit holds until the next one.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_0124SQZZwXFRjnTEvh4SNrjp
Signed-off-by: Erik <[email protected]>

* fix(easee_cloud): report when load balancing holds a start (1.4.4)

Easee's Equalizer can hold a start for up to 15 minutes after household
use falls (Easee support, srcfl/ftw#1948). The car then draws nothing
while the charger reads back FTW's order, and Core reported a failed start.

While the car draws nothing and the charger holds an order of at least
6 A, report current_limit_a as the current the load balancing allows and
current_limited_by = "load_balancer" when that is below 6 A. Evidence is
the allocation on all three phases (70-72), or else a reason in which
Easee names the Equalizer (10 or 28), recorded in the charger's current
state. Reason 78 is not evidence: FTW writes that setting too.

Refs srcfl/ftw#1948. Stacked on #194.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Signed-off-by: Fredrik Ahlgren <[email protected]>

---------

Signed-off-by: Fredrik Ahlgren <[email protected]>
Signed-off-by: Segran <[email protected]>
Signed-off-by: Erik <[email protected]>
Co-authored-by: Fredrik Ahlgren <[email protected]>
Co-authored-by: Claude Opus 5.5 <[email protected]>
Co-authored-by: Erik <[email protected]>

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant