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 Grafana Dashboard #3059

Merged
merged 16 commits into from
Jun 12, 2023
Merged

Battery Health Grafana Dashboard #3059

merged 16 commits into from
Jun 12, 2023

Conversation

jheredianet
Copy link
Contributor

@jheredianet jheredianet commented Jan 13, 2023

I got my own TeslaMate Custom Dashboards where there are several dashboards for my own use, but I decided to share them with people and friends who could be interested in use them. Those dashboards are called: Battery Health, Charging Costs Stats, Charging CurveStats, Current State, Mileage Stats and Tracking Drives. There are also two dashboards (Current Charge & Drive View) that could be browsed on the car while driving or charging.

In this pull request I want to merge to TeslaMate the Battery Health dashboard that I am especially proud of, since the initial idea came some years ago from when I had a Hyundai Kona EV from which I logged the data with from a ODB2 scanner (OVMS) and saved in Influxdb to visualize them with Grafana. From there, the original idea of generating a dashboard that allows me to check the battery health was born. The calculations were not easy, but over time I could refine them. Now that I have a Tesla and use TeslaMate, I realize that a chart of this type was also needed, so I adapted it without much effort thanks to the amount of data that TeslaMate logs.

This dashboard is meant to have a look of the Battery health based on the data logged in Teslamate. So, the more data you have logged from your brand-new car the better, both for degradation and cycle estimations.

Degradation is just an estimated value to have a reference, measured on usable battery level of every charging session in the last month with enough kWh added (in order to avoid dirty data from the sample), calculated according to the rated efficiency of the car. Then you can see the mileage logged in Teslamate and an estimation of the number of cycles of the battery. On the other hand, you'll see a plotly chart that represents the evolution of the car's battery capacity during its entire lifetime.

Lately I've changed subqueries to INNER JOINS in order to get better performance. It has reduced from 10s to 2s on loading some panels with lot of estimations.

Finally, there is an important improvement for those who have not used Teslamate since they got their car, or for those who have bought it second hand. Now it is possible to set the max range to 100% and the battery capacity of the car battery when it was new in order to get an accurate and better estimation.

bh

I hope you consider including this contribution into the main project.

Regards,

jheredianet and others added 4 commits January 13, 2023 17:25
TeslaMate Custom Dashboards: Battery Health, Charging Costs Stats, Charging CurveStats, Tracking Drives and more. There are two dashboards (Current Charge & Drive View) that could be browsed on the car while driving or charging.
@SiNaPsEr0x
Copy link

please integrate this @adriankumpf

@KolEll01
Copy link

KolEll01 commented Jan 18, 2023

It will be extremely useful. Add this @adriankumpf please.

@jheredianet
Copy link
Contributor Author

Hi Folks,

With great pride, I want to announce that my repository with TeslaMate Custom Dashboards has been considered among the 5 finalists in the Grafana Golden Grot Awards, celebrating a decade of Grafana dashboards. If you like this project, please, Vote now! Polls close at 11:59 p.m. PDT on Friday, May 5.

TeslaMate electric vehicle monitoring dashboard (Juan Carlos Heredia)

TeslaMate electric vehicle monitoring dashboard (Juan Carlos Heredia)

@jheredianet jheredianet changed the title TeslaMate Custom Dashboards Battery Health Grafana Dashboard May 22, 2023
* master:
  Update charges.json (#3033)
  Docker compose command fixes (#3025)
  Upgrade Grafana to 9.5
  Fix typo
  Update CHANGELOG
  Fix formatting
  Add composite index to position and drop drive_id index (#3186)
  Update docs to manually remove vehicle (#3075)
  Remote duplicate typos config
  Add Docker status badge
  Update CI status badge
  Fix typos
  Fix Korean translation TYPO (#3126)
  Update Project: Tesla Home Assistant Integration (#3194)
  Updated menu route to Download TeslaFi Data (#3218)
  Update cache paths
  Bump recommended Postgres version to 15
  Fix deprecation warnings
  Update drive-details.json missing dataSource for pressure units (#3225)
  Store build cache on GH container registry
  Format code
  Customize image tags
  Distribute build across multiple runners
  Fix building assets
  Update JS dependencies
  Update website dependencies
  Bump Grafana to 8.5.26
  Bump docker/metadata-action from 4.1.1 to 4.4.0
  Update CI action
  Add Dialyzer
  Fix deprecation warnings on Elixir v1.15
  Update dependencies
  Read vehicle name from vehicle_data response
Copy link
Collaborator

@adriankumpf adriankumpf left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Fantastic work! ❤️ Thank you very much.

@adriankumpf adriankumpf merged commit 71789c9 into teslamate-org:master Jun 12, 2023
7 checks passed
@jheredianet
Copy link
Contributor Author

Fantastic work! ❤️ Thank you very much.
@adriankumpf
Thank you for the great job on making up Teslamate!!!!

@KrzysztofHajdamowicz
Copy link

There is an issue with projects.md, a bunch of documentation is deleted with this PR.

@jheredianet
Copy link
Contributor Author

They are not deleted, there were just sorted in alphabetical order.

adriankumpf added a commit that referenced this pull request Nov 12, 2023
* TeslaMate Custom Dashboards

TeslaMate Custom Dashboards: Battery Health, Charging Costs Stats, Charging CurveStats, Tracking Drives and more. There are two dashboards (Current Charge & Drive View) that could be browsed on the car while driving or charging.

* Reorder projects and add more screenshots

* Remove project not using TeslaMate

* Projects using TeslaMate (alphabetically arranged)

* Battery Health dashboard

* Redesign subqueries
in order to improve performance for global variables and estimations

* Rearrange labels

* Simplify charts with plotly and improved estimations

* Rearranged panels and optimized queries

* Added Mileage logged and aditional info

* Improve BatteryHealth queries

* Fix label

* Improve Battery Capacity estimations

---------

Co-authored-by: Adrian Kumpf <8999358+adriankumpf@users.noreply.github.com>
@cwanja
Copy link
Collaborator

cwanja commented Nov 12, 2023

Holy smokes, this is beautiful @jheredianet

@DumSkidderik
Copy link

For some reason it reports my P85D to have 94kwh new capacity?

@jheredianet
Copy link
Contributor Author

For some reason it reports my P85D to have 94kwh new capacity?

Remember this is just an estimation, not a reading from the Car. For some reason your data logged in Teslamate some MaxRange and its calculated from it. I could be many reasons:

  • Maybe data you imported from other logger systems.
  • Maybe a manual input in the database
  • May an uncompleted charging session.

If you can query your database, you may find where is the record that is giving you the max range, somo of them are treated here jheredianet/Teslamate-CustomGrafanaDashboards#38

Anyway, if you know exactly what is your battery capacity and the range when the car was new, you could put those values in the top to tune the estimations.

image

@DumSkidderik
Copy link

DumSkidderik commented Nov 13, 2023

Remember this is just an estimation, not a reading from the Car. For some reason your data logged in Teslamate some MaxRange and its calculated from it. I could be many reasons:

  • Maybe data you imported from other logger systems.
  • Maybe a manual input in the database
  • May an uncompleted charging session.
    It does include old data from Teslafi, hmmmm

I can't really remember where the import cuts, but ther's a sudden drop in the curve that could maybe explain it.
Then again, I'm pretty sure the Teslafi data is the relatively few samlepoints early on, as soon as the samling interval gets more frequent I'll assume that's Teslamate using the streaming API?
brave_Z8cUu8XsP4

@jheredianet
Copy link
Contributor Author

I can't really remember where the import cuts, but ther's a sudden drop in the curve that could maybe explain it.
Then again, I'm pretty sure the Teslafi data is the relatively few samlepoints early on, as soon as the samling interval gets more frequent I'll assume that's Teslamate using the streaming API?

Yes sure, Teslamate uses the streaming API (based in your settings) and more data is logged.

image

@gym22
Copy link

gym22 commented Nov 14, 2023

For some reason it reports my P85D to have 94kwh new capacity?

Interestingly, my S 85 shows the same 94kWh capacity. Car is 9 years old but only started using teslamate about 3 years ago. No data was imported from other loggers and no manual input.

image

The projected range dashboard estimates 355km for this car, which is pretty accurate, but battery health shows 445.

I'll try to follow jheredianet/Teslamate-CustomGrafanaDashboards#38 and report what I find.

@Emilien-M
Copy link

Anyway, if you know exactly what is your battery capacity and the range when the car was new, you could put those values in the top to tune the estimations.

image

Is it possible to save these 2 parameters ?

@jheredianet
Copy link
Contributor Author

Anyway, if you know exactly what is your battery capacity and the range when the car was new, you could put those values in the top to tune the estimations.
image

Is it possible to save these 2 parameters?

No, but there is a work around discussed here jheredianet/Teslamate-CustomGrafanaDashboards#53 (comment)

@enoch85
Copy link
Contributor

enoch85 commented Nov 18, 2023

Just want to chime in and say GREAT WORK! Really really appreciated!

@jheredianet
Copy link
Contributor Author

Just want to chime in and say GREAT WORK! Really really appreciated!

Thank you for your feedback. Enjoy!!! 😊

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.

None yet

10 participants