Skip to content

fix(easee_cloud): resume a phase flip only after a valid stop poll - #159

Draft
erikarenhill wants to merge 3 commits into
srcfl:mainfrom
erikarenhill:fix/easee-phase-flip-resume-delay
Draft

erikarenhill wants to merge 3 commits into
srcfl:mainfrom
erikarenhill:fix/easee-phase-flip-resume-delay

Conversation

@erikarenhill

@erikarenhill erikarenhill commented Oct 4, 2026 •

Copy link
Copy Markdown

Problem

Easee applies a new phaseMode only when a session restarts. Since the 2026-05-30 fix, the driver handles a mid-session 1Φ↔3Φ flip with pause → write phaseMode → resume, all inside one ev_set_current. On real hardware the resume arrived about 340 ms after the pause:

08:25:04.614 Easee: pause to flip phaseMode 1→3
08:25:04.741 Easee: phaseMode → 3
08:25:04.952 Easee: auto-resumed after pause (offer=7 A)

The cloud queues commands, so the resume reached the charger before the contactor opened. The session went on at the old phase count. Core then offered about 15–16 A per phase on 3Φ, but the car drew a flat ~3.55 kW (15 A on one phase) for about 3.5 hours. Pausing and resuming manually in the Easee app moved it to 3Φ immediately, at about 9–11 kW.

A flip made while the car was idle worked the same morning, because the next session started on the new phase count.

Change

  • After pausing a phase flip, wait for a later valid poll that reports charging has stopped. The next non-zero ev_set_current offer then resumes charging.
  • A failed poll clears the stop observation. Offline or unreadable state cannot leave an old stop observation valid.
  • An explicit ev_start, ev_pause or ev_resume clears the wait after the command succeeds.
  • The phase decision, 90 s phase hold, current limits and post-flip current reassertion stay the same.
  • Bump easee_cloud from 1.3.6 to 1.3.7 and refresh the manifest hash and catalog.

Tests

  • The phase-flip harness checks: no pause on the first phase command, no immediate resume on a later phase flip, no resume while still charging, invalidation after offline or malformed polls, and one resume after a valid stop poll.
  • Additional local checks cover no stop poll, an offline poll and a failed resume followed by a successful retry.
  • make test-driver ID=easee_cloud: 39 passed, 15 skipped on the Cursor head.
  • make check: 4810 passed, 923 skipped on 9d67fab, rebased onto current main after the other driver PRs merged.
  • Maintainer sign-off is present on every PR commit.

Hardware

  • Device: Easee Home via the cloud API; vehicle: Tesla.
  • The failure above was observed on FTW v3.5.0-beta.1, bundled easee_cloud 1.3.1, whose driver_command is identical to 1.3.6.
  • Not yet verified on hardware with this change. Draft until a mid-session 1Φ→3Φ flip is seen to move the car onto 3Φ with no manual step.

🤖 Generated with Claude Code

https://claude.ai/code/session_01766Rey7C5yDqY8qnnc92SA

@frahlg frahlg changed the title fix(easee_cloud): wait before resuming a mid-session phase flip fix(easee_cloud): resume a phase flip only after a valid stop poll Oct 4, 2026
erikarenhill and others added 3 commits October 4, 2026 18:28
Easee applies a new phaseMode only when the session restarts. The
driver paused, wrote phaseMode and resumed inside one ev_set_current,
about 0.3 s apart. The cloud queues commands, so the resume reached the
charger before the contactor opened and the session kept its phase
count. On an Easee Home with a Tesla, phaseMode=3 was written mid-session
and the car drew 15 A on one phase for hours until the owner paused and
resumed in the Easee app.

Hold the auto-resume for 15 s after a flip pause. The host's following
ev_set_current ticks resume once the delay has passed. An explicit
ev_pause or ev_resume clears the delay.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01766Rey7C5yDqY8qnnc92SA
Signed-off-by: Erik <758402+erikarenhill@users.noreply.github.com>
Signed-off-by: Fredrik Ahlgren <fredrik@sourceful-labs.com>
resume_charging in the same command continues the session, so a
1Φ→3Φ flip never latches. Wait for a poll that shows charging has
stopped instead of a fixed 15 s delay.

Co-authored-by: Fredrik Ahlgren <fredrik@sourceful-labs.com>
Signed-off-by: Fredrik Ahlgren <fredrik@sourceful-labs.com>
Signed-off-by: Fredrik Ahlgren <fredrik@sourceful-labs.com>
@frahlg
frahlg force-pushed the fix/easee-phase-flip-resume-delay branch from 7628352 to 9d67fab Compare October 4, 2026 16:30

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.

3 participants