Skip to content

fix(easee_cloud): report when load balancing holds a start (1.4.5) - #236

Merged
frahlg merged 13 commits into
mainfrom
easee-load-balancer-start-hold
Nov 24, 2026
Merged

frahlg merged 13 commits into
mainfrom
easee-load-balancer-start-hold

Conversation

@frahlg

@frahlg frahlg commented Nov 18, 2026

Copy link
Copy Markdown
Member

Problem

Göran's Easee with an Equalizer holds some starts for 10–14 minutes (srcfl/ftw#1948). FTW orders a positive current, the charger reads it back (observation 48), the pilot is 0 A and the car draws nothing. On 12 November his journal showed 12 A ordered and read back, 0 A pilot and 0 A allocated on all three phases (observations 70–72), with reason 78. Easee support, in his translation on #1948, says the Equalizer lowers the current at once, raises it again up to 15 minutes after household use falls, and needs at least 6 A on each phase for a three-phase start.

#194 reports Easee's load balancing below FTW's order only while the car charges. Its test 4 says a zero pilot gives no limit. So Core cannot tell a held start from a failed one, and reports a failed start after two minutes.

Change

easee_cloud 1.4.3 → 1.4.4, stacked on #194 (easee-allocated-limit).

While the car draws nothing (mode 2, 3 or 6, the car asking, under 100 W) and the charger reads back FTW's order of at least 6 A, the driver reports current_limit_a = the current the load balancing allows and current_limited_by = "load_balancer" when that current is below 6 A. The evidence, both under #194's rule that a value must answer the order:

Not evidence: reason 78 ("limited by dynamic charger current"), since FTW writes that setting too; 27 and the other circuit codes, which do not name the Equalizer. An allocation of 6 A or more outweighs a reason.

The hold does not update #194's 20 s release memory, so it never lingers as a charging limit once the car draws. docs/WRITING-A-DRIVER.md describes the start hold.

Note on labels: main labels 25–30 as Equalizer codes. Easee's table says only 10 and 28 name the Equalizer. #194 already corrects the labels, so this PR builds on its table.

Paired Core change

srcfl/ftw#2050 reads this report. It waits up to 15 minutes from the first zero reading under positive orders, then reports the start as failed, as it does today. A Core without that PR treats a zero limit as before.

Order

Stacked on #194, which has right of way. #200 (segran2) is stacked on #194 too and touches answering(); this change only adds a function and calls it after #194's limit block, so a rebase either way should be small. If #194 merges first, please merge it without deleting its branch, then retarget this PR to main. Version numbers depend on merge order (#227 1.4.2, #194 1.4.3, #200 1.5.0).

Evidence

  • make test-driver ID=easee_cloud: 44 passed, 15 skipped.
  • make check: 5092 passed, 951 skipped.
  • New harness section 8 in test_easee_cloud_allocated_limit.lua, modelled on the 12 November trace: 0, 4 A and one phase short of 6 A are held; allocation back, one-phase wiring at 12 A, reasons 78 and 27, an old Equalizer reason, a finished or faulted charger, a car not asking, a car that draws, another readback, FTW's own order below 6 A and FTW's pause are not. An allocation older than a new order counts only after 30 s. Section 4's two zero-pilot cases now expect the hold. The new cases fail on fix(easee_cloud): report Easee's load balancing below FTW's order (1.4.4) #194's driver.
  • No hardware run yet. Göran's collector on the Pi records allocation, pilot and draw around the next delayed start; that trace is the hardware check.

Refs srcfl/ftw#1948

🤖 Generated with Claude Code

frahlg and others added 9 commits October 25, 2026 19:11
…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]>
- 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]>
- 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]>
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]>
Update #194 against main and fix one-phase limit attribution
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]>
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]>
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]>
@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Nov 18, 2026 •

Copy link
Copy Markdown
Codex Review Summary: ✅ Completed

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review ✅ Completed 2026-11-18T16:17:25.131800Z 092c357 PR opened
ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 092c35745e

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread drivers/lua/easee_cloud.lua Outdated
Comment on lines +909 to +910
if reason and EQUALIZER_REASONS[reason] and not (reason_at and state_at and reason_at < state_at) then
return 0

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 Badge Require comparable timestamps before accepting an Equalizer reason

When either the reason timestamp or charger-state timestamp is missing or invalid, this condition accepts the Equalizer reason without proving that it belongs to the current state. After the order settles for 30 seconds, answering() also accepts an old or untimestamped reason. In the Lua harness, removing the state timestamp lets the explicitly rejected old reason 10 produce current_limit_a = 0 and current_limited_by = "load_balancer". This can misclassify a failed start as a load-balancing hold and prolong the failure timeout. Require both timestamps to be comparable and the reason to be no older than the state before using this fallback, consistent with the stale-telemetry rule in AGENTS.md.

AGENTS.md reference: AGENTS.md:L75-L75

Useful? React with 👍 / 👎.

@miravoss26 miravoss26 left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

easee_cloud 1.4.4: while the car draws nothing and the charger holds an order of at least 6 A, the driver reports current_limit_a = the circuit allocation and current_limited_by = "load_balancer" when that is below 6 A. Evidence is the allocation on all three phases, else an Equalizer reason (10/28); reason 78 is deliberately excluded since FTW writes it.

  • Security screen: nothing found. No new network calls, secrets, or deps; Lua only.
  • Logic reads right: one-phase takes the highest phase, three-phase the lowest nonzero, stale reasons are ignored, and an allocation older than the order only counts after 30 s. The harness covers those cases.
  • Behaviour change worth knowing: two existing expectations flipped from nil to 0, "load_balancer" (zero pilot / waiting to start with a 0 A allocation). That is intended per the changelog, but Core now treats those as a wait rather than a fault.
  • Question (low): index.yaml / manifest sha256 + size were updated by hand or by tooling? I did not recompute the hash.

Safe to merge from my read, assuming the hash matches the built driver.

@miravoss26 miravoss26 left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Correction to my review above: I said safe to merge without checking CI first. signed channel accepts this tree is red: "heishamon: changed artifact needs a higher version than 0.8.1 (published)". That is about heishamon, which this diff does not touch (it only bumps easee_cloud), so the tree this branch is based on or merges into probably carries a heishamon change that needs make bump-driver ID=heishamon LEVEL=patch. Worth a rebase and re-run to see whose it is. My read of the easee_cloud change stands, but it is not mergeable until that check is green.

#183 landed as 1.4.2 and requires a source time on power, so the
re-send harness now stamps its power readings.

Signed-off-by: Fredrik Ahlgren <[email protected]>
Main now orders power with #183's watermark (1.4.2), so this branch drops
its own REST reply ordering and keeps the allocation and pilot reporting.
The start-boost rejection tests from this branch stay, on main's harness.

Signed-off-by: Fredrik Ahlgren <[email protected]>
An Equalizer reason now counts only when it and the charger state both
carry a readable source time (Codex P2 on #236), with a harness case past
the 30 s order settle.

Signed-off-by: Fredrik Ahlgren <[email protected]>
Base automatically changed from easee-allocated-limit to main November 24, 2026 15:46
@frahlg
frahlg changed the base branch from easee-allocated-limit to main November 24, 2026 15:46
Main carries #194 as a squash of the branch already merged here.

Signed-off-by: Fredrik Ahlgren <[email protected]>
@frahlg frahlg changed the title fix(easee_cloud): report when load balancing holds a start (1.4.4) fix(easee_cloud): report when load balancing holds a start (1.4.5) Nov 24, 2026
@frahlg
frahlg merged commit 11bdcfa into main Nov 24, 2026
5 checks passed
@frahlg
frahlg deleted the easee-load-balancer-start-hold branch November 24, 2026 15:50
frahlg added a commit to segran2/device-drivers that referenced this pull request Nov 24, 2026
Main carries srcfl#194 and srcfl#236 as squashes of the branches already merged here.

Signed-off-by: Fredrik Ahlgren <[email protected]>
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.

4 participants