Skip to content

Feature implementation - track charge cost and real-world consumption#450

Closed
GabrielRogd wants to merge 3 commits into
andreadegiovine:developfrom
GabrielRogd:develop
Closed

Feature implementation - track charge cost and real-world consumption#450
GabrielRogd wants to merge 3 commits into
andreadegiovine:developfrom
GabrielRogd:develop

Conversation

@GabrielRogd
Copy link
Copy Markdown

@GabrielRogd GabrielRogd commented Mar 13, 2026

Summary

This PR adds charge cost tracking and a real-world average consumption sensor for charge-capable vehicles.

New entities:

  • number.kwh_cost to set the electricity price per vehicle
  • sensor.charge_cost to show the cost of the latest completed charge
  • sensor.actual_average_consumption to show actual average consumption in kWh/100km

sensor.last_charge now also stores mileage, distance since last charge, charge cost, and actual average consumption.

Why

This makes it easier to track what a charge really costs and how efficient the car is between charging sessions.

For example, on my Corsa-e 2020, I wanted to see the real consumption based on the energy added during charging and the distance driven since the previous full charge session, instead of only relying on the trip value reported by the app.

Notes

  • Charge cost stays unavailable until number.kwh_cost is set above 0
  • Actual average consumption becomes available after enough charge history exists, typically after the second completed charge recorded by this version
  • Battery value correction is also applied to the derived charge metrics so the numbers stay consistent

Validation

  • python -m compileall custom_components/stellantis_vehicles

@Jordan87
Copy link
Copy Markdown
Contributor

Which values are taken to calculate those values?
My PlugInHybrid (308) is not providing information about Battery residual or Battery capacity.

@GabrielRogd
Copy link
Copy Markdown
Author

Sorry for my late answer. This implementation was made using an e-remote control capable Opel Corsa-e, from which the residual/capacity values can be fetched. The charge costs are calculated based on average consumption (shown after every trip, and then the average is calculated during the current charge cycle), and total kWh consumption before the car is put into the wall.

@github-actions
Copy link
Copy Markdown
Contributor

This PR is stale because it has been open for 15 days with no activity.

@github-actions github-actions Bot added the stale label Apr 20, 2026
@github-actions
Copy link
Copy Markdown
Contributor

This PR was closed because it has been inactive for 5 days since being marked as stale.

@github-actions github-actions Bot closed this Apr 26, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants