Skip to content

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

Open
frahlg wants to merge 1 commit into
easee-allocated-limitfrom
easee-load-balancer-start-hold
Open

frahlg wants to merge 1 commit into
easee-allocated-limitfrom
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.1) #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

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 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.

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.

2 participants