bassmaster187 / TeslaLogger

TeslaLogger is a self hosted data logger for your Tesla Model S/3/X/Y. Actually it supports RaspberryPi 3B, 3B+, 4B, Docker and Synology NAS.
https://www.teslalogger.de
GNU General Public License v3.0
505 stars 167 forks source link

Duplicate Trips in view due to duplicate drivestate with same EndPos #780

Closed flosoft closed 2 years ago

flosoft commented 2 years ago

Logfile

11.04.2022 21:00:02 : TeslaLogger process statistics
11.04.2022 21:00:04 : #1: IsDriving = NULL!
11.04.2022 21:00:16 : #1: isCharging = NULL
11.04.2022 21:00:20 : #1: isCharging = NULL
11.04.2022 21:00:25 : #1: isCharging = NULL
11.04.2022 21:00:27 : #1: GetOutsideTempAsync: NULL
11.04.2022 21:00:37 : #1: IsDriving = NULL!
11.04.2022 21:00:42 : #1: IsDriving = NULL!
11.04.2022 21:01:50 : #1: IsDriving = NULL!
11.04.2022 21:07:26 : #1: IsDriving = NULL!
11.04.2022 21:09:49 : #1: IsDriving = NULL!
11.04.2022 21:11:23 : #1: IsDriving = NULL!
11.04.2022 21:18:09 : #1: ShiftStateChange: D -> R
11.04.2022 21:18:13 : #1: ShiftStateChange: D -> R
11.04.2022 21:18:26 : #1: ShiftStateChange: R -> D
11.04.2022 21:18:26 : #1: ShiftStateChange: R -> D
11.04.2022 21:18:43 : #1: ShiftStateChange: D -> P
11.04.2022 21:18:43 : #1: ShiftStateChange: D -> P
11.04.2022 21:18:47 : #1: ShiftStateChange: D -> P
11.04.2022 21:18:49 : #1: change TeslaLogger state: Drive -> Start
11.04.2022 21:18:49 : #1: Request StopStreaming
11.04.2022 21:18:49 : #1: GetAvgConsumption: sumkm:2401.6 avgkm:171.5 kwh/100km:19.9 avgsocdiff:42.7 maxkm:406.7
11.04.2022 21:18:49 : #1: ScanMyTesla FastMode: False
11.04.2022 21:18:49 : #1: ShareData: SendAllChargingData start
11.04.2022 21:18:49 : #1: ShareData: SELECT chargingstate ms: 4
11.04.2022 21:18:50 : #1: ShareData: Insert OK:159333
11.04.2022 21:18:50 : #1: ShareData: SendAllChargingData finished
11.04.2022 21:18:50 : #1: change TeslaLogger state: Drive -> Start
11.04.2022 21:18:50 : #1: Request StopStreaming
11.04.2022 21:18:50 : #1: GetAvgConsumption: sumkm:2401.6 avgkm:171.5 kwh/100km:19.9 avgsocdiff:42.7 maxkm:406.7
11.04.2022 21:18:50 : #1: ScanMyTesla FastMode: False
11.04.2022 21:18:50 : #1: ShareData: SendAllChargingData start
11.04.2022 21:18:50 : #1: ShareData: SELECT chargingstate ms: 4
11.04.2022 21:18:50 : #1: ShareData: SendAllChargingData finished
11.04.2022 21:18:54 : UpdateTripElevation (Task) start:48407 end:50194
11.04.2022 21:18:56 : GeocodeCache:Insert
11.04.2022 21:18:56 : Reverse geocoding by Nominatim64
11.04.2022 21:18:56 : UpdateTripElevation ID:48657
11.04.2022 21:18:56 : Column 'lat, lng' is constrained to be unique.  Value '41.417535, 2.224563' is already present.
11.04.2022 21:18:56 : Reverse geocoding by Nominatim65
11.04.2022 21:18:57 : UpdateTripElevation ID:48908
11.04.2022 21:18:58 : #1: change TeslaLogger state: Drive -> Start
11.04.2022 21:18:58 : #1: Request StopStreaming
11.04.2022 21:18:58 : #1: GetAvgConsumption: sumkm:2993.8 avgkm:176.1 kwh/100km:20.1 avgsocdiff:44.4 maxkm:401.9
11.04.2022 21:18:58 : #1: ScanMyTesla FastMode: False
11.04.2022 21:18:58 : #1: ShareData: SendAllChargingData start
11.04.2022 21:18:58 : #1: ShareData: SELECT chargingstate ms: 4
11.04.2022 21:18:58 : #1: ShareData: SendAllChargingData finished
11.04.2022 21:18:58 : Reverse geocoding by GeocodeCache
11.04.2022 21:18:58 : UpdateTripElevation ID:49159
11.04.2022 21:18:59 : UpdateTripElevation ID:49410
11.04.2022 21:19:00 : #1: change TeslaLogger state: Start -> Online
11.04.2022 21:19:01 : UpdateTripElevation ID:49661
11.04.2022 21:19:02 : UpdateTripElevation ID:49912
11.04.2022 21:19:03 : #1: change TeslaLogger state: Start -> Online
11.04.2022 21:19:03 : UpdateTripElevation ID:50163
11.04.2022 21:19:03 : UpdateTripElevation finished start:48407 end:50194
11.04.2022 21:19:03 : #1: UpdateDriveHeightStatistics(278): 1 rows updated
11.04.2022 21:19:04 : #1: change TeslaLogger state: Start -> Online
11.04.2022 21:19:20 : Checking TeslaLogger online update (current version: 1.52.5.0) ...
11.04.2022 21:19:20 : TeslaLogger is up to date (current version: 1.52.5.0, latest version online: 1.52.5.0, update policy: all)
11.04.2022 21:19:25 : #1: IsDriving = NULL!
11.04.2022 21:22:54 : #1: isCharging = NULL
11.04.2022 21:23:11 : #1: isCharging = NULL
11.04.2022 21:24:25 : #1: change TeslaLogger state: Online -> Start
11.04.2022 21:24:32 : #1: Reason:is_user_present prevents car to get sleep
11.04.2022 21:24:37 : #1: ScanMyTesla FastMode: False
11.04.2022 21:24:37 : Reverse geocoding by GeocodeCache
11.04.2022 21:24:39 : #1: change TeslaLogger state: Start -> Online
11.04.2022 21:24:49 : #1: change TeslaLogger state: Online -> Start
11.04.2022 21:25:05 : #1: Reason:is_user_present prevents car to get sleep
11.04.2022 21:25:06 : #1: ShiftStateChange: P -> R
11.04.2022 21:25:10 : #1: ScanMyTesla FastMode: False
11.04.2022 21:25:11 : #1: ShiftStateChange: P -> D
11.04.2022 21:25:12 : #1: ScanMyTesla FastMode: True
11.04.2022 21:25:12 : #1: Missing: 0.0130003057752219 km
11.04.2022 21:25:16 : GeocodeCache:Insert
11.04.2022 21:25:16 : Reverse geocoding by Nominatim66
11.04.2022 21:25:17 : #1: change TeslaLogger state: Online -> Drive
11.04.2022 21:25:17 : CombineChangingStates start
11.04.2022 21:25:17 : #1: change TeslaLogger state: Start -> Online
11.04.2022 21:25:17 : CombineChangingStates took 4ms
11.04.2022 21:25:17 : GeocodeCache:Insert
11.04.2022 21:25:17 : Reverse geocoding by Nominatim67
11.04.2022 21:25:18 : #1: ScanMyTesla FastMode: True
11.04.2022 21:25:18 : #1: Missing: 0.024000193120628 km
11.04.2022 21:25:21 : #1: ShiftStateChange: P -> D
11.04.2022 21:25:21 : #1: ShiftStateChange: R -> D
11.04.2022 21:25:23 : #1: change TeslaLogger state: Online -> Drive
11.04.2022 21:25:23 : CombineChangingStates start
11.04.2022 21:25:23 : CombineChangingStates took 4ms
11.04.2022 21:25:23 : GeocodeCache:Insert
11.04.2022 21:25:23 : Reverse geocoding by Nominatim68
11.04.2022 21:25:39 : #1: ScanMyTesla FastMode: True
11.04.2022 21:25:39 : #1: Missing: 0.180000643737912 km
11.04.2022 21:25:44 : #1: change TeslaLogger state: Online -> Drive
11.04.2022 21:25:44 : CombineChangingStates start
11.04.2022 21:25:44 : CombineChangingStates took 8ms
11.04.2022 21:25:45 : GeocodeCache:Insert
11.04.2022 21:25:45 : Reverse geocoding by Nominatim69
11.04.2022 21:28:42 : #1: IsDriving = NULL!
11.04.2022 21:32:08 : #1: isCharging = NULL
11.04.2022 21:32:09 : #1: isCharging = NULL
11.04.2022 21:32:18 : #1: Result.Statuscode: 404 (NotFound) cmd: charge_state Retry: 1
11.04.2022 21:32:19 : #1: isCharging = NULL
11.04.2022 21:32:29 : #1: IsDriving = NULL!
11.04.2022 21:32:30 : #1: IsDriving = NULL!
11.04.2022 21:32:40 : #1: IsDriving = NULL!
11.04.2022 21:33:00 : #1: IsDriving = NULL!
11.04.2022 21:33:16 : #1: isCharging = NULL
11.04.2022 21:33:21 : #1: isCharging = NULL
11.04.2022 21:33:37 : #1: IsDriving = NULL!
11.04.2022 21:33:44 : #1: IsDriving = NULL!
11.04.2022 21:34:04 : #1: IsDriving = NULL!
11.04.2022 21:34:05 : #1: isCharging = NULL
11.04.2022 21:34:05 : #1: GetOutsideTempAsync: NULL
11.04.2022 21:34:16 : #1: GetOutsideTempAsync: NULL
11.04.2022 21:34:16 : #1: IsDriving = NULL!
11.04.2022 21:34:25 : #1: Result.Statuscode: 404 (NotFound) cmd: charge_state Retry: 1
11.04.2022 21:34:26 : #1: IsDriving = NULL!
11.04.2022 21:34:26 : #1: isCharging = NULL
11.04.2022 21:34:37 : #1: isCharging = NULL
11.04.2022 21:34:37 : #1: GetOutsideTempAsync: NULL
11.04.2022 21:34:42 : #1: ShiftStateChange: D -> R
11.04.2022 21:34:54 : #1: IsDriving = NULL!
11.04.2022 21:34:57 : #1: ShiftStateChange: D -> R
11.04.2022 21:35:08 : #1: IsDriving = NULL!
11.04.2022 21:35:14 : #1: ShiftStateChange: D -> R
11.04.2022 21:35:24 : #1: ShiftStateChange: R -> P
11.04.2022 21:35:29 : #1: ShiftStateChange: R -> P
11.04.2022 21:35:32 : #1: ShiftStateChange: R -> P
11.04.2022 21:35:34 : #1: change TeslaLogger state: Drive -> Start
11.04.2022 21:35:34 : #1: Request StopStreaming
11.04.2022 21:35:34 : #1: GetAvgConsumption: sumkm:2993.8 avgkm:176.1 kwh/100km:20.1 avgsocdiff:44.4 maxkm:401.9
11.04.2022 21:35:34 : #1: ScanMyTesla FastMode: False
11.04.2022 21:35:34 : #1: ShareData: SendAllChargingData start
11.04.2022 21:35:34 : #1: ShareData: SELECT chargingstate ms: 4
11.04.2022 21:35:34 : #1: ShareData: SendAllChargingData finished
11.04.2022 21:35:34 : Distance: 13.7579858636436 - Radius: 50 - ?? Parking B:SM biotech
11.04.2022 21:35:34 : Reverse geocoding by Geofence
11.04.2022 21:35:34 : UpdateTripElevation (Task) start:50203 end:50338
11.04.2022 21:35:35 : UpdateTripElevation finished start:50203 end:50338
11.04.2022 21:35:35 : #1: UpdateDriveHeightStatistics(281): 1 rows updated
11.04.2022 21:35:37 : #1: change TeslaLogger state: Start -> Online
11.04.2022 21:35:37 : #1: change TeslaLogger state: Drive -> Start
11.04.2022 21:35:37 : #1: Request StopStreaming
11.04.2022 21:35:37 : #1: GetAvgConsumption: sumkm:2993.8 avgkm:176.1 kwh/100km:20.1 avgsocdiff:44.4 maxkm:401.9
11.04.2022 21:35:37 : #1: ScanMyTesla FastMode: False
11.04.2022 21:35:37 : #1: ShareData: SendAllChargingData start
11.04.2022 21:35:37 : #1: ShareData: SELECT chargingstate ms: 0
11.04.2022 21:35:37 : #1: ShareData: SendAllChargingData finished
11.04.2022 21:35:37 : Distance: 13.7579858636436 - Radius: 50 - ?? Parking B:SM biotech
11.04.2022 21:35:37 : Reverse geocoding by Geofence
11.04.2022 21:35:39 : #1: change TeslaLogger state: Start -> Online
11.04.2022 21:35:42 : #1: change TeslaLogger state: Drive -> Start
11.04.2022 21:35:42 : #1: Request StopStreaming
11.04.2022 21:35:42 : #1: GetAvgConsumption: sumkm:2993.8 avgkm:176.1 kwh/100km:20.1 avgsocdiff:44.4 maxkm:401.9
11.04.2022 21:35:42 : #1: ScanMyTesla FastMode: False
11.04.2022 21:35:42 : #1: ShareData: SendAllChargingData start
11.04.2022 21:35:42 : #1: ShareData: SELECT chargingstate ms: 4
11.04.2022 21:35:42 : #1: ShareData: SendAllChargingData finished
11.04.2022 21:35:42 : Distance: 13.7579858636436 - Radius: 50 - ?? Parking B:SM biotech
11.04.2022 21:35:42 : Reverse geocoding by Geofence
11.04.2022 21:35:44 : #1: change TeslaLogger state: Start -> Online
11.04.2022 21:37:03 : #1: IsDriving = NULL!
11.04.2022 21:37:05 : #1: IsDriving = NULL!
11.04.2022 21:37:07 : #1: IsDriving = NULL!
11.04.2022 21:37:24 : #1: isCharging = NULL
11.04.2022 21:37:26 : #1: isCharging = NULL
11.04.2022 21:37:28 : #1: isCharging = NULL
11.04.2022 21:38:15 : #1: IsDriving = NULL!
11.04.2022 21:38:17 : #1: IsDriving = NULL!
11.04.2022 21:38:18 : #1: IsDriving = NULL!
11.04.2022 21:38:37 : #1: isCharging = NULL
11.04.2022 21:38:38 : #1: isCharging = NULL
11.04.2022 21:38:39 : #1: isCharging = NULL
11.04.2022 21:38:48 : #1: GetOutsideTempAsync: NULL
11.04.2022 21:38:49 : #1: GetOutsideTempAsync: NULL
11.04.2022 21:38:50 : #1: GetOutsideTempAsync: NULL
11.04.2022 21:39:51 : #1: change TeslaLogger state: Online -> Start
11.04.2022 21:39:51 : #1: Request StopStreaming
11.04.2022 21:39:51 : #1: GetAvgConsumption: sumkm:2993.8 avgkm:176.1 kwh/100km:20.1 avgsocdiff:44.4 maxkm:401.9
11.04.2022 21:39:51 : #1: change TeslaLogger state: Online -> Start
11.04.2022 21:39:51 : #1: Request StopStreaming
11.04.2022 21:39:51 : #1: GetAvgConsumption: sumkm:2993.8 avgkm:176.1 kwh/100km:20.1 avgsocdiff:44.4 maxkm:401.9
11.04.2022 21:39:51 : #1: ScanMyTesla FastMode: False
11.04.2022 21:39:51 : Distance: 13.7579858636436 - Radius: 50 - ?? Parking B:SM biotech
11.04.2022 21:39:51 : Reverse geocoding by Geofence
11.04.2022 21:39:52 : #1: ScanMyTesla FastMode: False
11.04.2022 21:39:52 : Distance: 13.7579858636436 - Radius: 50 - ?? Parking B:SM biotech
11.04.2022 21:39:52 : Reverse geocoding by Geofence
11.04.2022 21:39:53 : #1: change TeslaLogger state: Start -> Online
11.04.2022 21:39:53 : #1: change TeslaLogger state: Start -> Online
11.04.2022 21:39:56 : #1: change TeslaLogger state: Online -> Start
11.04.2022 21:39:56 : #1: Request StopStreaming
11.04.2022 21:39:56 : #1: GetAvgConsumption: sumkm:2993.8 avgkm:176.1 kwh/100km:20.1 avgsocdiff:44.4 maxkm:401.9
11.04.2022 21:39:57 : #1: ScanMyTesla FastMode: False
11.04.2022 21:39:57 : Distance: 13.7579858636436 - Radius: 50 - ?? Parking B:SM biotech
11.04.2022 21:39:57 : Reverse geocoding by Geofence
11.04.2022 21:39:58 : #1: change TeslaLogger state: Start -> Online
11.04.2022 21:41:05 : #1: isCharging = NULL
11.04.2022 21:41:08 : #1: IsDriving = NULL!
11.04.2022 21:41:11 : #1: IsDriving = NULL!
11.04.2022 21:41:44 : #1: Charging! Voltage: 234V / Power: 0kW / Timestamp: 1649706103941 / Date: 2022-04-11 21:41:43
11.04.2022 21:41:48 : #1: Charging! Voltage: 231V / Power: 1kW / Timestamp: 1649706108202 / Date: 2022-04-11 21:41:48
11.04.2022 21:41:48 : #1: Charging
11.04.2022 21:41:48 : #1: ScanMyTesla FastMode: True
11.04.2022 21:41:52 : #1: Charging! Voltage: 219V / Power: 4kW / Timestamp: 1649706111970 / Date: 2022-04-11 21:41:51
11.04.2022 21:41:52 : #1: Charging
11.04.2022 21:41:52 : #1: ScanMyTesla FastMode: True
11.04.2022 21:41:57 : Distance: 13.7579858636436 - Radius: 50 - ?? Parking B:SM biotech
11.04.2022 21:41:57 : Reverse geocoding by Geofence
11.04.2022 21:41:57 : #1: change TeslaLogger state: Online -> Charge
11.04.2022 21:42:02 : #1: Charging! Voltage: 218V / Power: 4kW / Timestamp: 1649706121107 / Date: 2022-04-11 21:42:01
11.04.2022 21:42:02 : #1: Charging
11.04.2022 21:42:02 : #1: ScanMyTesla FastMode: True
11.04.2022 21:42:02 : Distance: 13.7579858636436 - Radius: 50 - ?? Parking B:SM biotech
11.04.2022 21:42:02 : Reverse geocoding by Geofence
11.04.2022 21:42:02 : #1: change TeslaLogger state: Online -> Charge
11.04.2022 21:42:12 : Distance: 13.7579858636436 - Radius: 50 - ?? Parking B:SM biotech
11.04.2022 21:42:12 : Reverse geocoding by Geofence
11.04.2022 21:42:12 : #1: change TeslaLogger state: Online -> Charge
11.04.2022 21:42:27 : #1: StartChargingState Task start
11.04.2022 21:42:27 : #1: StartChargingState Task latestPos: 50349
11.04.2022 21:42:28 : #1: isCharging = NULL
11.04.2022 21:42:32 : #1: StartChargingState Task start
11.04.2022 21:42:32 : #1: StartChargingState Task latestPos: 50349
11.04.2022 21:42:35 : #1: StartChargingState Task newPos: 50350
11.04.2022 21:42:35 : #1: StartChargingState Task (poslng, poslat, chglng, chglat) (2.1944, 41.38536, 2.1944, 41.38536)
11.04.2022 21:42:35 : #1: StartChargingState Task distance: 0
11.04.2022 21:42:41 : #1: StartChargingState Task newPos: 50351
11.04.2022 21:42:41 : #1: StartChargingState Task (poslng, poslat, chglng, chglat) (2.1944, 41.38536, 2.1944, 41.38536)
11.04.2022 21:42:41 : #1: StartChargingState Task distance: 0
11.04.2022 21:42:42 : #1: StartChargingState Task start
11.04.2022 21:42:42 : #1: StartChargingState Task latestPos: 50351
11.04.2022 21:42:51 : #1: StartChargingState Task newPos: 50352
11.04.2022 21:42:51 : #1: StartChargingState Task (poslng, poslat, chglng, chglat) (2.1944, 41.38536, 2.1944, 41.38536)
11.04.2022 21:42:51 : #1: StartChargingState Task distance: 0
11.04.2022 21:44:36 : #1: isCharging = NULL
11.04.2022 21:50:54 : #1: isCharging = NULL
11.04.2022 21:50:54 : #1: isCharging = NULL
11.04.2022 21:56:01 : #1: isCharging = NULL
11.04.2022 21:57:17 : #1: isCharging = NULL
11.04.2022 21:58:31 : #1: isCharging = NULL

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 between StartPos and EndPos) 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:

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
283,2022-04-11 21:25:39,50210,2022-04-11 21:35:20,50338,,,,,,68,65,2.72800746738,1.47899962984,1.93800473148,16,5,1
282,2022-04-11 21:25:18,50204,2022-04-11 21:35:20,50338,,,,,,69,68,2.71200733863,1.49199993562,2.09700500507,16,5,1
281,2022-04-11 21:25:12,50203,2022-04-11 21:35:20,50338,15,122,378,-99,6.8897,69,68,2.71200733863,1.49199993562,2.10800489242,16,5,1

Markdown:

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
283 2022-04-11 21:25:39 50210 2022-04-11 21:35:20 50338 68 65 2.72800746738 1.47899962984 1.93800473148 16 5 1
282 2022-04-11 21:25:18 50204 2022-04-11 21:35:20 50338 69 68 2.71200733863 1.49199993562 2.09700500507 16 5 1
281 2022-04-11 21:25:12 50203 2022-04-11 21:35:20 50338 15 122 378 -99 6.8897 69 68 2.71200733863 1.49199993562 2.10800489242 16 5 1

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:

163268149-73ef003f-5304-4e73-8f6d-8c60941a550f

Trip List showing duplicate trips: 9cf1d25026fc17fc9e87842dac70f801f1bddd44

Teslalogger Type

Do you use Tasker or iBeacon No

flosoft commented 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
superfloh247 commented 2 years ago

I have the same problem and an idea where it comes from. Just restart TeslaLogger for now, that should solve it for some days

RetoHB commented 2 years ago

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?

superfloh247 commented 2 years ago

fresh token from the Tesla auth app and TL restart fixed it for me

flosoft commented 2 years ago

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.

bassmaster187 commented 2 years ago

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 
)
bassmaster187 commented 2 years ago

EDIT: Query updated to take account for multiply cars in one database and better performance

flosoft commented 2 years ago

Executed the query. After checking the trips table now it all looks good.

rsnbrgj commented 2 years ago

Yep, the query does the clean up properly apparently. Good solution until a permanent fix will be available.