Skip to content

Fix EV planning SoC from timestamped cached vehicle observations - #1549

Closed
segran2 wants to merge 7 commits into
srcfl:masterfrom
segran2:fix/vehicle-soc-planning
Closed

segran2 wants to merge 7 commits into
srcfl:masterfrom
segran2:fix/vehicle-soc-planning

Conversation

@segran2

@segran2 segran2 commented Oct 10, 2026

Copy link
Copy Markdown
Contributor

Fixes #1548.

FTW could display a VAG reading of 78% while planning from an old manual value of 27%, scheduling about 50.4 kWh to reach 80%. The current-SoC slider was hidden because the display had a car reading, even though that reading did not supply the planning value.

Allow cached vehicle observations with an explicit measurement age to anchor the connected session within the existing one-hour anchor window. Preserve the original observation time so loadpoint estimation adds only energy delivered since that measurement. Keep live SoC, charge-limit and completion checks on their existing stricter freshness policy, and preserve connection/session/counter safeguards. Keep manual correction available when a stale displayed car reading does not provide a fresh vehicle planning value.

Includes regression coverage for cached observations, invalid age/status, newer trusted readings, metered energy without double counting, and the hidden-slider mismatch, plus a patch changeset. No driver or optimizer changes.

Validation:

  • Telemetry and loadpoint Go suites pass.
  • 16 targeted web tests pass.
  • Go vet and build pass.
  • Compose migration, container boundary and native solver checks pass; the Docker release-context check was skipped because no Docker daemon is available.
  • Full make verify was attempted. Network-interface and ownership restrictions cause unrelated failures, reproduced on the unchanged v0.140.4-beta.1 baseline.
  • The reporter confirmed on 11 October 2026 that the fix works as intended on their FTW installation. No post-fix screenshot or API trace is attached.

Based on v0.140.4-beta.1. The published branch's complete file tree was verified identical to the locally tested commit. This is separate from EV charging cost PR #1547. Open PR file lists were checked; no overlap was found with this change.

Signed-off-by: segran2 <268038031+segran2@users.noreply.github.com>
Signed-off-by: segran2 <268038031+segran2@users.noreply.github.com>
Signed-off-by: segran2 <268038031+segran2@users.noreply.github.com>
Signed-off-by: segran2 <268038031+segran2@users.noreply.github.com>
Signed-off-by: segran2 <268038031+segran2@users.noreply.github.com>
Signed-off-by: segran2 <268038031+segran2@users.noreply.github.com>
Signed-off-by: segran2 <268038031+segran2@users.noreply.github.com>
frahlg added a commit that referenced this pull request Oct 11, 2026
…el (#1550)

Fixes #1548. Supersedes #1549 and includes its commits.

The planner now takes a car SoC reading up to one hour old as the plan start when it is newer than the manual level. That includes cached readings and readings vag_vehicle has marked stale. Energy delivered since the reading is added on top. Live control, the charge limit and completion keep the 5-minute window. "Planning from X%" shows the planner's own value (planning_soc), and the slider stays available while the car reading is not live.

Co-authored-by: segran2 <goran@andersson-stehag.se>
@frahlg

frahlg commented Oct 11, 2026

Copy link
Copy Markdown
Member

Thanks @segran2, great find and fix! Your commits are merged as part of #1550 (squashed, you are listed as co-author), which builds on this PR. It also uses a car reading that vag_vehicle has marked stale (up to 1 h old) when it is newer than the manual level, and makes "Planning from X%" show the same value the planner uses. Closing this PR since its changes are now on master in f146a1e. Please let us know if anything still looks off on your car after the next beta.

@frahlg frahlg closed this Oct 11, 2026
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.

EV planner retains manual SoC while displaying newer VAG SoC and hides correction slider

2 participants