Repository navigation
fix(history): record per-driver ev_w so live chart can plot EV power - #209
Merged
Merged
Conversation
The dashboard's live chart (web/next-app.js:1866) reads `d.ev_w` per driver from /api/history to plot the EV trace. recordHistory() in main.go was packing per-driver bat_w / pv_w / meter_w into the history JSON column but never ev_w — so the chart's per-driver lookup returned undefined for EV drivers and the trace plotted as zero. The in-memory /api/status path was unaffected (it always emitted ev_w from the easee-cloud driver), which is why operators saw the correct number on the dashboard cards but a flat-zero chart. Fix: pull DerEV.SmoothedW into the per-driver row alongside the existing types. Verified on hardware: 5-step 3Φ ramp at 6/7/8/9/10 A produced the expected stair-step values in /api/history (0 → 4774 → 5470 → 6108 → 6793 W) and rendered correctly on the live chart. Co-Authored-By: Claude Opus 4.7 (1M context) <[email protected]>
Contributor
There was a problem hiding this comment.
Pull request overview
Fixes missing per-driver EV power (ev_w) in persisted history points so the web live chart can correctly plot EV charging power from /api/history.
Changes:
- Adds
telemetry.DerEVsampling torecordHistory()’s per-driver JSON payload (drivers[driver].ev_w).
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
HuggeK
pushed a commit
to HuggeK/ftw
that referenced
this pull request
Nov 10, 2026
…ware 7.x (srcfl#1962) Moves the pin to srcfl/device-drivers@e463c653 (srcfl#209). Only the Zap driver changes. The new tests use the payload a Zap on 7.0.3 sent for a simulated Solis. Signed-off-by: David Mozart <[email protected]> Co-authored-by: Claude Opus 5.5 <[email protected]>
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.
Summary
The live chart's EV trace was always zero.
recordHistory()inmain.gowas packing per-driverbat_w/pv_w/meter_winto the history JSON column but notev_w— so the chart's per-driver lookup (`d.ev_w` in `web/next-app.js:1866`) returned undefined and the trace plotted as zero.The in-memory `/api/status` path was unaffected (it always emitted `ev_w` from the easee-cloud driver), which is why operators saw the correct number on the dashboard cards but a flat-zero chart.
Fix
Pull `DerEV.SmoothedW` into the per-driver history row alongside the existing types. Three lines.
Verification
5-step 3Φ ramp at 6/7/8/9/10 A on a real Easee charger:
/api/historyhistory points now show the same values inside the per-drivereasee-cloudmap, and the live chart renders the stair-step trace as expected.Why no test
The fix is a single-pass-through line in
recordHistoryand is verified end-to-end against real hardware. Adding acmd/forty-two-wattsunit test would require liftingrecordHistoryinto a testable package — appropriate for a follow-up refactor, not this minimal bug fix.🤖 Generated with Claude Code