fix(easee_cloud): stop reporting an old change time for steady power - #131
Merged
Merged
Conversation
Codex Review SummaryThis 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. |
Easee records TotalPower (observation 120) only when it changes. The driver passed that timestamp as power_observed_at, so a car charging at a steady current reported power that looked older and older although every 5 s poll confirmed it. FTW treats a non-zero reading older than power_max_age_s (180 s) as stale; on the owner's box it stood the charger down about every three minutes all night (srcfl/ftw#1417). An unchanged value now omits power_observed_at, so the host stamps the reading when it arrives. A new value keeps Easee's source time, and an offline charger still emits no sample. No clock arithmetic: the 32-bit Lua harness cannot hold epoch milliseconds exactly. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01MuerPFZFG88kgu8sWVHeq7 Signed-off-by: Fredrik Ahlgren <fredrik@sourceful-labs.com>
frahlg
force-pushed
the
fix/easee-power-confirmed-at
branch
from
September 25, 2026 04:46
b4d4d18 to
d0ea619
Compare
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.
Problem
Easee records an observation only when its value changes.
easee_cloud.luapassed observation 120's timestamp (TotalPower) aspower_observed_at. So while a car charged at a steady current, the reported power looked older and older, although every 5-second poll confirmed it. The old comment assumed updates at least every two minutes; the owner's box showed power unchanged for up to 5.5 minutes.FTW treats a non-zero power reading older than
power_max_age_s(180 s) as stale, and until srcfl/ftw#1417 it stood the charger down to 0 A. On the owner's home box (Tesla, Easee Home) that produced 31 stops overnight; 23 of them came 170–190 s after the last power change.Change (
easee_cloud1.3.2 → 1.3.3)power_observed_at. FTW then stamps the reading when it arrives (ev_observation.go:PowerAt = r.UpdatedAtwhen the field is absent).get_observationsfail, and the driver emits no sample.LUA_32BITS) cannot hold epoch milliseconds exactly. A first attempt that formattedhost.millis()as ISO time was 42 s off there.make check, and there is a CHANGELOG entry.This changes telemetry timing, not control commands.
Tests
drivers/tests/lua_harness/test_easee_cloud_power_time.lua, run bytest_easee_cloud_power_time.py:test_easee_cloud_session.lua: unchanged and passing. Its assertion on the first poll's source time still holds.make test-driver ID=easee_cloud: 38 passed.make check: passes, with 88 manifests checked and 0 errors.FTW needs a pin move afterwards to bundle 1.3.3.
🤖 Generated with Claude Code
https://claude.ai/code/session_01MuerPFZFG88kgu8sWVHeq7