Skip to content

fix(ev): show uncertainty when charger pilot data expires - #2065

Merged
frahlg merged 2 commits into
srcfl:masterfrom
segran2:codex/stale-charger-pilot
Nov 28, 2026
Merged

frahlg merged 2 commits into
srcfl:masterfrom
segran2:codex/stale-charger-pilot

Conversation

@segran2

@segran2 segran2 commented Nov 21, 2026

Copy link
Copy Markdown
Contributor

Follow-up to #2056 and #2062.

When an EV is still drawing positive power below an accepted order, the driver provides no effective limit, and the last valid pilot confirmation is older than 90 seconds, show “Waiting for current pilot data”. The message describes the measured shortfall and the missing evidence. No-draw, overdraw, and a shortfall below a fresh pilot keep their existing verdicts. Drivers that provide no valid pilot confirmation keep their current behavior.

Validation

  • Regression test reproduces 13 A requested and roughly 5.44 kW measured. With the driver limit withheld, a fresh 8 A pilot explains the draw, expiry changes the status to waiting, and a fresh confirmation restores “Limited by the charger”. A sustained draw of approximately 3 kW with a fresh 8 A pilot remains “Not following”.
  • The same three labels were verified in local browser playback with simulated inputs.
  • Hardware with the local FTW v0.166.0-beta.1 build verified the fresh-pilot path at 13 A requested, 11 A pilot, and roughly 7.6 kW measured. The pilot was confirmed about every 60 s, so the >90 s case did not occur on hardware. Hardware and simulation results

@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: when an EV draws positive power below an accepted order, the driver gives no limit, and the last valid pilot confirmation is older than the fresh window, the control feedback now reports waiting / charger_pilot_stale ("Waiting for current pilot data") instead of a warning. No-draw, overdraw and fresh-pilot cases keep their verdicts.

Security screen: clean. No new deps, hosts or authz changes.

Findings

  • none blocking. The guard (Kind==ev, accepted command, sent > 100 W, actual ≥ 100 W, no LimitA, pilotStale) is tight, and pilotStale is only true when a pilot reading exists but is old, so drivers without pilot data keep today's behaviour. The Go test covers expiry and re-confirmation; the JS test covers the label. CI green.
  • question: a charger that stops reporting pilot indefinitely stays at waiting/info while still under-drawing. Is there a point where it should escalate back to warning, or does the existing telemetry_stale path cover it?

Safe to merge from my read.

@segran2

segran2 commented Nov 22, 2026

Copy link
Copy Markdown
Contributor Author

Thanks, Mira. telemetry_stale does not cover pilot-only expiry while the power reading remains fresh. If a driver keeps publishing an expired but otherwise valid pilot confirmation, this branch can stay at waiting/info without a time limit.

On the tested box, the local Easee Cloud driver drops the pilot value once it has gone 90 seconds without confirmation. Core then falls back to the normal underdraw assessment. For drivers that keep publishing an expired confirmation, a separate escalation timeout is still an open question.

@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.

Adds a waiting / charger_pilot_stale verdict for an EV drawing below its accepted order when the driver gives no limit and the last pilot confirmation is older than 90 s, plus the UI title/sentence and a regression test that cycles stale -> fresh. CI is green. No secrets, new dependencies, authz changes or new hosts.

One thing to decide: the stale verdict is info, and it replaces the warning that power_below_target would have raised. If a charger stops reporting pilot data for good while still under-delivering, the row stays at "Waiting for current pilot data" indefinitely and the underdraw warning never comes back. Worth an escalation after some time (like the existing Escalated handling) or a cap on how long waiting can mask it. Fine to ship as is if you want that as a follow-up.

Otherwise reads correct to me: the condition is tight (kind == ev, accepted, sent > 100 W, actual >= 100 W, no limit, pilot valid but stale), and drivers with no pilot data keep today's behavior.

@frahlg
frahlg merged commit 97c2d34 into srcfl:master Nov 28, 2026
21 checks passed
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