Describe the bug
Great software, using since yesterday, donated today :) Unfortunately I just cant read Erlang therefore I am not able to fix it myself, nor understand how this works.
I think I somehow bugged my database because my frist "trip" was just few meters to the garbage can and then I continued which was second trip.
1) efficiency in cars table was null so some of the dashboards was not working. I was not able to read how is it updated or if it is constant. (seems that recalculate_efficiency does that I just dont know when and how :D I found constant in your tests 0.153 (is that in kwh/km?)
2) I dont know the difference between battery_level and usable_battery_level (well I got an idea) but I just dont know why it is calculated for trip/drive consumption. in is_sufficiently_precise and why there is commented out the difference or why it does matter if it differs.
I had a pretty "decent" test trip for logging about 10km and by some coincidence i had endposition.battery_level bigger than endposition.usable_batterylevel so the SQL down bellow evaluates as 1 therefore whole is_sufficiently_precise is false.
I dont know when it can happen that usable_battery_level is lower than battery_level maybe I just ended the trip when some kind of "race condition" happened but I think that the query should not rely on this.
Obvious choice would be checking start_level - end_level against some treshold like atleat 1%
I guess you had some problem with this already as there is a commented out code in the query which does this delta on start/end between levels.
But it can fail on this aswell
duration_min > 1 AND distance > 1 AND (
start_position.usable_battery_level IS NULL OR
--((start_position.battery_level - start_position.usable_battery_level) = (end_position.battery_level - end_position.usable_battery_level)) OR
(end_position.battery_level - end_position.usable_battery_level) = 0
) as is_sufficiently_precise,
To Reproduce
as above have trip which has end_position having difference between battery levels
Expected behavior
I would expect that "trip like this" would be counted as significant
Operating environment
- efficiency in cars table was null so some of the dashboards was not working. I was not able to read how is it updated or if it is constant. (seems that recalculate_efficiency does that I just dont know when and how :D I found constant in your tests 0.153 (is that in kwh/km?)
That's normal. The FAQ has more information on this: https://docs.teslamate.org/docs/faq#why-are-no-consumption-values-displayed-in-grafana
- I dont know the difference between battery_level and usable_battery_level (well I got an idea) but I just dont know why it is calculated for trip/drive consumption. in is_sufficiently_precise and why there is commented out the difference or why it does matter if it differs.
If the battery cools down due to cold weather and thus the range is artificially reduced, it is not possible to determine consumption or vampire drain accurately. See also #390.
That's normal. The FAQ has more information on this: https://docs.teslamate.org/docs/faq#why-are-no-consumption-values-displayed-in-grafana
Is this same for the empty and N/A cells in the picture bellow?


Yes, any consumption values are calculated by TeslaMate; the API does not output them directly.
Thanks for the answers I understand and in the longterm it does not matter, however it seems that this happens quite often. I saw that in the other thread there is some discussion about it. I dont have any strong opinion on it, for now I dont mind little discrepancy so I edited the formula :)
since I dont know how to write in elixir, I though would it be helpful if I try to help atleast with documentation? (from user standpoint) if so, on which part should I focus and create PR. thanks
Ultimately, it is a trade-off: should demonstrably incorrect values be displayed or should they simply be blanked out? Both options are not ideal. In the end, thanks to Grafana it' s possible to do exactly what you did: customizing the dashboard yourself. I think this is a good compromise.
since I dont know how to write in elixir, I though would it be helpful if I try to help atleast with documentation? (from user standpoint) if so, on which part should I focus and create PR. thanks
Yes, that would be great! If you feel like some parts could be extended or if you have other ideas how to improve the docs, please create a PR. Specific things that come to my mind:
Yes I agree that thats great compromise. Btw after TeslaMate update, all the dashboards are overwritten or how does this work ?
regarding the docs, I will try to take a look at some of those. Maybe I will try my Elixir skills to create Home Assistant MQTT discovery :)
I've had my custom dashboards remain between updates. I'm not sure if this will be the case for every update but so far so good.
This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.