Repository navigation
fix(easee_cloud): report 0 W for a charger with no car (1.5.1) - #290
Merged
Merged
Conversation
Since 1.4.2 (#183) op_mode 1 clears TotalPower, and Easee's cloud records TotalPower only when it changes, which needs a car. After every driver start with no car, the ev sample said control_power_available=false until a car was plugged in. FTW Core then marked the EV flow unknown_power and lost Home use for those hours. When a read the driver vouches for shows op_mode 1, the charger is online and has no car, so it draws nothing. The ev sample now carries 0 W as known and confirmed, with op_mode's source time as control_power_observed_at. power_observed_at stays out, as for any unchanged value. TotalPower still cannot be noted while op_mode is 1, and the ordering checks from #183 still apply once a car is connected. Closes #289 Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Signed-off-by: Fredrik Ahlgren <fredrik@sourceful-labs.com>
Codex Review Summary: ✅ CompletedThis 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. |
This was referenced Nov 30, 2026
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.
Summary
Fixes #289. Since #183 (1.4.2), an Easee charger with no car reports its
power as unknown after every driver start, until a car is plugged in. Every
FTW Core update restarts the driver. Core then marks the EV flow
unknown_power:easee:ev, and Home use (grid − PV − battery − EV) is unknownfor those hours. On Fredrik's box this cost Home use in history on 25, 27 and
28 November, and the day's saving went negative.
The cause: noting op_mode 1 clears TotalPower, and TotalPower is ignored
while op_mode is 1. Easee's cloud records TotalPower only when it changes,
which needs a car, so none arrives.
The fix: when a read the driver vouches for shows op_mode 1, the charger is
online (op_mode 0 is already refused) and has no car, so it draws nothing.
The driver now reports that 0 W as known and confirmed, timed by op_mode's
source time. The change is in the
evemit only.note_observationand theordering checks from #183 are unchanged.
What a disconnected charger emits
w00control_power_availablefalsetruecontrol_power_confirmedfalsetruecontrol_power_observed_atpower_observed_atpower_max_age_s180180is_onlinetruetrueIf op_mode's source time is missing or cannot be read, power stays unknown,
as before.
How Core reads it
ControlPowerObservationaccepts the sample: 0 W is finite, op_mode's timeis not after the receive time, and with
control_power_confirmedthesample counts as seen when it arrives, well inside 180 s. The live Home use
and the history sources both go through this check (
LiveMeasurementNow).power_observed_atstays out, as for any unchanged value. Core reads itonly in
currentEVSamplefor the plugged-in loadpoint; without it Coretimes the reading by when it arrived. Its power flag comes from
ControlPowerObservation, so it is known too. The loadpoint ignores powerfrom a charger with no car.
forecast_poweris OCPP only. A Lua reading without it keeps Core'sreceive-time rule, so this change needs nothing there.
What stays the same
holds from before the disconnect cannot pass as current.
or conflicting power is refused as in fix(easee_cloud): reject out-of-order power observations #183.
Driver evidence
easee_cloud1.5.0 → 1.5.1(TotalPower), developer.easee.com/docs/charger-observation-ids
Fredrik's box on FTW v0.174.0-beta.1 (easee_cloud: power unknown while no car is plugged in #289). Hardware evidence of the fix
will come from the same box once FTW's bundle pin moves to this commit.
This PR does not move the pin.
it changes. A read the driver vouches for (REST in this poll, or the stream
with a REST read in the last 90 s) shows that the cloud still hears the
charger.
Safety
Control evidence
not yet(the path staysexperimental): notapplicable. No command, write or default-mode path changes; only the power
fields Core uses to judge a disconnected charger.
Tests
drivers/tests/lua_harness/test_easee_cloud_idle_power.lua, run bydrivers/tests/test_easee_cloud_idle_power.py:unchanged on the next poll. An unreadable op_mode time leaves power
unknown.
reply: 0 W known, at the disconnect's time.
conflicting value at the same time are refused; newer power is taken.
The test fails on 1.5.0 ("start with no car: 0 W not known") and passes
on 1.5.1.
test_easee_cloud_stream.lua: case 10 asserted that a REST reply with onlyop_mode 1 left power unknown. It now asserts the known 0 W at op_mode's
time; the check that omitted ids do not keep old values is unchanged. A new
case covers a pushed disconnect, then pushed power after a reconnect.
Checks
Signed-off-by.make test-driver ID=easee_cloud: 48 passed, 15 skipped (stream typesthis driver does not emit).
make check: 5570 passed, 927 skipped.Run locally. The older draft PRs #159, #172 and #189 also touch
easee_cloud.lua; whichever merges second will need a rebase and a newversion.
🤖 Generated with Claude Code