Skip to content

fix(easee_cloud): report 0 W for a charger with no car (1.5.1) - #290

Merged
frahlg merged 1 commit into
mainfrom
289-easee-idle-power
Nov 30, 2026
Merged

frahlg merged 1 commit into
mainfrom
289-easee-idle-power

Conversation

@frahlg

@frahlg frahlg commented Nov 30, 2026

Copy link
Copy Markdown
Member

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 unknown
for 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 ev emit only. note_observation and the
ordering checks from #183 are unchanged.

What a disconnected charger emits

Field Before After
w 0 0
control_power_available false true
control_power_confirmed false true
control_power_observed_at absent op_mode's source time (stays the same while the charger stays disconnected)
power_observed_at absent absent
power_max_age_s 180 180
is_online true true

If op_mode's source time is missing or cannot be read, power stays unknown,
as before.

How Core reads it

  • ControlPowerObservation accepts the sample: 0 W is finite, op_mode's time
    is not after the receive time, and with control_power_confirmed the
    sample 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_at stays out, as for any unchanged value. Core reads it
    only in currentEVSample for the plugged-in loadpoint; without it Core
    times the reading by when it arrived. Its power flag comes from
    ControlPowerObservation, so it is known too. The loadpoint ignores power
    from a charger with no car.
  • forecast_power is OCPP only. A Lua reading without it keeps Core's
    receive-time rule, so this change needs nothing there.

What stays the same

Driver evidence

  • Driver id: easee_cloud 1.5.0 → 1.5.1
  • Device make/model: Easee Home
  • Firmware tested: not recorded
  • Protocol/register source: Easee observation ids 109 (op_mode) and 120
    (TotalPower), developer.easee.com/docs/charger-observation-ids
  • Hardware test performed: not yet. The field evidence of the bug comes from
    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.
  • Known limits: the 0 W rests on op_mode alone, which Easee records only when
    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

  • A driver that can command its device has control on, or says in its description why it cannot.
  • Vendor signs are converted at the driver boundary.
  • Cached telemetry becomes stale instead of being re-emitted as fresh. The 0 W goes out only with a read the driver vouches for; without one the driver emits nothing, as before.
  • No credentials, serial numbers, private addresses or site data are included.

Control evidence

  • Hardware evidence, or not yet (the path stays experimental): not
    applicable. No command, write or default-mode path changes; only the power
    fields Core uses to judge a disconnected charger.
  • Control changes include default-mode, refused-write and harness test evidence. (Not applicable.)

Tests

  • New drivers/tests/lua_harness/test_easee_cloud_idle_power.lua, run by
    drivers/tests/test_easee_cloud_idle_power.py:
    1. Start with op_mode 1 and no TotalPower: 0 W known, at op_mode's time,
      unchanged on the next poll. An unreadable op_mode time leaves power
      unknown.
    2. Charging, then disconnect, with the old TotalPower still in the cloud's
      reply: 0 W known, at the disconnect's time.
    3. Reconnect and charge: real power with its own time; older power and a
      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 only
    op_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

  • Commits include Signed-off-by.
  • make test-driver ID=easee_cloud: 48 passed, 15 skipped (stream types
    this 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 new
version.

🤖 Generated with Claude Code

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>
@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Nov 30, 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-30T11:59:19.129307Z 62d6589 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.

@frahlg
frahlg merged commit f7102be into main Nov 30, 2026
5 checks passed
@frahlg
frahlg deleted the 289-easee-idle-power branch November 30, 2026 11:58
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.

easee_cloud: power unknown while no car is plugged in

1 participant