Welcome to Tesla Motors Club
Discuss Tesla's Model S, Model 3, Model X, Model Y, Cybertruck, Roadster and More.
Register

TeslaMate [megathread]

This site may earn commission on affiliate links.
I've not got the headache of working out why my Pi stops responding every night. It had been happening with Homebridge before hand I believe, but I hadn't been that on top of it.

I know it was working up until around 4am when my car finished charging, as TeslaMate shows that data :) - Homebridge logs look fairly useless though.
 
My car updated its software overnight from 2020.12.5 to 2020.12.11.1. On the TeslaMate homepage it shows this new software version, but in Grafana it is showing the old one everywhere. Do you have to be in the car, or have driven it, to "complete" the installation for Grafana etc to pick this new version up? I haven't been in the car before or since it updated.
 
My car updated its software overnight from 2020.12.5 to 2020.12.11.1. On the TeslaMate homepage it shows this new software version, but in Grafana it is showing the old one everywhere. Do you have to be in the car, or have driven it, to "complete" the installation for Grafana etc to pick this new version up? I haven't been in the car before or since it updated.
Check on adriankumpf/teslamate. This has been an issue before.
 
  • Like
Reactions: Durzel and Roy W.
My car updated its software overnight from 2020.12.5 to 2020.12.11.1. On the TeslaMate homepage it shows this new software version, but in Grafana it is showing the old one everywhere. Do you have to be in the car, or have driven it, to "complete" the installation for Grafana etc to pick this new version up? I haven't been in the car before or since it updated.
Grafana is just drawing on the same data in TeslaMate, so if the TeslaMate home page is showing the right version, it should also show in the Grafana reports. I suspect it’s a bug. I can’t replicate because I’m still waiting for a software update...
 
@Roy W.

Could you do me a favour please? I've rebuilt my instance today (along with Homebridge as the Pi just kept failing), having performed a restore I now can't do backups any more and I think it's due to the services being renamed and me needing to update the compose.yml

Could you run docker ps and paste the output in here please?
 
@Roy W.

Could you do me a favour please? I've rebuilt my instance today (along with Homebridge as the Pi just kept failing), having performed a restore I now can't do backups any more and I think it's due to the services being renamed and me needing to update the compose.yml

Could you run docker ps and paste the output in here please?
Of course, here you go:


pi@raspberrypi:~ $ docker ps
CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES
d637da577742 teslamate/teslamate:latest "/sbin/tini -- /bin/…" 3 days ago Up 3 days 0.0.0.0:4000->4000/tcp pi_teslamate_1
8d536a93db73 teslamate/grafana:latest "/run.sh" 3 days ago Up 3 days 0.0.0.0:3000->3000/tcp pi_grafana_1
02c1d1e00125 eclipse-mosquitto:1.6 "/docker-entrypoint.…" 6 weeks ago Up 6 weeks 0.0.0.0:1883->1883/tcp pi_mosquitto_1
1ec6e34a55f2 postgres:12 "docker-entrypoint.s…" 6 weeks ago Up 6 weeks 5432/tcp pi_database_1
pi@raspberrypi:~ $
 
Thanks @Roy W.

Although I'm now further confused, as I was hoping the pi_mosquitto_1 might have been because I did a restore.

Trying to run the backup command gives me: No such service: database - following the advice on the backup page I changed it to db in the text and get the same thing.

I've posted an issue (After performing a restore, I now can't perform backups · Issue #696 · adriankumpf/teslamate), hopefully someone smarter than me will be able to help :)
Might this help, from the documentation?

If you get the error No such service: database, update your docker-compose.yml or use db instead of database in the above command.
 
Might this help, from the documentation?

If you get the error No such service: database, update your docker-compose.yml or use db instead of database in the above command.

Tried with db but get the same issue, not sure what I'm supposed to update in docker-compose.yml tbh

I'm getting a warning about orphan tables, so I wonder if I didn't run the drop command properly, I'll try the cleanup step I think
 
  • Like
Reactions: Roy W.
I've not got the headache of working out why my Pi stops responding every night. It had been happening with Homebridge before hand I believe, but I hadn't been that on top of it.

I know it was working up until around 4am when my car finished charging, as TeslaMate shows that data :) - Homebridge logs look fairly useless though.
My Pi 4 kept turning off WiFi. I tried turning off power management, but it still failed. In the end switching to 2.4GHz rather than 5 seems to have solved it, although I was contemplating switching to Ethernet....
 
My Pi 4 kept turning off WiFi. I tried turning off power management, but it still failed. In the end switching to 2.4GHz rather than 5 seems to have solved it, although I was contemplating switching to Ethernet....

Interesting. Mine got to the point where it was just completely unstable this afternoon.

Had two thoughts, one the SD card might be a bit dodgy, as it’s been used a lot, including as a dash cam card in a Pi 0.
Secondly I’ve got a BT Whole Home Wi-Fi setup, wondering if the changing between discs might have been causing an issue.

Only problem is, if I’ve fixed it I won’t know what did it as I connected the pi post rebuild direct to the Sky router and I’ve used a different card :)
 
Updated my history/overview dash with a few more custom panels. Happy to share the json code if anyone wants to add any to theirs.

nUw0wqD.png
 
It'd be great to see some of the workings please @Russinating

I've used Grafana loads at work, but the data source there is much simpler for me to get my head around :)

They're all just adaptations of existing TeslaMate panels (I think!). The dashboard variables are useful for simplifying things but it's annoying that you still have to use the variables within a SQL query in Grafana, I believe (I've asked - Using variable in panel query - but no replies).

The "# Drives > Median" for example is simply:

Code:
SELECT count(*) FROM drives WHERE car_id = $car_id AND distance > $mediandistance

And then in the dashboard settings > variables, $mediandistance is set to:

Code:
SELECT convert_km(percentile_disc(0.5) WITHIN GROUP (ORDER BY distance), '$length_unit') FROM drives WHERE car_id = $car_id

...which is a copy of the median distance panel from "Drive Stats". Replace $mediandistance with an integer and you get the other panels I've got on that row, over 100 miles etc.

It's a bit annoying you can't set dashboard variables and then just call them within panels as that would simplify things somewhat, particularly sums.

Fuel savings for example is:

Code:
SELECT convert_km(odometer, '$length_unit') * 0.15 - $chargecost FROM positions WHERE car_id = $car ORDER BY date DESC LIMIT 1

$chargecost is:

Code:
SELECT sum(cost) FROM charging_processes WHERE car_id = $car

Ideally you'd set the two variables and then just do $dieselcost - $chargecost as per my post on the Grafana forum, but no!

If you want to use the fuel savings one above you just need to amend the "0.15" which is 15p per mile for whatever your other/previous car was.