1.6.9 EV SoC-based Fuel Records #1402
hargata
announced in
Announcements
Replies: 2 comments 1 reply
-
|
This is fantastic, thanks! |
Beta Was this translation helpful? Give feedback.
0 replies
-
|
Can we have input boxes as an option instead of the slider? I have already added that to my own instance. |
Beta Was this translation helpful? Give feedback.
1 reply
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment

Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
Starting in 1.6.9, fuel records for EV will no longer have a toggle for partial fuel ups, instead it will be replaced by a range slider:
What is going to change:
Consumption Calculation
Consumption displayed on the grid will now display actual fuel spent between each fuel record, this means that the value displayed in the Consumption will not always reflect the same consumption value you put in.
What does this mean
You input
13.34as the amount of kWh you charged on your vehicle, but the grid displays some other value such as1.55, this is because the consumption value for EV's are now adjusted for the SoC.How it is calculated
fuel_spent = kWh_consumed + ((previous_ending_soc - current_ending_soc) * battery_capacity)Alternative calculation:
fuel_spent = (previous_ending_soc - current_starting_soc) * battery capacityFor example, you have a current fuel record with 13.14 kWh consumed, the starting SoC is 58% and the ending SoC is 75%,
We will first calculate the estimated battery capacity as
13.14 / (0.75 - 0.58)which comes up to 77.29kWhIf your previous ending SoC is 60%, your actual fuel spent is
13.14 + ((0.6 - 0.75) * 77.29)or alternative formula(0.6 - 0.58) * 77.29which comes up to 1.55kWh, Your MPG is then
(current odometer - previous odometer) / 1.55kWhThis formula is from #817
CSV Import/Exports
What does this mean
When exporting fuel records from Electric Vehicles, the CSV export will now have two additional columns(startingsoc and endingsoc)
API Changes
What does this mean
When retrieving fuel records, you will now see two additional fields: startingSoc and endingSoc, these will be defaulted to 0 for non-EV's.
When adding new fuel records, you can now pass in startingSoc and endingSoc. These are integers, so if you're charged up to 75% you should pass in 75, not 0.75
Questions you probably have:
What will happen to my older fuel records
they will default to 20% starting SoC and 80% ending SoC
According to these calculations my battery capacity changes every time
There's nothing we can do about that, as the SoC is merely an estimation by your vehicle's BMS, so the best we can do is estimate the fuel consumption based on data your vehicle provided.
Why are the default values 80/20
Because this is the generally accepted sweet spot for EV charging, and we need to put default values in there so that's what we settled on.
Beta Was this translation helpful? Give feedback.
All reactions