Skip to content

Add read-only Easee charging diagnostics collector - #2064

Open
segran2 wants to merge 3 commits into
srcfl:masterfrom
segran2:codex/easee-stop-diagnostics
Open

segran2 wants to merge 3 commits into
srcfl:masterfrom
segran2:codex/easee-stop-diagnostics

Conversation

@segran2

@segran2 segran2 commented Nov 21, 2026 •

Copy link
Copy Markdown
Contributor

Related to #1975 and #1948.

Add an opt-in, read-only collector for Easee charging starts and stops. It reads the local FTW API, retains 30 seconds of prehistory in memory, and writes bounded rotating JSONL logs when an event is captured. It records the sent order, phase changes, resume acknowledgements, pilot and power evidence with separate source and confirmation times, and the vehicle SoC and charge limit when available.

The captured data helps distinguish a vehicle-side stop with a positive pilot from a charger that holds the pilot at zero. The collector does not change charging behavior or run as part of a standard FTW installation.

To check the local API fields without writing a log, run python3 scripts/easee-start-diagnostics.py --probe on the box. For continuous capture, pass a writable JSONL path.

Validation

  • python3 scripts/test_easee_start_diagnostics.py passed. It checks a newly reported 0 W sample after a stable positive reading with an older source timestamp. It also checks stale power, stale pilot and a zero FTW order.
  • The collector ran on a Raspberry Pi with FTW v0.166.0-beta.1, a locally modified Easee Cloud 1.5.2 driver, and an Audi e-tron. Charger firmware was not recorded.
  • At a controlled vehicle-side stop, the collector captured 5.45 kW → 299 W → 0 W with FTW still sending 5.52 kW and Easee still offering 8 A. It recorded confirmed_no_draw live. The vehicle limit was supplied by the operator. Hardware timeline

Review follow-up

  • The collector uses the configured driver name easee-cloud for charger reads and pixii for grid phase currents. On boxes without a driver named pixii, the grid phase-current fields are empty.
  • Commit 31572ba adds direct tests for pilot source-timestamp freshness and paired evidence. The cases cover fresh, stale, future and missing pilot timestamps, stale power, zero versus positive pilot with no draw, and fresh allocation versus stale or missing grid phase samples.
  • python3 scripts/test_easee_start_diagnostics.py -v passed all three tests.

Signed-off-by: Segran <goran@andersson-stehag.se>
Signed-off-by: Segran <goran@andersson-stehag.se>

@miravoss26 miravoss26 left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What it does: adds an opt-in, read-only Python collector that polls the local FTW API every 5 s and writes rotating JSONL (1 MB × 5) around Easee charge starts/stops, with a 30 s in-memory prehistory. No change to charging behaviour; not part of a standard install.

Security screen: clean. Only 127.0.0.1:8080 GETs, no new deps, no subprocess/eval, log path comes from argv. The only exec_module is in the test loading the script.

Findings

  • nit: scripts/easee-start-diagnostics.py hardcodes /api/drivers/pixii for the grid meter and easee-cloud as driver. On a box without a Pixii the grid-current fields silently come out empty. Fine for the diagnostic box this targets; worth a comment or a flag.
  • nit: the test file is 57 lines for 461 lines of logic. The status/pilot freshness classification (pilot_sample, paired_evidence) is the part I'd most want covered. I did not run the tests; CI is green.

Safe to merge from my read.

Signed-off-by: Segran <goran@andersson-stehag.se>
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.

2 participants