Closed natrlhy closed 5 years ago
Is the data logged real time?
Yes, data is logged in real time. It polls vehicle data from the Tesla API. Therefore the car needs to be online but it does not necessarily need to be on WiFi.
I saw that the 1st 21 minutes of a trip won't be logged.
That only happens after the car has been idling for 15 minutes (e.g. after charging / driving). If you then start driving again, data may not be logged until those 21 minutes have elapsed.
It depends on your usage pattern whether that happens regularly. If so, you could try out the solution described in the FAQ :)
Hm Ok. I purposely woke the car up at home a few times before my wife drove it on an errand. It didn't log the trip to there, but it logged the trip back. She was there for over 40 minutes (sentry mode on) We don't leave sentry mode on at home in the garage so it sleeps regularly.
@natrlhy You could create a script on your computer that will resume logging and run it before you leave if the options in the FAQ don't work for you (not quite as convenient as from your phone though).
https://gist.github.com/Rfvgyhn/55c146dcc2615261e004c28cc987a425
Since I don't have teslamate public facing I may try a local script.
What I'm wondering is would it be a curl command with http://localiphere:4000/api/car/1/logging/resume
In both examples, there is no port specified so I'm just trying to understand what API call to which docker container it's going to be referencing (if this makes sense)
curl should have no problem parsing the port. Assuming http://localiphere:4000
is the address you use in your browser to access the web interface and assuming anonymous auth, it should look like curl -X PUT http://localiphere:4000/api/car/1/logging/resume
@natrlhy The 15-minutes period could also be made configurable. Would it help to increase it to 30 or even 60 minutes?
@adriankumpf making the timeout / callback / check if car is awake period configurable would be great also if it can be changed by api. Then one could do interesting home automation tweaks. ie: when car is "home" then configure a longer check time vs when the car isn't "home" etc ...
Making it configurable to an increase in time would make it so less data would be captured, no?
Is there a way to set the API to see if the car is online and resume logging based on that state? Since it has a persistent connection, why not just poll for the Status. If the status changes from asleep to online, then send an instant resume for logging.
I love data, even though I may not understand it all at times, so the more data that can be captured, the better! :)
@adriankumpf making the timeout / callback / check if car is awake period configurable would be great also if it can be changed by api. Then one could do interesting home automation tweaks. ie: when car is "home" then configure a longer check time vs when the car isn't "home" etc ...
Okay, so you mean the default interval of 60 seconds if the car is asleep, right? Theoretically we could just reduce it a bit e.g. to 30 seconds for everyone. It only increases the load on the Tesla servers but besides that there is no negative impact on the power consumption of the car.
Making it configurable to an increase in time would make it so less data would be captured, no?
No, it would cause the car to stay online/awake longer i.e. if you're on short errands where the car is parked only for a short period of time, it would become less likely that no data is logged.
Is there a way to set the API to see if the car is online and resume logging based on that state? Since it has a persistent connection, why not just poll for the Status. If the status changes from asleep to online, then send an instant resume for logging.
This is the way it works :) When the car is asleep teslmate checks its status every 60 seconds.
@adriankumpf making the timeout / callback / check if car is awake period configurable would be great also if it can be changed by api. Then one could do interesting home automation tweaks. ie: when car is "home" then configure a longer check time vs when the car isn't "home" etc ...
Okay, so you mean the default interval of 60 seconds if the car is asleep, right? Theoretically we could just reduce it a bit e.g. to 30 seconds for everyone. It only increases the load on the Tesla servers but besides that there is no negative impact on the power consumption of the car.
Oh I meant the 21 minute period but I think either one being configurable ... Maybe I'm getting confused by how you have polling setup during different states ...
So the logger API call is different than me opening up my Tesla app and "waking" the car up a bit before I might be leaving seems to be different. Is that act just sending a wake API call and not triggering any logging/scraping?
I was able to manually run curl -X PUT http://myiphere:4000/api/car/1/logging/resume
and right away TeslaMate changed from "offline" to "online". Sending the curl command to suspend put it into a "falling asleep" status.
I guess I'm not understanding why, if teslamate checks every 60 seconds if the car is online/offline, why it won't just start logging data right away if the state changes from offline to offline at any given point. If changing this status check from 60s to 30s only loads Tesla's API servers and won't consume any more power for the car, that would be great!
I guess in the end my thinking is, if any data gaps can be eliminated that's the ideal goal.
In general the suspend
and resume
calls are not required for the logger to work. It may just happen that in some situations the first few minutes (up to 21 in the worst case) of a trip are not logged. But really most of the time you should not notice any data gaps.
By explicitly informing the logger when its safe to start "falling asleep" (suspend
) and when the process of falling asleep i.e. the 21-minute period should be aborted (resume
), any data gaps can be eliminated.
It's a bit confusing, I guess.
Just give it a try and see if it's worth the effort to perform these API calls :)
I'm a new Tesla owner so maybe I'm opening up the Tesla App too much :). It wakes it up, then I'm not sure how long it takes to fall back asleep (maybe that 15 minutes that you are referring to?). So part of me is thinking this helps the teslamate logging be ready. But if I don't end up driving the car anywhere after I wake up, it's going back to sleep, etc.
Also I ended up setting up VPN on my home router and the iOS tasks I've created do work so I'm good with not exposing my instances to the outside world since I can leverage home VPN (thanks again to Synology and their cool routers/NAS solutions).
If in doubt about logging, maybe I can just tell it to resume
right when I'm about to jump in the . car and see how that goes. I try not to overthink this stuff but I can't help myself with all the cool things that one can do with a Tesla!
It wakes it up, then I'm not sure how long it takes to fall back asleep (maybe that 15 minutes that you are referring to?).
Almost. Teslamate assumes it takes 21 minutes and tries again if it takes longer than that.
Also I ended up setting up VPN on my home router and the iOS tasks I've created do work so I'm good with not exposing my instances to the outside world since I can leverage home VPN (thanks again to Synology and their cool routers/NAS solutions).
👍
If in doubt about logging, maybe I can just tell it to resume right when I'm about to jump in the car.
Yes, that's the way to go if you really want to make sure everything is logged from the start.
Closing this for now. Feel free to open another issue if there are any more questions.
@adriankumpf thanks for being very responsive to all these threads and questions :)
You're welcome! :)
Just a general question as my wife went out on an errand.
Is the data logged real time? Does the car have to be on WiFi (same network as teslamate) in order for data to get pulled, etc?
I saw that the 1st 21 minutes of a trip won't be logged. If we run short errands, etc none of this will be tracked/logged?