Improve drive start recording #425
Replies: 6 comments
-
The issue here is, Teslamate must pause the polling in order to allow the car to sleep. That wait period ("falling asleep") is the only time when a drive start can be missed - once the period is over and the API returns "asleep", Teslamate polls every 30 seconds. If Teslamate doesn't pause polling for the "falling asleep" period, the car will never sleep - this is an issue with the Tesla API, it will keep the car awake and only allow it to fall asleep if no API requests are made for a period of time. |
Beta Was this translation helpful? Give feedback.
-
Thanks for clarification. From my recorded data, my starting point nearly every morning isn't my defined geofenced "Home" but a position that's not far away. Maybe one or two kilometers away. This behaviour could be addressed and improved by the change above. |
Beta Was this translation helpful? Give feedback.
-
I don't believe that Teslamate does stop polling the vehicle state for that
period, only the more intensive data logging period. This is based on a
response that @adriankumpf gave recently to a suggestion about time-based
wake ups where he explained this is not necessary as vehicle state is
constantly polled from an API endpoint that does not wake the vehicle even
when logging is suspended, and logging resumes as soon as it sees the state
change. Perhaps @adriankumpf could confirm how that would align here, as
you would think that logic would be sufficient to have detected the vehicle
being prepared for the drive within 1 minute of unlocking/waking it?
…On Fri, Feb 7, 2020 at 10:12 PM Marco Gabriel ***@***.***> wrote:
Thanks for clarification.
From my recorded data, my starting point nearly every morning isn't my
defined geofenced "Home" but a position that's not far away. Maybe one or
two kilometers away.
This behaviour could be addressed and improved by the change above.
—
You are receiving this because you are subscribed to this thread.
Reply to this email directly, view it on GitHub
<https://github.com/adriankumpf/teslamate/issues/425?email_source=notifications&email_token=AGFF33B2QS22K3G2WCUPLBLRBU62JA5CNFSM4KRMENI2YY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGOELCSOMY#issuecomment-583345971>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AGFF33EII6WVW7XTFVYS77DRBU62JANCNFSM4KRMENIQ>
.
|
Beta Was this translation helpful? Give feedback.
-
This happens often to me as well. The reason is, at least for me, not Teslamate but the car itself: while it sits asleep/offline in the garage, it loses GPS reception, and only regains a correct position several minutes into a "cold start" drive. This can be seen on the in-car nav screen - it keeps showing the car in a completely wrong place, until it eventually "jumps" to the correct location once the GPS reception has picked back up. I believe that's the point when Teslamate gets the first valid position update, and the drive starts recording. Your proposed solution of taking the last known position before the car went asleep/offline instead of the first position of the new drive could actually solve this, at least in part. |
Beta Was this translation helpful? Give feedback.
-
added two additional edits: EDIT: EDIT 2: |
Beta Was this translation helpful? Give feedback.
-
I recently installed Teslamate and I think it's great. I have also found that Teslamate is definitely missing the start of drives even when the car has a GPS lock - so this is not the cause of the issue (as reported by @olexs above). My understanding is that Could it be the case that Teslamate is not calling the API above frequently enough to correctly identify that the vehicle has woken up and/or is about to start? Once it detects a change in state, it should start the sleep timer and poll frequently for a change in drive state using If there is no change in the drive state after the sleep window timeout, then it should revert to the I believe that the behaviour of vehicles and sleep mode varies from MCU1 (Model S/X) to the newer MCU (>Apr 2018 S/X and M3) |
Beta Was this translation helpful? Give feedback.
-
Teslamate polls frequently if the car is awake or sleeps, before requesting data that would wake up the car. If a drive is started, Teslamate possibly misses the first few minutes of the drive. I know, there are some solutions for this problem like installing Tasker on Android to inform Teslamate immediately when the mobile phone connects to the Tesla Bluetooth connection and some other ways to do this.
While this works, it's somehow cumbersome to set up and depends on the users experience.
Maybe it could be changed to work like this:
Advantages:
Disadvantages:
EDIT:
If this can/will be implemented: A migration of existing data would be very nice. AFAIK, the necessary data for former drives is already in the database (shown in states dashboard). I am not sure if this data is sufficient for a migration of starting points.
EDIT 2:
As an additional factor, the mileage can help to decide if the drive was started earlier. If end mileage of last drive < start mileage of current drive -> set starting point to endpoint of last drive.
Beta Was this translation helpful? Give feedback.
All reactions