Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Battery Health Issue with Model S appears to use Ideal Efficiency and not Rated Efficiency, causing far too high an 'old' capacity #3486

Closed
1 task done
jensk22 opened this issue Nov 24, 2023 · 14 comments
Labels
area:dashboard Related to a Grafana dashboard Stale

Comments

@jensk22
Copy link

jensk22 commented Nov 24, 2023

Is there an existing issue for this?

  • I have searched the existing issues

What happened?

(I don't know how to escalate a Discusiion to an Issue, so here we go) The issue is described in Discussion:
#3470
)

My Tesla Model S 70D Y2015, which has approx 68,8/67,2kWh Usable from new, is reported with 'original' capacity in excess of 83 kWh

image

Assuming the
('$aux'::json -> 'RatedEfficiency')::text::float
is in effect the Ideal Efficiency of 190Wh/km instead of the Rated Efficiency of 150Wh, I changed the Graph Query to:
and that produces proper 'old' capacity numbers (which for me is around 66.1kWh because I started using Teslamate as late as at odeometer=70kKm). So the :

Below is not a proper fix, the right solution is to update the ('$aux'::json -> 'RatedEfficiency')::text::float to be correct!

SELECT convert_km(AVG(p.odometer)::numeric,'$length_unit') AS odometer,
AVG(c.ideal_battery_range_km * ('$aux'::json -> 'RatedEfficiency')::text::float / c.usable_battery_level) AS "kWh",
MAX(cp.id) AS id,
to_char(cp.end_date, 'YYYY-MM-dd') AS Title
FROM charging_processes cp
JOIN (SELECT charging_process_id, MAX(date) as date FROM charges WHERE usable_battery_level > 0 GROUP BY charging_process_id) AS last_charges ON cp.id = last_charges.charging_process_id
INNER JOIN charges c
ON c.charging_process_id = cp.id AND c.date = last_charges.date
INNER JOIN positions p ON p.id = cp.position_id
WHERE cp.car_id = $car_id
AND cp.end_date IS NOT NULL
AND cp.charge_energy_added >= ('$aux'::json -> 'RatedEfficiency')::text::float
GROUP BY 4

New graph:
image

Expected Behavior

image

Steps To Reproduce

Open Teslamate
Navigate to Dashboards/Battery Health

Relevant log output

None

Screenshots

image

Additional data

No response

Type of installation

Docker

Version

v1.27.4

@JakobLichterfeld JakobLichterfeld added the area:dashboard Related to a Grafana dashboard label Nov 24, 2023
@oivindoh
Copy link
Contributor

@jensk22 have you tried with the battery health dashboard currently on master?

@jheredianet
Copy link
Contributor

Below is not a proper fix, the right solution is to update the ('$aux'::json -> 'RatedEfficiency')::text::float to be correct!

Sorry, I wouldn't know how to make a calculation that only works for your car or specifically for that model. I don't know which models have this peculiarity. The data is extracted from what is stored in the "rated_efficiency" field of the "cars" table. Something you could do is to modify the value you have in that table and test if it adapts to what you mention, but I don't know what other implications it could have with other calculations from other dashboards.

About the dashboard, if we change that value arbitrarily it will affect all other car models. Have in mind, that there are many model variants: American, European, Asian, etc.

@jensk22
Copy link
Author

jensk22 commented Nov 27, 2023 via email

@jensk22
Copy link
Author

jensk22 commented Nov 27, 2023 via email

@jheredianet
Copy link
Contributor

Hi, Where do you get the '$aux'::json -> 'RatedEfficiency from??? regards Jens

Hi, this is the query:

SELECT efficiency * 100.0 AS rated_efficiency FROM cars WHERE id = 1

Also discussed here #3470

@jensk22
Copy link
Author

jensk22 commented Nov 27, 2023 via email

@jheredianet
Copy link
Contributor

Hi @jensk22

I've made un update for your suggestion. It's on my own repository ("on develop branch") at https://github.com/jheredianet/Teslamate-CustomGrafanaDashboards/tree/develop

You may import manually the BatteryHealth dashboard as explained there and test if the estimations now are more accurate. If so, I'll made a pull request to be used in Teslamate.

Let me know how it goes.

@jensk22
Copy link
Author

jensk22 commented Dec 1, 2023

I Imported the JSON Content as 'Battery Health2' and results are fine!
image

I read your instructions on 'your' ithub, and did not dare change the UID, so soon I will figure out whether Grafana/Delete works by UID or by name :-)

@jheredianet
Copy link
Contributor

jheredianet commented Dec 1, 2023

Great!!!
I'll make a pull request on the main repository of Teslamate.

#3531

@jensk22
Copy link
Author

jensk22 commented Jan 23, 2024

I performed a pull and update today - issue is still there:-(
So I looked here and saw that my' issue is still open.
Anything I can do to help?

image

(The manually imported Battery Healt totally continues my 'LinkMyTesla' data from 2016-2020, so seems correct. On top it calculates Current capaity as 65.1kWh which is within 0,1 kWh from what OBD2/ScanMyTesla reports :-))

image

@jensk22
Copy link
Author

jensk22 commented Jan 23, 2024

BTW, The Max Range (new) is not updated when I fill in the 'known' Max capacity wen new. My Nominal Capacity was first 71.2 kWh - Buffer of 2,4 kWh = 68,8 kWh, but later Tesla change dthe Buffer to 4 kWh (according to OBD2 BMS data). Newer the less, you can ofcourse not handle that and I am perfectly happy to enter say 68.8 kWh as Max New to get:
image

Copy link
Contributor

This issue has been automatically marked as stale because it has not had recent activity. It will be closed in 7 days if no further activity occurs. Thank you for your contributions.

@github-actions github-actions bot added the Stale label Feb 23, 2024
@jensk22
Copy link
Author

jensk22 commented Feb 23, 2024

I propose that you release the fix that was the effect of:
'Battery Health Issue with Model S #3470'

As I have reposted, the new Efficiency graph that I Imported and tests as 'Battery Health 2'uses Rated and works correct, se snip:
image

You just need to release it (don't know if you could collapse the now 3 x Battery Health Dashboards into one.

regards
Jens

@github-actions github-actions bot removed the Stale label Feb 24, 2024
Copy link
Contributor

This issue has been automatically marked as stale because it has not had recent activity. It will be closed in 7 days if no further activity occurs. Thank you for your contributions.

@github-actions github-actions bot added the Stale label Mar 25, 2024
@github-actions github-actions bot closed this as not planned Won't fix, can't repro, duplicate, stale Apr 1, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area:dashboard Related to a Grafana dashboard Stale
Projects
None yet
Development

No branches or pull requests

4 participants