Replies: 10 comments
-
I read in a different issue that TeslaMate is polling the API every 15 seconds, even when using the streaming API. So that explains the interval. The question would be, why was the streaming API not used? I see timeout errors while the car was parked, that probably has something to do with it. However, the last error was over an hour before the start of the drive. Maybe TeslaMate needs a better retry mechanism for connectivity issues with the streaming API? It might also be a good idea to increase the polling frequency in the case that no connection to the streaming API could be established. |
Beta Was this translation helpful? Give feedback.
-
So streaming api is actually not "polled" so that isn't why. Hence why it is a "streaming" api not a normal polling api. Tesla had some system problems recently that may be the cause? Typically /w streaming I see updates every .5 seconds. Are you positive you were using steaming? And @adriankumpf maybe should edit out the log comment that it is polling? |
Beta Was this translation helpful? Give feedback.
-
See this comment by @adriankumpf that I referenced previously if you are confused about how the two APIs (streaming-based and polling-based) are used together. What you are seeing in the screenshots is the streaming working correctly in the first one and the streaming not working with very slow polling as a fallback in the second one.
The comments in the log about increased polling frequency are correct and should not be removed. I trigger that by calling the /resume endpoint of TeslaMate's API every time the garage is opened, which makes TeslaMate check more often if the car is awake so the logging (via the streaming API) starts immediately when the car is in use. |
Beta Was this translation helpful? Give feedback.
-
I've had this issue for a few months now. |
Beta Was this translation helpful? Give feedback.
-
I'm not sure but I don't think so. At least the location I mentioned in the issue description has good LTE coverage. It also happens sporadically at other locations, but I can never reliably reproduce the issue anywhere. It sounds very much like your issue #838 describes the same problem though. I'm tempted to close this one. |
Beta Was this translation helpful? Give feedback.
-
I'm experiencing the same. Sometimes it uses the streaming API and other times an update every 15 secs and keeps doing that for the whole drive. Sometimes it starts the streaming in the middle of a drive as well so I can't really pinpoint the problem. I only noticed once I was using the MQTT stuff in Home Assistant where I show the elevation. The streaming API updates elevation while the 15sec poll one doesn't update this attribute at all. |
Beta Was this translation helpful? Give feedback.
-
I recall (but can't find a reference for) a limitation around only one stream being possible at a time, ie if the Tesla app is streaming, it would result in Teslamate not being able to use the Streaming API - anyone else recall this being mentioned? Perhaps try killing the Tesla app on your phone before your drives to see if that could be a reason for this? |
Beta Was this translation helpful? Give feedback.
-
@ngardiner I don't know if this is the right way to test this, but I had my passenger open the Tesla app for me while I was driving. The data in the app seemed to update as usual and looking at Grafana it seems the logging by TeslaMate was not affected by this. Though I don't know if maybe the app was polling instead because TeslaMate had an active streaming connection. I may try waking the car with the app to make sure the app gets the streaming connection before TeslaMate, to see if that changes anything. In any case, it seems increasing the polling frequency if connecting to the streaming API fails is the way to go. |
Beta Was this translation helpful? Give feedback.
-
hmmm - funny. These past few days, the polling frequency has been around 1 sec., not the usual 1/4 second on the streaming api.... Anybody else seeing this change? |
Beta Was this translation helpful? Give feedback.
-
I've also seen this happen regularly, including in v1.20.1 and car on v2020.40.9. I'll leave here my observations, maybe it gives ideas. Two things I noticed:
Interestingly, the car switching between 4G and (really bad) WiFi doesn't influence the subsequent drives rate. So for me this bug seems to reproduce when:
Sentry Mode, simultaneous Tesla app usage or car going to Sleep doesn't seem to influence it in my case. I live in a metropolitan area, so I assume/experience 4G coverage is very good, however we have a few fairly long tunnels, in which the car reverts to polling for the tunnel portion and after I get out, it goes back to Streaming API. Note that the car doesn't really show any issues while driving in the tunnel - Maps, Spotify work flawlessly. For some reason, this makes me think the problem is in the way the car communicates to the "mothership" and not related to TeslaMate. The only thing that doesn't check out is why restarting TeslaMate causes it to fail using the Streaming API for a long time. |
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
Describe the bug
On some drives using the streaming API, the update rate of TeslaMate drops down to around one update every ~15 seconds. I only noticed this after I started using the data published via MQTT to automate garage door opening/closing, however the issue is also apparent in the Grafana dashboard for affected drives.
Expected behavior
I expect around 2 updates per second using the streaming API. Actual result is around 4 updates per minute on some drives.
How to reproduce it (as minimally and precisely as possible):
I have not had it happen often enough to figure out when or why exactly it happens, but I feel like it usually happens on the return trip after the car was parked for a while with sentry mode activated. Could be a coincidence though.
Relevant entries from the logs
Log entry of one affected trip. Included are the drive to a store, a period with sentry mode active, followed by the drive back home. The drive back home was affected by reduced update frequency.
Screenshots
Below are Grafana screenshots of the two drives covered by the log. Please note that the log seems to use UTC while Grafana shows times in UTC+2.
1.: Drive to the store. Normal update frequency.

2.: Drive back home. Similar distance and duration as drive in previous screenshot, but affected by the issue.

Environment
Beta Was this translation helpful? Give feedback.
All reactions