Skip to content

fix: make meter_power cumulative across charging sessions#28

Open
jak wants to merge 1 commit into
mainfrom
fix/cumulative-meter-power
Open

fix: make meter_power cumulative across charging sessions#28
jak wants to merge 1 commit into
mainfrom
fix/cumulative-meter-power

Conversation

@jak
Copy link
Copy Markdown
Owner

@jak jak commented Mar 23, 2026

Summary

  • Fixes meter_power resetting to 0 between charging sessions. Homey's meter_power capability expects a cumulative value (like a utility meter) that never decreases.
  • Tracks energy deltas between polls and accumulates them into a running total stored in the Homey device store, so it persists across app restarts.
  • The API's per-session energy value is still used as the source, but the device now adds session deltas to the cumulative counter rather than reporting the raw session value.

Test plan

  • Start a charge session and verify meter_power increases as energy is delivered
  • Unplug and re-plug the car — verify meter_power does not reset to 0
  • Restart the Homey app — verify meter_power retains its previous value from the device store

Closes #4

@chatgpt-codex-connector
Copy link
Copy Markdown

You have reached your Codex usage limits for code reviews. You can see your limits in the Codex usage dashboard.
To continue using code reviews, you can upgrade your account or add credits to your account and enable them for code reviews in your settings.

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.

Critical: meter_power resets between charging sessions

1 participant