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.
so i got everything installed now but in grafana the pre-populated dashboards never seem to finish loading.

i had assumed that teslamate also pulls previous data using the API, but does it not? do i need to take some drives first in order for anything to show up?
 
so i got everything installed now but in grafana the pre-populated dashboards never seem to finish loading.

i had assumed that teslamate also pulls previous data using the API, but does it not? do i need to take some drives first in order for anything to show up?
It doesn't pull previous drives. I don't think the API makes that information available.
 
  • Like
Reactions: cwanja and jonny2x4
Teslamate doesn't talk to the car. See above diagram, second post on this page. Both it and the app talk to the servers that Tesla run. The car talks to the servers when it has connectivity. If a 2 button reset fixes it (albeit temporarily) then it is likely an issue with the car or it's connectivity.

What exactly are you seeing in the error logs. I bet there is more than 408 errors. Can you share some logs?

Also, don't mention Teslamate to Tesla. They'll just close your case off and blame it on Teslamate.
Yes, I remember reading that it uses the same API that the car does. I think next time it happens, im going to put the vehicle in service mode and take a look at the menus for connectivity. That one shows some additional information on the mobile connection as well as wifi. Here's a snip of my logs

On this day there was a SW update, then went offline. I had my wife do the 2 scrollbutton reset while she was out driving, then it came back online.
I noticed it offline in the Tesla app, as I was trying to see her location.

Code:
teslamate-teslamate-1  | 2023-08-09 01:34:07.416 [info] GET https://owner-api.teslamotors.com/api/1/vehicles/xxxx/vehicle_data -> 408 (9115.397 ms)
teslamate-teslamate-1  | 2023-08-09 01:34:07.417 [warning] TeslaApi.Error / %{"error" => "{\"error\": \"timeout\"}", "error_description" => "", "response" => nil}
teslamate-teslamate-1  | 2023-08-09 01:34:07.417 car_id=1 [error] Error / :unknown
teslamate-teslamate-1  | 2023-08-09 01:34:37.520 [info] GET https://owner-api.teslamotors.com/api/1/vehicles/xxxx/vehicle_data -> 408 (101.126 ms)
teslamate-teslamate-1  | 2023-08-09 01:34:37.636 car_id=1 [warning] Vehicle went offline while updating
teslamate-teslamate-1  | 2023-08-09 01:34:47.756 [info] GET https://owner-api.teslamotors.com/api/1/vehicles/xxxx/vehicle_data -> 408 (116.316 ms)
teslamate-teslamate-1  | 2023-08-09 01:34:47.866 car_id=1 [warning] Vehicle went offline while updating
teslamate-teslamate-1  | 2023-08-09 01:34:57.986 [info] GET https://owner-api.teslamotors.com/api/1/vehicles/xxxx/vehicle_data -> 408 (117.299 ms)
teslamate-teslamate-1  | 2023-08-09 01:34:58.093 car_id=1 [warning] Vehicle went offline while updating
teslamate-teslamate-1  | 2023-08-09 01:35:08.378 car_id=1 [info] Update / Installed 2023.26.7
teslamate-teslamate-1  | 2023-08-09 01:35:08.378 car_id=1 [info] Start / :online
teslamate-teslamate-1  | 2023-08-09 01:35:08.400 car_id=1 [info] Connecting ...
teslamate-teslamate-1  | 2023-08-09 01:36:39.346 car_id=1 [warning] Received stale stream data: %TeslaApi.Stream.Data{time: ~U[2023-08-09 06:36:38.720Z], speed: nil, odometer: 11386.7, soc: 74, elevation: 203, est_heading: 90, est_lat: xxxx, est_lng: xxxx, power: 0, shift_state: nil, range: 238, est_range: 270, heading: 90}
teslamate-teslamate-1  | 2023-08-09 01:38:10.414 car_id=1 [info] Suspending logging
teslamate-teslamate-1  | 2023-08-09 01:51:29.055 car_id=1 [info] Fetching vehicle state ...
teslamate-teslamate-1  | 2023-08-09 01:52:04.060 [error] GET https://owner-api.teslamotors.com/api/1/vehicles/xxxx-> error: "timeout" (35002.592 ms)
teslamate-teslamate-1  | 2023-08-09 01:52:04.061 [warning] TeslaApi.Error / timeout
teslamate-teslamate-1  | 2023-08-09 01:52:04.061 car_id=1 [info] Unhandled fetch result: {:error, :unknown}
teslamate-teslamate-1  | 2023-08-09 01:56:33.594 car_id=1 [info] Fetching vehicle state ...
teslamate-teslamate-1  | 2023-08-09 01:56:34.094 car_id=1 [info] Start / :asleep
teslamate-teslamate-1  | 2023-08-09 01:56:34.108 car_id=1 [info] Disconnecting ...
teslamate-teslamate-1  | 2023-08-09 02:45:10.012 [info] Refreshing access token ...
teslamate-teslamate-1  | 2023-08-09 02:45:10.923 [info] POST https://auth.tesla.com/oauth2/v3/token -> 200 (909.779 ms)
teslamate-teslamate-1  | 2023-08-09 02:45:10.935 [info] Scheduling token refresh in 6Â h
teslamate-teslamate-1  | 2023-08-09 06:59:03.188 car_id=1 [info] Start / :online
teslamate-teslamate-1  | 2023-08-09 06:59:03.229 car_id=1 [info] Connecting ...
teslamate-teslamate-1  | 2023-08-09 06:59:29.754 [error] Vehicle Error: Vehicle is offline
teslamate-teslamate-1  | 2023-08-09 06:59:42.362 [info] GET https://owner-api.teslamotors.com/api/1/vehicles/xxxx/vehicle_data -> 408 (9125.404 ms)
teslamate-teslamate-1  | 2023-08-09 06:59:42.363 [warning] TeslaApi.Error / %{"error" => "{\"error\": \"timeout\"}", "error_description" => "", "response" => nil}
teslamate-teslamate-1  | 2023-08-09 07:01:54.360 [info] GET https://owner-api.teslamotors.com/api/1/vehicles/xxxx/vehicle_data -> 408 (9125.033 ms)
teslamate-teslamate-1  | 2023-08-09 07:01:54.361 [warning] TeslaApi.Error / %{"error" => "{\"error\": \"timeout\"}", "error_description" => "", "response" => nil}
teslamate-teslamate-1  | 2023-08-09 07:01:54.361 car_id=1 [error] Error / :unknown
teslamate-teslamate-1  | 2023-08-09 07:02:00.415 car_id=1 [info] Received stream data: :inactive
teslamate-teslamate-1  | 2023-08-09 07:02:00.650 [notice]     :alarm_handler: {:set, {TeslaMate.Vehicles.Vehicle_1_api_error, :fuse_blown}}
teslamate-teslamate-1  | 2023-08-09 07:02:23.508 [info] GET https://owner-api.teslamotors.com/api/1/vehicles/xxxx/vehicle_data -> 408 (9143.236 ms)
teslamate-teslamate-1  | 2023-08-09 07:02:23.508 [warning] TeslaApi.Error / %{"error" => "{\"error\": \"timeout\"}", "error_description" => "", "response" => nil}
teslamate-teslamate-1  | 2023-08-09 07:02:23.509 car_id=1 [error] Error / :unknown
teslamate-teslamate-1  | 2023-08-09 07:02:31.441 [error] Vehicle Error: Vehicle is offline
teslamate-teslamate-1  | 2023-08-09 07:02:43.637 [info] GET https://owner-api.teslamotors.com/api/1/vehicles/xxxx/vehicle_data -> 408 (126.047 ms)
teslamate-teslamate-1  | 2023-08-09 07:02:53.861 car_id=1 [info] Start / :offline
teslamate-teslamate-1  | 2023-08-09 07:02:53.883 car_id=1 [info] Disconnecting ...
teslamate-teslamate-1  | 2023-08-09 07:09:00.657 [notice]     :alarm_handler: {:clear, TeslaMate.Vehicles.Vehicle_1_api_error}
teslamate-teslamate-1  | 2023-08-09 07:19:38.188 car_id=1 [info] Start / :online
teslamate-teslamate-1  | 2023-08-09 07:19:38.237 car_id=1 [info] Connecting ...

I had a similar outage on July 28 and it only resolved itself after the same 2 scrollbutton reset. I had rebooted my Teslamate instance and that made no difference.

Code:
teslamate-teslamate-1  | 2023-07-28 11:40:44.811 [info] GET https://owner-api.teslamotors.com/api/1/vehicles/xxxx/vehicle_data -> 408 (9161.583 ms)
teslamate-teslamate-1  | 2023-07-28 11:40:44.812 [warning] TeslaApi.Error / %{"error" => "{\"error\": \"timeout\"}", "error_description" => "", "response" => nil}
teslamate-teslamate-1  | 2023-07-28 11:40:44.813 car_id=1 [error] Error / :unknown
teslamate-teslamate-1  | 2023-07-28 11:40:53.805 [notice]     :alarm_handler: {:set, {TeslaMate.Vehicles.Vehicle_1_api_error, :fuse_blown}}
teslamate-teslamate-1  | 2023-07-28 11:41:39.471 car_id=1 [info] Vehicle is still online. Falling asleep for: 36Â min
teslamate-teslamate-1  | 2023-07-28 11:43:02.737 car_id=1 [info] Fetching vehicle state ...
teslamate-teslamate-1  | 2023-07-28 11:43:02.952 car_id=1 [info] Start / :asleep
teslamate-teslamate-1  | 2023-07-28 11:43:02.979 car_id=1 [info] Disconnecting ...
teslamate-teslamate-1  | 2023-07-28 11:47:53.812 [notice]     :alarm_handler: {:clear, TeslaMate.Vehicles.Vehicle_1_api_error}
teslamate-teslamate-1  | 2023-07-28 12:20:02.768 [info] GET https://owner-api.teslamotors.com/api/1/vehicles/xxxx/vehicle_data -> 408 (9136.330 ms)
teslamate-teslamate-1  | 2023-07-28 12:20:02.769 [warning] TeslaApi.Error / %{"error" => "{\"error\": \"timeout\"}", "error_description" => "", "response" => nil}
teslamate-teslamate-1  | 2023-07-28 12:20:02.770 car_id=1 [error] Error / :unknown
teslamate-teslamate-1  | 2023-07-28 12:20:42.019 [info] GET https://owner-api.teslamotors.com/api/1/vehicles/xxxx/vehicle_data -> 408 (9134.426 ms)
teslamate-teslamate-1  | 2023-07-28 12:20:42.019 [warning] TeslaApi.Error / %{"error" => "{\"error\": \"timeout\"}", "error_description" => "", "response" => nil}
teslamate-teslamate-1  | 2023-07-28 12:20:42.020 car_id=1 [error] Error / :unknown
teslamate-teslamate-1  | 2023-07-28 12:21:21.439 [info] GET https://owner-api.teslamotors.com/api/1/vehicles/xxxx/vehicle_data -> 408 (9166.209 ms)
teslamate-teslamate-1  | 2023-07-28 12:21:21.439 [warning] TeslaApi.Error / %{"error" => "{\"error\": \"timeout\"}", "error_description" => "", "response" => nil}
teslamate-teslamate-1  | 2023-07-28 12:21:21.440 car_id=1 [error] Error / :unknown
teslamate-teslamate-1  | 2023-07-28 12:22:01.714 car_id=1 [info] Start / :offline
teslamate-teslamate-1  | 2023-07-28 13:02:56.198 [info] Refreshing access token ...
teslamate-teslamate-1  | 2023-07-28 13:02:56.651 [info] POST https://auth.tesla.com/oauth2/v3/token -> 200 (450.417 ms)
teslamate-teslamate-1  | 2023-07-28 13:02:56.668 [info] Scheduling token refresh in 6Â h
teslamate-teslamate-1  | 2023-07-28 14:44:46.222 car_id=1 [info] Start / :offline
teslamate-teslamate-1  | 2023-07-28 14:45:06.208 [info] GET /
teslamate-teslamate-1  | 2023-07-28 14:45:06.733 [info] Sent 200 in 525ms
teslamate-teslamate-1  | 2023-07-28 15:42:13.967 car_id=1 [info] Start / :online
 
If both TeslaMate and Tesla app are having issues, my gut tells me it is Tesla who is breaking the owners API connection. The fact that you have found both the app and TeslaMate down is what builds my confidence in that.

Again, this is an undocumented and unsupported API - which means if Tesla does maintenance to it, they do not care what it breaks. One could argue the app not functioning is critical, but the vehicle works fully without the app.

My guess is there is nothing wrong with your car, but it is just the Tesla API endpoint going down for maintenance and or issues.
 
Again, this is an undocumented and unsupported API - which means if Tesla does maintenance to it, they do not care what it breaks. One could argue the app not functioning is critical, but the vehicle works fully without the app.
My hope is that Teslamate will transition to the new official API that is now available. ("Standard Fleet" is the first support app using it.)

 
Yes, I remember reading that it uses the same API that the car does.
It uses the same API as the app. That might be the same API that the car uses, but I've not seen any docs to suggest that is the case.
I'll have a look at the logs in the morning.
If both TeslaMate and Tesla app are having issues, my gut tells me it is Tesla who is breaking the owners API connection. The fact that you have found both the app and TeslaMate down is what builds my confidence in that.
The data comes from the car to the servers to the app/TM. The break in data could be anywhere. The fact the OP can restore the data stream by rebooting the car suggest to me that the problem is at the car end.

Did Tesla get back to your service request?
 
  • Like
Reactions: cwanja
My hope is that Teslamate will transition to the new official API that is now available. ("Standard Fleet" is the first support app using it.)

Do we know what that API offers over the current one? Other than being ‘officially’ supported - whatever that might mean.
 
Although this will probably not surprise people on here, it did me, so I just wanted to share in case it helps others…

I’ve been logging my M3P in Teslamate (on a Raspberry Pi) for about 3.5 years - no problems and I’ve loved the stats. However, we collected a second M3 (standard RWD) last week, and I was interested in logging that in Teslamate as well.

The M3P is a work car, that is registered with my work email address, the new car is personal and is registered to a whole different personal email address - this appeared to be an issue, as two separate accounts caused problems for recording data. After reading a bit on here, I decided the simple solution was to ‘flatten’ the database and sign in to Teslamate with the new personal account and just log our new car.

We collected the new car last Monday, and I invited my work account to the car so I could drive both cars in my Tesla app. Everything was good and I left messing with Teslamate until this weekend.

I then logged into Teslamate on Friday to create one final backup and note down some stats for work - everything was just as normal. I decided to update the Pi and Teslamate before flattening the database, and after doing that, had to pause the database work until the next day.

To my surprise, when I logged in the next day to complete the work, both cars were appearing in Teslamate and were being recorded - that really surprised me, as I’d done nothing about API keys or anything for the new car.

The only issue right now is it looks like the new car is not showing consumption figures - everything else (charges, drives, tyre pressures etc) is there, just not those?

My question for the knowledgable on here, is as the new car was ‘joined’ to my account for a week without anything being recorded, was it restarting the Pi that changed things, or the new version of Teslamate?

Regardless, I’m a happy chappy now, other than the missing bits of data.
 
The only issue right now is it looks like the new car is not showing consumption figures - everything else (charges, drives, tyre pressures etc) is there, just not those?
A new car and you've turned into a newb :) First entry in the FAQ

In order to still be able to display values TeslaMate estimates the consumption on the basis of the recorded (charging) data. It takes at least two charging sessions before the first estimate can be displayed. Charging sessions have to be longer than 10 minutes and less than 95% state-of-charge (SoC).

My question for the knowledgable on here, is as the new car was ‘joined’ to my account for a week without anything being recorded, was it restarting the Pi that changed things, or the new version of Teslamate?
Don't know what version you had prior to this, but if both cars are in the app then Teslamate will see both cars. (I only have one, but this is my understanding of how it works)
 
  • Funny
Reactions: cwanja
My question for the knowledgable on here, is as the new car was ‘joined’ to my account for a week without anything being recorded, was it restarting the Pi that changed things, or the new version of Teslamate?
This sounds weird as I typed it out, because it seems odd. But...probably the restarting of TeslaMate which checks against your Tesla account for new vehicles.

Speculating, but I would have thought that TeslaMate checks against your account regularly and pull any new vehicles. However, I know when you get a new car, you have to log out of TeslaMate and log back in.

One way to validate this would be when your lease car is removed, do not touch TeslaMate and see if the car drops off. My guess is it will not - you will need to reboot TeslaMate / Pi or log out of TeslaMate to get it removed.
 
  • Like
Reactions: spooksman
Did Tesla get back to your service request?
Yeah, they were recently messaging me via the app. I told them about July 28 and the most recent one on Aug 9.
"I can see the wake issue on the 9th"... "known software issue that is currently under investigation with the workaround being a scroll wheel reset to restore connectivity"
They noted that there was no hardware issue, so the service request is being closed.
 
  • Like
Reactions: cwanja and init6
In order to still be able to display values TeslaMate estimates the consumption on the basis of the recorded (charging) data. It takes at least two charging sessions before the first estimate can be displayed. Charging sessions have to be longer than 10 minutes and less than 95% state-of-charge (SoC).

So I'm back after a few weeks, and 5 charges, but I'm still not seeing Net and Gross in the overview screen...
1693317064854.png


1693317094094.png


Just re-reading the FAQ, maybe it is because the car is hitting 100% every charge (its LFP) and I need to set it to 90% for a couple?

Cheers
 
  • Like
Reactions: cwanja