dbweb-ch / ioBroker.tesla-motors

ioBroker Adapter for Tesla Motors Cars
MIT License
11 stars 9 forks source link

Variable update time when idle as well? #18

Closed jensb closed 4 years ago

jensb commented 4 years ago

Now that we have more accurate data when the car is active, can we also decrease the check time when idle to maybe every 5min at least, better every 3 min? Maybe only during user-specified times (eg. 6-9h & 14-22h)? I regularly miss the first few minutes of my route.

I don't know how Tesla's API endpoints react to too many requests though.

Thanks :)

dbweb-ch commented 4 years ago

It is checking every minute the Standby Info.

jensb commented 4 years ago

That's weird, because with our vehicle it takes up to 15 minutes for ioBroker to realize the car is moving. We lose the first 10..15 minutes of almost every trip or charging session.

How can that happen?

dbweb-ch commented 4 years ago

Can you maybe turn on debug log an send me the logfile of a time frame this happend? It could happen when the algorithm try to let the car fall asleep 10 minutes after it was woken up. Then it doesn't request for 15 Minutes as otherwise this would keep the car awake all the time.

jensb commented 4 years ago

I have one, but I don't want to publish it. How can I send you a private message?

dbweb-ch commented 4 years ago

Thanks for the file, I think I know where the problem is. I see a ~ 3 minute gap from the last stop to the first moving entry, the distance in between (GPS) corresponds to those 3 minutes. I assume you mean these 3 minutes. The car gives the error "Error 504" for these 3 minutes, which means that although the tesla server is reachable, the car is not. I assume you have your car on wifi at home. When you drive away, it has to switch to the mobile network first. This change can take some time. From my experience with my Tesla sometimes even quite long. During this time the car is not reachable. That's why you might miss the first few minutes of the drive. From the Api I can't "optimize" anything, if the car is not reachable, I can't do anything...  If the data is important to you, I could imagine the following possibilities:

jensb commented 4 years ago

Thanks for the analysis! I'll disable Wifi on the car for a while and see if this helps. However, I am experiencing the same issue (first few minutes of trip missing) also in locations where there is no Wifi access for the car, e.g. at work or in the supermarket. So this may not be the whole picture.

dbweb-ch commented 4 years ago

Can you try to observe mobilr connection state when you start your drive?

jensb commented 4 years ago

Will do. However, at the moment we don't drive to work daily any more, so it might take some time.

jensb commented 4 years ago

I observed a few trips now and the minute delay also appears when we are nowhere near a known Wifi spot. Yesterday I lost the first 2-3 minutes of my start trip (might have been the transition from Wifi to LTE) but the same delay happened when starting our return trip. So I think this is not just a connectivity transitioning issue.

dbweb-ch commented 4 years ago

Did you check if car had mobile connection within this time frame? I know this from my car, sometimes, spotify does not work for the first couple of minutes.

jensb commented 4 years ago

I have now set the Wifi to my mobile phone shared hotspot and disabled stationary wifi completely. When we are on the road the car only has LTE for its own purposes, when we want more, we enable our mobile hotspot. This seems to work well. Thanks!