Repository navigation
fix(easee_cloud): re-send the current limit as a command (1.4.2) - #227
erikarenhill wants to merge 2 commits into
Conversation
Easee puts its dynamic current back at its maximum on a resume or a phaseMode write (32 A reported, srcfl#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 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_0124SQZZwXFRjnTEvh4SNrjp Signed-off-by: Erik <758402+erikarenhill@users.noreply.github.com>
frahlg
left a comment
There was a problem hiding this comment.
Reviewed, and make test-driver ID=easee_cloud passes (43 passed, 15 skipped; the new resend test fails on 1.4.1). Sending the order as set_dynamic_charger_current is the right answer to the 32 A reset in #225, and the hardware evidence is clear. Two things before merge:
- 0 A as a command.
last_amps_setcan be 0 after a pause or the default mode.ev_resume, the resend after a resume and the poll trigger would then sendamps = 0through the command endpoint. Easee does not document 0 there; if it is refused, the poll trigger logs a warning every 10 s. Please send only whenlast_amps_set > 0, or test and document 0. - Unthrottled retry.
pending_amp_resendis retried on every poll while the command endpoint errors. Please space the retries (for example withREASSERT_MS) and add a test where the command fails.
Lower, not blocking: after Core lowers an order, Easee's echo of observation 48 lags, so the trigger re-sends every 10 s until it catches up (harmless, a few extra commands while orders change); and a failed lowering write leaves last_amps_set at the earlier order, which a re-send would repeat.
Order: this should merge before #194. #194 then takes 1.4.3, and its poll fixtures need timestamp= on observation 120 for test_easee_cloud_resend.lua to pass with #194's stamped-power rule.
frahlg
left a comment
There was a problem hiding this comment.
Claude's review, posted at Fredrik's request.
The fix looks right, and it matters: a 7 A order that draws 16 A on a 16 A fuse is a safety problem, and a settings write of an unchanged value cannot undo Easee's reset.
Before merge:
- CI has not run on this PR. It comes from a fork, so the workflows wait for approval.
- Six other open PRs change
easee_cloud.lua(#159, #172, #183, #189, #194, #200), so the version and CHANGELOG need a rebase that depends on merge order.
Two questions:
- What does
minutes: 0mean to Easee? The description says the limit holds until the next one; the test's assert message says "command limit expires". If 0 means no expiry, the message should say so; if it means something else, the command needs another value. - With a 0 A order (
driver_default_modesetslast_amps_set = 0), a connected charger that reports a higher dynamic limit gets a 0 A command every 10 s until the limit reads 0. That is probably what we want, but a test line would pin it down.
After merge, Core's pinned driver bundle has to move for this to reach the boxes.
miravoss26
left a comment
There was a problem hiding this comment.
Re-sends the current limit as set_dynamic_charger_current (minutes: 0) 3 s after resume/start/phaseMode write, and whenever the charger allows more than ordered (+0.5 A) or draws more than 2 A over, at most every 10 s. Fixes the settings-endpoint no-op when the cloud's stored value equals our order (#225).
- Version bumped consistently (lua, manifest, devices.yaml, index, CHANGELOG, support status). Tests added for the resend and start-boost paths. CI green.
now,dyn_current,connectedandchargingare all defined before the new block, and the 10 s throttle is stamped before the call, so a failing endpoint won't hammer Easee's API.- Question, not a blocker:
minutes = 0is described as hold until the next limit. Is that confirmed against Easee's docs or observed on a real charger? The fix depends on it. - Security: no new hosts, no secrets, error text goes through
redact_http_err.
Safe to merge from my read, pending your answer on minutes = 0.
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 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_0124SQZZwXFRjnTEvh4SNrjp Signed-off-by: Erik <758402+erikarenhill@users.noreply.github.com>
66448d7 to
9e8205a
Compare
|
Thanks for the reviews. Addressed in 9e8205a. Still 1.4.2: 1. 0 A as a command. I took the "test and document 0" option. 0 A is the limit Easee's own pause sets: 2. Unthrottled retry. Fixed: a failed re-send is retried after Failed lowering write. Fixed as well: when the settings write of a lower order fails, Echo lag after a lowering. Left as is. On the test site it costs one extra command per lowering. For example,
CI and order. No checks have reported on this fork PR, so the workflows probably need a maintainer's approval. Locally, |
Summary
Easee puts its dynamic current back at its maximum when charging resumes. Observation 48 reads 32 A, as traced in #225. The driver re-sent its order through the
settingsendpoint, which "will only forward commands to device if new value != old value" (charger_setchargersetting). Since the cloud still stored our order, the re-send never reached the charger, and the 32 A stuck.On a 3×16 A site a 7 A order drew 16 A (L2 at 24.2 A for about 10 s) until FTW's hard limit cut the charger to 0 A. The following resume drew 16 A again. That site's FTW logged about 15
fuse_over_limitnotifications since 31 Oct, mostly at night.This version re-sends the order as
set_dynamic_charger_currentwithminutes: 0, which Easee documents as "a limit being applied until another one is set". A command always reaches the charger.3 s after a successful
resume_charging(auto-resume orev_resume) orstart_charging, using the existingpending_amp_resendpath.The phaseMode re-assert now uses the command too, so the reset that path guards against is undone.
In
driver_poll, when the charger reports a dynamic limit above the order, or draws more than 2 A over it, the order goes out as a command, at most every 10 s. This catches a reset whatever caused it.A re-send that fails is retried every 10 s, not on every poll.
A 0 A order is re-sent as a 0 A command. That is the limit Easee's pause sets ("Limits dynamic charger current to 0", charger_pausesession).
When a lower order's settings write fails, re-sends use that lower order, not the earlier, higher one.
Normal orders still use the settings write, so the request rate does not change.
Driver evidence
easee_cloud1.4.1 → 1.4.2maxChargerCurrent16 A, phaseMode 3, Tesla Model 3charger allows 32 A / draws 0.009 A over our 12 A order; re-sent it as a command, and the car settled at 12 A.fuse_over_limitevents.resume_charging"Resets output current limit set in dynamic charger current" (charger_resumesession), as the traces in easee_cloud: trace dynamic current around phase mode changes #225 and this site show.Safety
Control evidence
Overlap
Open PRs #200, #194, #189, #183, #172 and #159 also change
easee_cloud.lua. None re-sends the limit as a command; #183's notes describe the same 32 A report "despite the 6 A offer and reassertion". This is based onmain(1.4.1), so the version and CHANGELOG may need a rebase depending on merge order.Checks
Signed-off-by.make test-driver ID=easee_cloud: 43 passed, 15 skipped. The newtest_easee_cloud_resendfails on 1.4.1 ("no 7 A command after a resume") and passes here. Its later cases fail without the follow-up commit: "retried a failed re-send within 10 s", and, without the failed-cut change, "a failed cut to 8 A re-sent 12 A".make check: 5091 passed, 951 skipped.Performance: normal polls do not change; at most one extra HTTP command per 10 s, and only while the charger exceeds the order. A failing re-send now costs one request per 10 s instead of one per poll.
make test-driver ID=easee_cloud, three runs each on the same machine: 0.29–0.32 s before the follow-up, 0.29–0.30 s after.🤖 Generated with Claude Code
https://claude.ai/code/session_0124SQZZwXFRjnTEvh4SNrjp