Repository navigation
fix(history): say EV cost is partial when a counter reading was rejected - #1987
Merged
Merged
Conversation
On 8 November 2026 a home charged 24.3 kWh and the new panel said 10 kWh with no warning: the charger's counter jumped, the ledger rejected those buckets, and each held 0 Wh. Only buckets with energy were checked for quality, so the total read as complete. Signed-off-by: Fredrik Ahlgren <[email protected]> Co-Authored-By: Claude Opus 5.5 <[email protected]>
Codex Review Summary: ✅ CompletedThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
A counter restarts at every session and its energy returns as an integrated row, so a reset would flag every period. Signed-off-by: Fredrik Ahlgren <[email protected]> Co-Authored-By: Claude Opus 5.5 <[email protected]>
5 of 6 tasks
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.
Problem
#1547 added EV charging energy and cost to History. On the owner's home box on 8 November 2026 the charger delivered 24.27 kWh by its power readings (the box's own session notice said 24.3 kWh), and the panel said "Today 10 kWh · SEK 39.25" with no warning.
The Easee counter jumped during that charge and the ledger rejected those buckets (
invalid,counter_jump), so each holds 0 Wh. The panel checks quality only for buckets with energy, so the low total read as complete. The PR promised that missing data during recorded charging marks the total incomplete.Change
A bucket with
invalidquality marks the period "Partial cost", even with 0 Wh.A
resetdoes not: a session counter restarts at every new session, and the energy comes back as its ownintegratedrow. Agapat 0 Wh stays complete, as #1547 chose. Mostly the charger did not run, though a box offline during a charge looks the same; this panel cannot tell them apart.This only makes the panel honest. The total stays low until the counter jumps themselves are fixed.
Evidence
node --test web/energy-history-integration.test.mjspasses, with a new test for a rejected reading, one outside the period, a counter reset and a gap.npm test: all web tests pass./api/energy/history,/api/pricesand/api/series, read only. Before this change the panel on those readings showed 10 kWh and SEK 39.25 with no warning.An independent review (Sonnet) read the ledger's qualities; dropping
resetfrom the check came from it.🤖 Generated with Claude Code