Closed flosoft closed 2 years ago
Today it again duplicated a trip, however, it also split a trip into 2 different parts:
Database Table: | id | StartDate | StartPos | EndDate | EndPos | outside_temp_avg | speed_max | power_max | power_min | power_avg | meters_up | meters_down | distance_up_km | distance_down_km | distance_flat_km | height_max | height_min | CarID |
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
292 | 2022-04-14 11:41:45 | 51164 | 2022-04-14 11:52:19 | 51308 | 1 | |||||||||||||
291 | 2022-04-14 11:41:40 | 51163 | 2022-04-14 11:52:19 | 51308 | 20 | 90 | 63 | -60 | 5.2329 | 97 | 99 | 2.36100391075 | 2.489001722 | 2.10400727421 | 17 | 3 | 1 | |
290 | 2022-04-14 11:35:45 | 51133 | 2022-04-14 11:41:01 | 51160 | 20 | 48 | 31 | -24 | 5.4643 | 14 | 20 | 0.38200428086 | 0.28800070811 | 0.33399584789 | 27 | 18 | 1 |
Log:
14.04.2022 11:00:09 : TeslaLogger process statistics
14.04.2022 11:35:20 : #1: change TeslaLogger state: Charge -> Start
14.04.2022 11:35:26 : #1: sentry_mode: False
14.04.2022 11:35:27 : #1: ScanMyTesla FastMode: False
14.04.2022 11:35:27 : #1: CloseChargingState id:125
14.04.2022 11:35:27 : #1: UpdateUnplugDate(125): 1 rows updated to EndDate 4/14/2022 11:34:02 AM
14.04.2022 11:35:27 : #1: Combine charging states 124 into 125
14.04.2022 11:35:27 : #1: Update Chargingstate 125 with new StartDate: 4/14/2022 10:08:40 AM / StartChargingID: 6965 / charge_energy_added: -Infinity
14.04.2022 11:35:27 : #1: Delete Chargingstate 124
14.04.2022 11:35:27 : #1: UpdateChargeEnergyAdded(125): 1 rows updated to charge_energy_added 11.3
14.04.2022 11:35:27 : Distance: 60.2546486550591 - Radius: 150 - ?? Westfield La Maquinista
14.04.2022 11:35:27 : Reverse geocoding by Geofence
14.04.2022 11:35:29 : #1: change TeslaLogger state: Start -> Online
14.04.2022 11:35:33 : #1: ShiftStateChange: P -> D
14.04.2022 11:35:45 : #1: ScanMyTesla FastMode: True
14.04.2022 11:35:45 : #1: Missing: 0.00299982297201495 km
14.04.2022 11:35:45 : Distance: 61.1557732830314 - Radius: 150 - ?? Westfield La Maquinista
14.04.2022 11:35:45 : Reverse geocoding by Geofence
14.04.2022 11:35:45 : #1: change TeslaLogger state: Online -> Drive
14.04.2022 11:35:45 : CombineChangingStates start
14.04.2022 11:35:45 : CombineChangingStates took 4ms
14.04.2022 11:35:49 : #1: ShiftStateChange: D -> R
14.04.2022 11:35:58 : #1: ShiftStateChange: R -> D
14.04.2022 11:39:30 : #1: HttpStatusCode = Unauthorized. Password changed or still valid? 0
14.04.2022 11:39:30 : #1: HttpStatusCode = Unauthorized. Password changed or still valid? 0
14.04.2022 11:40:30 : #1: Update Tesla Token From Refresh Token!
14.04.2022 11:40:30 : #1: Update Tesla Token From Refresh Token!
14.04.2022 11:40:30 : #1: HttpStatus: OK
14.04.2022 11:40:30 : #1: refresh_token not changed
14.04.2022 11:40:30 : #1: UpdateTeslaToken
14.04.2022 11:40:30 : #1: update tesla_token OK: 1
14.04.2022 11:40:30 : System.AggregateException: One or more errors occurred. (The SSL connection could not be established, see inner exception.) ---> System.Net.Http.HttpRequestException: The SSL connection could not be established, see inner exception. ---> System.Security.Authentication.AuthenticationException: Authentication failed, see inner exception. ---> Mono.Btls.MonoBtlsException: Ssl error:1000007d:SSL routines:OPENSSL_internal:CERTIFICATE_VERIFY_FAILED
14.04.2022 11:40:30 : #1: Restart Car 1
14.04.2022 11:40:30 : #1: Abort: Access Token updated
14.04.2022 11:40:30 : Restart carthread in 30sec
14.04.2022 11:40:31 : #1: HttpStatus: OK
14.04.2022 11:40:31 : #1: refresh_token not changed
14.04.2022 11:40:31 : #1: UpdateTeslaToken
14.04.2022 11:40:31 : #1: update tesla_token OK: 1
14.04.2022 11:40:31 : System.AggregateException: One or more errors occurred. (The SSL connection could not be established, see inner exception.) ---> System.Net.Http.HttpRequestException: The SSL connection could not be established, see inner exception. ---> System.Security.Authentication.AuthenticationException: Authentication failed, see inner exception. ---> Mono.Btls.MonoBtlsException: Ssl error:1000007d:SSL routines:OPENSSL_internal:CERTIFICATE_VERIFY_FAILED
14.04.2022 11:40:31 : #1: Restart Car 1
14.04.2022 11:40:31 : Restart carthread in 30sec
14.04.2022 11:40:31 : #1: Abort: Access Token updated
14.04.2022 11:40:31 : Restart carthread in 29sec
14.04.2022 11:40:32 : Restart carthread in 29sec
14.04.2022 11:40:32 : Restart carthread in 28sec
14.04.2022 11:40:33 : Restart carthread in 28sec
14.04.2022 11:40:33 : Restart carthread in 27sec
14.04.2022 11:40:34 : Restart carthread in 27sec
14.04.2022 11:40:35 : Restart carthread in 26sec
14.04.2022 11:40:35 : Restart carthread in 26sec
14.04.2022 11:40:36 : Restart carthread in 25sec
14.04.2022 11:40:36 : Restart carthread in 25sec
14.04.2022 11:40:37 : Restart carthread in 24sec
14.04.2022 11:40:37 : Restart carthread in 24sec
14.04.2022 11:40:38 : Restart carthread in 23sec
14.04.2022 11:40:38 : Restart carthread in 23sec
14.04.2022 11:40:39 : Restart carthread in 22sec
14.04.2022 11:40:39 : Restart carthread in 22sec
14.04.2022 11:40:40 : Restart carthread in 21sec
14.04.2022 11:40:40 : Restart carthread in 21sec
14.04.2022 11:40:41 : Restart carthread in 20sec
14.04.2022 11:40:41 : Restart carthread in 20sec
14.04.2022 11:40:42 : Restart carthread in 19sec
14.04.2022 11:40:42 : Restart carthread in 19sec
14.04.2022 11:40:43 : Restart carthread in 18sec
14.04.2022 11:40:43 : Restart carthread in 18sec
14.04.2022 11:40:44 : Restart carthread in 17sec
14.04.2022 11:40:44 : Restart carthread in 17sec
14.04.2022 11:40:45 : Restart carthread in 16sec
14.04.2022 11:40:45 : Restart carthread in 16sec
14.04.2022 11:40:46 : Restart carthread in 15sec
14.04.2022 11:40:46 : Restart carthread in 15sec
14.04.2022 11:40:47 : Restart carthread in 14sec
14.04.2022 11:40:47 : Restart carthread in 14sec
14.04.2022 11:40:48 : Restart carthread in 13sec
14.04.2022 11:40:48 : Restart carthread in 13sec
14.04.2022 11:40:49 : Restart carthread in 12sec
14.04.2022 11:40:49 : Restart carthread in 12sec
14.04.2022 11:40:50 : Restart carthread in 11sec
14.04.2022 11:40:50 : Restart carthread in 11sec
14.04.2022 11:40:51 : Restart carthread in 10sec
14.04.2022 11:40:51 : Restart carthread in 10sec
14.04.2022 11:40:52 : Restart carthread in 9sec
14.04.2022 11:40:52 : Restart carthread in 9sec
14.04.2022 11:40:53 : Restart carthread in 8sec
14.04.2022 11:40:53 : Restart carthread in 8sec
14.04.2022 11:40:54 : Restart carthread in 7sec
14.04.2022 11:40:54 : Restart carthread in 7sec
14.04.2022 11:40:55 : Restart carthread in 6sec
14.04.2022 11:40:55 : Restart carthread in 6sec
14.04.2022 11:40:56 : Restart carthread in 5sec
14.04.2022 11:40:56 : Restart carthread in 5sec
14.04.2022 11:40:57 : Restart carthread in 4sec
14.04.2022 11:40:57 : Restart carthread in 4sec
14.04.2022 11:40:58 : Restart carthread in 3sec
14.04.2022 11:40:58 : Restart carthread in 3sec
14.04.2022 11:40:59 : Restart carthread in 2sec
14.04.2022 11:40:59 : Restart carthread in 2sec
14.04.2022 11:41:00 : Restart carthread in 1sec
14.04.2022 11:41:00 : Restart carthread in 1sec
14.04.2022 11:41:01 : Start Car 1
14.04.2022 11:41:01 : #1: CheckUseTaskerToken
14.04.2022 11:41:01 : Start Car 1
14.04.2022 11:41:01 : #1: LastTaskerToken not found - Stop using fast TaskerToken request! Reply: never!
14.04.2022 11:41:01 : #1: CheckUseTaskerToken
14.04.2022 11:41:01 : #1: GetAvgConsumption: sumkm:2993.8 avgkm:176.1 kwh/100km:20.1 avgsocdiff:44.4 maxkm:401.9
14.04.2022 11:41:01 : #1: Restore Token OK. Age: 4/14/2022 11:40:31 AM
14.04.2022 11:41:01 : #1: TOKEN: ####### REDACTED #######
14.04.2022 11:41:01 : #1: LastTaskerToken not found - Stop using fast TaskerToken request! Reply: never!
14.04.2022 11:41:04 : #1: display_name: Jeannie
14.04.2022 11:41:04 : #1: vin: LRW3E7EK3NCXXXXXX
14.04.2022 11:41:04 : #1: id: X29X1XX15XX4X30
14.04.2022 11:41:04 : #1: vehicle_id: X68X1XX51XX8X80X
14.04.2022 11:41:04 : #1: Tasker Config:
14.04.2022 11:41:04 : #1: Economy from DB: 0.137 Wh/km - count: 8
14.04.2022 11:41:09 : #1: Streamingtoken: ####### REDACTED #######
14.04.2022 11:41:15 : Reverse geocoding by Nominatim4
14.04.2022 11:41:15 : #1: Country Code: es
14.04.2022 11:41:15 : #1: Voltage at 50% SOC:0V Date:4/4/2022 10:21:33 AM
14.04.2022 11:41:15 : #1: Car: M3 LR FL - 0.139 Wh/km
14.04.2022 11:41:15 : #1: VIN decoder: Model 3 2022 AWD:True MIC:True battery:NMC motor:Y dual
14.04.2022 11:41:15 : #1: Vehicle Config: car_type:'model3' car_special_type:'base' trim_badging:'74d'
14.04.2022 11:41:15 : #1: No meter config
14.04.2022 11:41:15 : #1: ScanMyTesla FastMode: False
14.04.2022 11:41:15 : #1: StartStream
14.04.2022 11:41:15 : #1: GetAvgConsumption: sumkm:2993.8 avgkm:176.1 kwh/100km:20.1 avgsocdiff:44.4 maxkm:401.9
14.04.2022 11:41:15 : #1: Restore Token OK. Age: 4/14/2022 11:40:31 AM
14.04.2022 11:41:15 : #1: TOKEN: ####### REDACTED #######
14.04.2022 11:41:18 : #1: display_name: Jeannie
14.04.2022 11:41:18 : #1: vin: LRW3E7EK3NCXXXXXX
14.04.2022 11:41:18 : #1: id: X29X1XX15XX4X30
14.04.2022 11:41:18 : #1: vehicle_id: X68X1XX51XX8X80X
14.04.2022 11:41:18 : #1: Tasker Config:
14.04.2022 11:41:18 : #1: Economy from DB: 0.137 Wh/km - count: 8
14.04.2022 11:41:20 : UpdateTripElevation (Task) start:51133 end:51160
14.04.2022 11:41:21 : UpdateTripElevation finished start:51133 end:51160
14.04.2022 11:41:21 : #1: UpdateDriveHeightStatistics(290): 1 rows updated
14.04.2022 11:41:21 : GeocodeCache:Insert
14.04.2022 11:41:21 : Reverse geocoding by Nominatim5
14.04.2022 11:41:22 : #1: change TeslaLogger state: Start -> Online
14.04.2022 11:41:23 : #1: Streamingtoken: ####### REDACTED #######
14.04.2022 11:41:27 : #1: ShiftStateChange: P -> D
14.04.2022 11:41:27 : INFO: ParseVehicleState: unknown key feature_bitmask value <5,0> -System.String
14.04.2022 11:41:28 : Reverse geocoding by Nominatim6
14.04.2022 11:41:28 : #1: Country Code: es
14.04.2022 11:41:28 : #1: Voltage at 50% SOC:0V Date:4/4/2022 10:21:33 AM
14.04.2022 11:41:28 : #1: Car: M3 LR FL - 0.139 Wh/km
14.04.2022 11:41:28 : #1: VIN decoder: Model 3 2022 AWD:True MIC:True battery:NMC motor:Y dual
14.04.2022 11:41:28 : #1: Vehicle Config: car_type:'model3' car_special_type:'base' trim_badging:'74d'
14.04.2022 11:41:28 : #1: No meter config
14.04.2022 11:41:28 : #1: ScanMyTesla FastMode: False
14.04.2022 11:41:28 : #1: StartStream
14.04.2022 11:41:28 : Reverse geocoding by GeocodeCache
14.04.2022 11:41:30 : #1: change TeslaLogger state: Start -> Online
14.04.2022 11:41:34 : INFO: ParseVehicleState: unknown key feature_bitmask value <5,0> -System.String
14.04.2022 11:41:34 : #1: ShiftStateChange: P -> D
14.04.2022 11:41:40 : #1: ScanMyTesla FastMode: True
14.04.2022 11:41:45 : #1: ScanMyTesla FastMode: True
14.04.2022 11:41:45 : #1: change TeslaLogger state: Online -> Drive
14.04.2022 11:41:45 : CombineChangingStates start
14.04.2022 11:41:45 : CombineChangingStates took 0ms
14.04.2022 11:41:45 : GeocodeCache:Insert
14.04.2022 11:41:45 : Reverse geocoding by Nominatim7
14.04.2022 11:41:50 : #1: change TeslaLogger state: Online -> Drive
14.04.2022 11:41:50 : CombineChangingStates start
14.04.2022 11:41:50 : CombineChangingStates took 4ms
14.04.2022 11:41:50 : GeocodeCache:Insert
14.04.2022 11:41:50 : Reverse geocoding by Nominatim8
14.04.2022 11:42:23 : System.Threading.Tasks.TaskCanceledException: The operation was canceled. ---> System.ObjectDisposedException: Cannot access a disposed object.
14.04.2022 11:42:30 : System.Threading.Tasks.TaskCanceledException: The operation was canceled. ---> System.ObjectDisposedException: Cannot access a disposed object.
14.04.2022 11:50:38 : #1: IsDriving = NULL!
14.04.2022 11:51:08 : System.Threading.Tasks.TaskCanceledException: The operation was canceled. ---> System.ObjectDisposedException: Cannot access a disposed object.
14.04.2022 11:51:16 : System.Threading.Tasks.TaskCanceledException: The operation was canceled. ---> System.ObjectDisposedException: Cannot access a disposed object.
14.04.2022 11:51:17 : System.Threading.Tasks.TaskCanceledException: The operation was canceled. ---> System.ObjectDisposedException: Cannot access a disposed object.
14.04.2022 11:51:24 : System.Threading.Tasks.TaskCanceledException: The operation was canceled. ---> System.ObjectDisposedException: Cannot access a disposed object.
14.04.2022 11:51:41 : #1: ShiftStateChange: D -> R
14.04.2022 11:51:41 : #1: ShiftStateChange: D -> R
14.04.2022 11:52:22 : #1: ShiftStateChange: R -> P
14.04.2022 11:52:28 : #1: ShiftStateChange: R -> P
14.04.2022 11:52:29 : #1: change TeslaLogger state: Drive -> Start
14.04.2022 11:52:29 : #1: Request StopStreaming
14.04.2022 11:52:29 : #1: GetAvgConsumption: sumkm:2993.8 avgkm:176.1 kwh/100km:20.1 avgsocdiff:44.4 maxkm:401.9
14.04.2022 11:52:29 : #1: ScanMyTesla FastMode: False
14.04.2022 11:52:29 : #1: ShareData: SendAllChargingData start
14.04.2022 11:52:29 : #1: ShareData: SELECT chargingstate ms: 8
14.04.2022 11:52:29 : #1: ShareData: SendAllChargingData finished
14.04.2022 11:52:29 : Distance: 38.3251977387793 - Radius: 50 - ?? Parking B:SM biotech
14.04.2022 11:52:29 : Reverse geocoding by Geofence
14.04.2022 11:52:29 : UpdateTripElevation (Task) start:51163 end:51308
14.04.2022 11:52:29 : UpdateTripElevation finished start:51163 end:51308
14.04.2022 11:52:29 : #1: UpdateDriveHeightStatistics(291): 1 rows updated
14.04.2022 11:52:30 : #1: change TeslaLogger state: Start -> Online
14.04.2022 11:52:35 : #1: change TeslaLogger state: Drive -> Start
14.04.2022 11:52:35 : #1: Request StopStreaming
14.04.2022 11:52:35 : #1: GetAvgConsumption: sumkm:2993.8 avgkm:176.1 kwh/100km:20.1 avgsocdiff:44.4 maxkm:401.9
14.04.2022 11:52:35 : #1: ScanMyTesla FastMode: False
14.04.2022 11:52:35 : #1: ShareData: SendAllChargingData start
14.04.2022 11:52:35 : #1: ShareData: SELECT chargingstate ms: 8
14.04.2022 11:52:35 : #1: ShareData: SendAllChargingData finished
14.04.2022 11:52:35 : Distance: 38.3251977387793 - Radius: 50 - ?? Parking B:SM biotech
14.04.2022 11:52:35 : Reverse geocoding by Geofence
14.04.2022 11:52:37 : #1: change TeslaLogger state: Start -> Online
14.04.2022 11:52:41 : #1: change TeslaLogger state: Online -> Start
14.04.2022 11:52:41 : #1: Request StopStreaming
14.04.2022 11:52:41 : #1: GetAvgConsumption: sumkm:2993.8 avgkm:176.1 kwh/100km:20.1 avgsocdiff:44.4 maxkm:401.9
14.04.2022 11:52:46 : #1: ScanMyTesla FastMode: False
14.04.2022 11:52:46 : Distance: 38.3251977387793 - Radius: 50 - ?? Parking B:SM biotech
14.04.2022 11:52:46 : Reverse geocoding by Geofence
14.04.2022 11:52:48 : #1: change TeslaLogger state: Start -> Online
14.04.2022 11:52:53 : #1: change TeslaLogger state: Online -> Start
14.04.2022 11:52:53 : #1: Request StopStreaming
14.04.2022 11:52:53 : #1: GetAvgConsumption: sumkm:2993.8 avgkm:176.1 kwh/100km:20.1 avgsocdiff:44.4 maxkm:401.9
14.04.2022 11:52:58 : #1: ScanMyTesla FastMode: False
14.04.2022 11:52:58 : Distance: 38.3251977387793 - Radius: 50 - ?? Parking B:SM biotech
14.04.2022 11:52:58 : Reverse geocoding by Geofence
14.04.2022 11:52:59 : #1: change TeslaLogger state: Start -> Online
14.04.2022 11:59:48 : #1: change TeslaLogger state: Online -> Start
14.04.2022 11:59:48 : #1: change TeslaLogger state: Online -> Start
14.04.2022 11:59:56 : #1: STOP communication with Tesla Server to enter sleep Mode! https://teslalogger.de/faq-1.php
14.04.2022 11:59:56 : #1: STOP communication with Tesla Server to enter sleep Mode! https://teslalogger.de/faq-1.php
14.04.2022 11:59:56 : #1: Waiting for car to go to sleep 0
14.04.2022 11:59:56 : #1: Waiting for car to go to sleep 0
I have the same problem and an idea where it comes from. Just restart TeslaLogger for now, that should solve it for some days
I have the same issue. Restarting Teslalogger does not solve it, not even for a few days. In addition to this, some of my trips get divided into several parts, even though the car never was put in "P". Perhaps wrong DriveStates from the Tesla Server?
fresh token from the Tesla auth app and TL restart fixed it for me
So, new tokens seems to have fixed it for now - can I just go ahead and delete the incorrect drivestate
entries?
That said, would be nice if TeslaLogger could handle these kinds of issues on it's own in the future.
It seems like I have a solution for the duplicate entries. PLEASE MAKE SURE YOU HAVE A BACKUP BEFORE EXECUTING THIS!!!
delete from drivestate where id in
(
SELECT t1.id
from drivestate as t1 join drivestate t2
on t1.carid = t2.carid and t1.StartPos >= t2.StartPos and t1.StartDate < t2.EndDate and t1.id > t2.id
)
EDIT: Query updated to take account for multiply cars in one database and better performance
Executed the query. After checking the trips table now it all looks good.
Yep, the query does the clean up properly apparently. Good solution until a permanent fix will be available.
Logfile
Describe the bug For one day, TeslaLogger duplicated my trips 2-3 times with a slightly varying StartPos but same EndPos. Looking at the
drivestate
table, I can see that the initial (biggest delta betweenStartPos
andEndPos
)drivestate
has values in the following columns, the others do not:outside_temp_avg, speed_max, power_max, power_min, power_avg
All other values seem to be calculated.Here's a full DB example overlapping with the log times above:
CSV:
Markdown:
As mentioned above, this occurred with all trips on that day in a similar fashion.
To Reproduce Unknown.
Expected behavior There should not be any overlapping entries in
drivestate
resulting in duplicate trips.Screenshots
drivestate
table:Trip List showing duplicate trips:
Teslalogger Type
Do you use Tasker or iBeacon No