Repository navigation
fix(feedback): show charger-reported reasons for EV shortfalls - #2010
Conversation
Signed-off-by: Segran <goran@andersson-stehag.se>
Signed-off-by: Segran <goran@andersson-stehag.se>
frahlg
left a comment
There was a problem hiding this comment.
Reviewed: ready to merge once it is in step with master. With #2008 merged it now conflicts in two places; I could not push to your branch from here, so here is the resolution I tested:
web/style.css: take master's.energy-history-ev-cost .incomplete { color: var(--alarm); }.--warningdoes not exist inweb/components/theme.css, so your line always fell back to amber.web/control-feedback.test.mjs: keep both test blocks, yours and #2008's "EV warnings show fresh pilot evidence…".
With that, all 929 box-UI tests pass.
Low notes, your call: when a charger label is present it replaces the advice for device_limit ("Raise the limit in the charger's app…") and offered_current_lower ("Check the charger's load balancing…"), so appending the label to the advice may read better; OCPP's own "Waiting for charger connection status" would show as "The charger reports"; and Core relies on the driver to clear an old reason.
frahlg
left a comment
There was a problem hiding this comment.
Thanks, in step with master and the notes are handled: the advice for device_limit and offered_current_lower stays, with the charger's words in front; OCPP's connection wait moved to state_label; and Core drops a reason older than the charger state. At cfa0cbe merged with today's master, all 932 box-UI tests pass, and go vet and go test pass for api and ocpp.
Follow-up, not blocking: no driver sets reason_observed_at or state_observed_at yet, so the legacy path still trusts the driver to clear an old reason. Emitting them from the drivers would close that.
When an EV draws no power or less than requested, FTW can show “The charger has not said why” even when the charger reports a reason. For example, in #1948 Easee reported “limited by dynamic charger current” while the dynamic setting was 12 A, the pilot was 0 A and measured power was 0 W.
Show the charger-reported reason when FTW considers the EV readings current. Keep the existing shortfall, severity and fallback when the explanation is unavailable. This brings the display change from segran2#3 onto master.
Keep the existing advice alongside the reported reason for charger limits and lower offered current. OCPP publishes a connection wait as charger state. Core omits EV reasons from stale or unavailable readings and drops a timestamped reason when the charger has since changed state. Drivers without reason timestamps continue to use the label from their latest fresh reading.
Validation
All 929 web tests and
make verifypassed after the follow-up. Regression tests cover paired advice, OCPP connection status and stale charger reasons.The initial JavaScript change was visually verified in the local FTW web UI on a Raspberry Pi running
v0.163.0-beta.1with the PR’s JavaScript change applied. With a live Easee charger, the Not following card showed that FTW asked for 15 A, the charger signalled 11 A to the car and measured charging was 0 W. Below those readings, the card displayed “The charger reports: limited by charger max current.”The follow-up (
cfa0cbe) was installed as a local patch on the same Raspberry Pi. After restart, the running binary and served JavaScript matched the deployment bundle and FTW reported five healthy drivers.With live Easee telemetry, FTW omitted a cached reason whose source timestamp preceded the latest charger state. During normal charging, FTW showed Following without carrying forward an old reason.
The local web UI showed Limited by the charger’s load balancing at 6 A with 15 A requested and about 4.2 kW measured. With the charger’s own maximum set to 7 A, it showed Charger limit, 15 A requested and about 4.8 kW measured, and retained the advice to raise the limit in the charger app.
Easee supplied no separate reason in the 7 A case. Using the exact JavaScript served by the Pi with simulated feedback, both
device_limitandoffered_current_lowerdisplayed the charger-reported reason alongside their existing advice.The OCPP connection-wait behavior was covered by a regression test. OCPP was disabled on the Pi.
Related to #1948 and #1975.