Closed lebetz closed 1 year ago
Can confirm. Last Entry in Trips on 20.10.2022
I did a clean install, but yes it does not record trips anymore.
After Debugging a trip i can see the following:
2022-11-03 07:59:33,900 :: DEBUG :: vin:VXKU longitude:7.52437 latitude:51.51256 date:2022-10-20 15:41:07+00:00 mileage:12466.8 level:51.0 charge_date:2022-11-03 06:58:40+00:00 level_fuel:None moving:True
2022-11-03 08:01:33,957 :: DEBUG :: vin:VXKU longitude:7.52437 latitude:51.51256 date:2022-10-20 15:41:07+00:00 mileage:12470.3 level:49.0 charge_date:2022-11-03 07:01:01+00:00 level_fuel:None moving:True
2022-11-03 08:03:33,988 :: DEBUG :: vin:VXKU longitude:7.52437 latitude:51.51256 date:2022-10-20 15:41:07+00:00 mileage:12473.8 level:48.0 charge_date:2022-11-03 07:02:40+00:00 level_fuel:None moving:True
2022-11-03 08:05:32,665 :: DEBUG :: vin:VXKU longitude:7.52437 latitude:51.51256 date:2022-10-20 15:41:07+00:00 mileage:12477.3 level:47.0 charge_date:2022-11-03 07:04:40+00:00 level_fuel:None moving:True
2022-11-03 08:05:33,917 :: DEBUG :: vin:VXKU longitude:7.52437 latitude:51.51256 date:2022-10-20 15:41:07+00:00 mileage:12477.3 level:47.0 charge_date:2022-11-03 07:04:40+00:00 level_fuel:None moving:True
2022-11-03 08:07:33,963 :: DEBUG :: vin:VXKU longitude:7.52437 latitude:51.51256 date:2022-10-20 15:41:07+00:00 mileage:12480.9 level:46.0 charge_date:2022-11-03 07:06:40+00:00 level_fuel:None moving:True
2022-11-03 08:09:33,994 :: DEBUG :: vin:VXKU longitude:7.52437 latitude:51.51256 date:2022-10-20 15:41:07+00:00 mileage:12483.8 level:45.0 charge_date:2022-11-03 07:08:41+00:00 level_fuel:None moving:True
2022-11-03 08:10:32,662 :: DEBUG :: vin:VXKU longitude:7.52437 latitude:51.51256 date:2022-10-20 15:41:07+00:00 mileage:12485.5 level:45.0 charge_date:2022-11-03 07:09:41+00:00 level_fuel:None moving:True
2022-11-03 08:12:34,290 :: DEBUG :: vin:VXKU longitude:7.52437 latitude:51.51256 date:2022-10-20 15:41:07+00:00 mileage:12486.8 level:44.0 charge_date:2022-11-03 07:11:42+00:00 level_fuel:None moving:True
2022-11-03 08:13:33,966 :: DEBUG :: vin:VXKU longitude:7.52437 latitude:51.51256 date:2022-10-20 15:41:07+00:00 mileage:12487.8 level:44.0 charge_date:2022-11-03 07:12:40+00:00 level_fuel:None moving:True
2022-11-03 08:15:32,865 :: DEBUG :: vin:VXKU longitude:7.52437 latitude:51.51256 date:2022-10-20 15:41:07+00:00 mileage:12488.9 level:44.0 charge_date:2022-11-03 07:14:40+00:00 level_fuel:None moving:True
2022-11-03 08:15:34,036 :: DEBUG :: vin:VXKU longitude:7.52437 latitude:51.51256 date:2022-10-20 15:41:07+00:00 mileage:12488.9 level:44.0 charge_date:2022-11-03 07:14:40+00:00 level_fuel:None moving:True
2022-11-03 08:17:33,904 :: DEBUG :: vin:VXKU longitude:7.52437 latitude:51.51256 date:2022-10-20 15:41:07+00:00 mileage:12489.1 level:44.0 charge_date:2022-11-03 07:16:40+00:00 level_fuel:None moving:True
2022-11-03 08:19:34,038 :: DEBUG :: vin:VXKU longitude:7.52437 latitude:51.51256 date:2022-10-20 15:41:07+00:00 mileage:12489.1 level:44.0 charge_date:2022-11-03 07:16:40+00:00 level_fuel:None moving:True
2022-11-03 08:20:32,693 :: DEBUG :: vin:VXKU longitude:7.52437 latitude:51.51256 date:2022-10-20 15:41:07+00:00 mileage:12489.1 level:44.0 charge_date:2022-11-03 07:16:40+00:00 level_fuel:None moving:True
2022-11-03 08:21:33,963 :: DEBUG :: vin:VXKU longitude:7.52437 latitude:51.51256 date:2022-10-20 15:41:07+00:00 mileage:12489.1 level:44.0 charge_date:2022-11-03 07:16:40+00:00 level_fuel:None moving:True
2022-11-03 08:23:33,994 :: DEBUG :: vin:VXKU longitude:7.52437 latitude:51.51256 date:2022-10-20 15:41:07+00:00 mileage:12489.1 level:44.0 charge_date:2022-11-03 07:16:40+00:00 level_fuel:None moving:True
2022-11-03 08:25:32,638 :: DEBUG :: vin:VXKU longitude:7.52437 latitude:51.51256 date:2022-10-20 15:41:07+00:00 mileage:12489.1 level:44.0 charge_date:2022-11-03 07:16:40+00:00 level_fuel:None moving:True
2022-11-03 08:25:33,941 :: DEBUG :: vin:VXKU longitude:7.52437 latitude:51.51256 date:2022-10-20 15:41:07+00:00 mileage:12489.1 level:44.0 charge_date:2022-11-03 07:16:40+00:00 level_fuel:None moving:True
2022-11-03 08:27:34,004 :: DEBUG :: vin:VXKU longitude:7.52437 latitude:51.51256 date:2022-10-20 15:41:07+00:00 mileage:12489.1 level:44.0 charge_date:2022-11-03 07:16:40+00:00 level_fuel:None moving:True
2022-11-03 08:29:34,260 :: DEBUG :: vin:VXKU longitude:7.52437 latitude:51.51256 date:2022-10-20 15:41:07+00:00 mileage:12489.1 level:44.0 charge_date:2022-11-03 07:16:40+00:00 level_fuel:None moving:True
2022-11-03 08:30:32,600 :: DEBUG :: vin:VXKU longitude:7.52437 latitude:51.51256 date:2022-10-20 15:41:07+00:00 mileage:12489.1 level:44.0 charge_date:2022-11-03 07:16:40+00:00 level_fuel:None moving:True
2022-11-03 08:31:33,980 :: DEBUG :: vin:VXKU longitude:7.52437 latitude:51.51256 date:2022-10-20 15:41:07+00:00 mileage:12489.1 level:44.0 charge_date:2022-11-03 07:16:40+00:00 level_fuel:None moving:True
2022-11-03 08:33:34,560 :: DEBUG :: vin:VXKU longitude:7.52437 latitude:51.51256 date:2022-10-20 15:41:07+00:00 mileage:12489.1 level:44.0 charge_date:2022-11-03 07:16:40+00:00 level_fuel:None moving:True
2022-11-03 08:35:32,641 :: DEBUG :: vin:VXKU longitude:7.52437 latitude:51.51256 date:2022-10-20 15:41:07+00:00 mileage:12489.1 level:44.0 charge_date:2022-11-03 07:16:40+00:00 level_fuel:None moving:True
2022-11-03 08:35:34,001 :: DEBUG :: vin:VXKU longitude:7.52437 latitude:51.51256 date:2022-10-20 15:41:07+00:00 mileage:12489.1 level:44.0 charge_date:2022-11-03 07:16:40+00:00 level_fuel:None moving:True
2022-11-03 08:37:34,012 :: DEBUG :: vin:VXKU longitude:7.52437 latitude:51.51256 date:2022-10-20 15:41:07+00:00 mileage:12489.1 level:44.0 charge_date:2022-11-03 07:16:40+00:00 level_fuel:None moving:True
2022-11-03 08:39:33,989 :: DEBUG :: vin:VXKU longitude:7.52437 latitude:51.51256 date:2022-10-20 15:41:07+00:00 mileage:12489.1 level:44.0 charge_date:2022-11-03 07:16:40+00:00 level_fuel:None moving:True
2022-11-03 08:40:32,624 :: DEBUG :: vin:VXKU longitude:7.52437 latitude:51.51256 date:2022-10-20 15:41:07+00:00 mileage:12489.1 level:44.0 charge_date:2022-11-03 07:16:40+00:00 level_fuel:None moving:True
2022-11-03 08:41:33,985 :: DEBUG :: vin:VXKU longitude:7.52437 latitude:51.51256 date:2022-10-20 15:41:07+00:00 mileage:12489.1 level:44.0 charge_date:2022-11-03 07:16:40+00:00 level_fuel:None moving:True
2022-11-03 08:43:34,007 :: DEBUG :: vin:VXKU longitude:7.52437 latitude:51.51256 date:2022-10-20 15:41:07+00:00 mileage:12489.1 level:44.0 charge_date:2022-11-03 07:16:40+00:00 level_fuel:None moving:True
2022-11-03 08:45:32,706 :: DEBUG :: vin:VXKU longitude:7.52437 latitude:51.51256 date:2022-10-20 15:41:07+00:00 mileage:12489.1 level:44.0 charge_date:2022-11-03 07:16:40+00:00 level_fuel:None moving:True
2022-11-03 08:45:33,958 :: DEBUG :: vin:VXKU longitude:7.52437 latitude:51.51256 date:2022-10-20 15:41:07+00:00 mileage:12489.1 level:44.0 charge_date:2022-11-03 07:16:40+00:00 level_fuel:None moving:True
2022-11-03 08:47:33,998 :: DEBUG :: vin:VXKU longitude:7.52437 latitude:51.51256 date:2022-10-20 15:41:07+00:00 mileage:12489.1 level:44.0 charge_date:2022-11-03 07:16:40+00:00 level_fuel:None moving:True
2022-11-03 08:49:34,005 :: DEBUG :: vin:VXKU longitude:7.52437 latitude:51.51256 date:2022-10-20 15:41:07+00:00 mileage:12489.1 level:44.0 charge_date:2022-11-03 07:16:40+00:00 level_fuel:None moving:True
2022-11-03 08:50:32,619 :: DEBUG :: vin:VXKU longitude:7.52437 latitude:51.51256 date:2022-10-20 15:41:07+00:00 mileage:12489.1 level:44.0 charge_date:2022-11-03 07:16:40+00:00 level_fuel:None moving:True
2022-11-03 08:51:33,986 :: DEBUG :: vin:VXKU longitude:7.52437 latitude:51.51256 date:2022-10-20 15:41:07+00:00 mileage:12489.1 level:44.0 charge_date:2022-11-03 07:16:40+00:00 level_fuel:None moving:True
2022-11-03 08:53:33,988 :: DEBUG :: vin:VXKU longitude:7.52437 latitude:51.51256 date:2022-10-20 15:41:07+00:00 mileage:12489.1 level:44.0 charge_date:2022-11-03 07:16:40+00:00 level_fuel:None moving:True
2022-11-03 08:55:32,653 :: DEBUG :: vin:VXKU longitude:7.52437 latitude:51.51256 date:2022-10-20 15:41:07+00:00 mileage:12489.1 level:44.0 charge_date:2022-11-03 07:16:40+00:00 level_fuel:None moving:True
2022-11-03 08:55:34,075 :: DEBUG :: vin:VXKU longitude:7.52437 latitude:51.51256 date:2022-10-20 15:41:07+00:00 mileage:12489.1 level:44.0 charge_date:2022-11-03 07:16:40+00:00 level_fuel:None moving:True
2022-11-03 08:57:34,004 :: DEBUG :: vin:VXKU longitude:7.52437 latitude:51.51256 date:2022-10-20 15:41:07+00:00 mileage:12489.1 level:44.0 charge_date:2022-11-03 07:16:40+00:00 level_fuel:None moving:True
It stuck on the same long/latitude + Date from 20.10.2022, but as you can see mileage + level changed. I think the broken long/latitude cause the issue @flobz can you take a look at it?
Can confirm. Last Entry in Trips on 20.10.2022
even a reinstall and re-auth does not help. any news?
Longitude and latitude are fixed. So it's duplicate with #50
@flobz
yes it might be #50 but it should still track the rides w/o position. I have done trips today but they don't have stored
Trips recording needs position changed. So it's a normal behavior.
@flobz: But I do not have a GPS in the car so it cannot send the position. But trip recording was working in the past. Will check tomorrow, if the new version fixes the problem...
@flobz
I tested today: still no trips with new version. Was working till 20.10.2022. As mentioned, I have no GPS in the Opel. Can I do anything to debug the issue? Can we reopen the issue because it isn't fixed yet?
Trips recording needs position changed. So it's a normal behavior.
Since GPS is broken again may be you should offer a option to just capture it by KM + Date/Time
@flobz I analyzed a little bit more and found the reason for the problem.
date = car.status.last_position.properties.updated_at
if date is None or date < datetime.now(timezone.utc) - timedelta(days=1): # if position isn't updated
date = car.status.service.updated_at
Without GPS I have no last position so it falls back to updatedAt of the service. But updatedAt of the service is frozen since 2012-10-20. I changed the fallback line now to date = charge_date
which seems to be updated.
Now it seems that I get entries again in database.
@flobz Could you please re-open this issue? See comment above.
A lot of cars do not provide the coordinates because of some PSA-related problems and since the updated_at property seems to be frozen since October it's not recording any trips at all. :/
@flobz please re-open this issue, I'm not able to record trips anymore because of this bug :(
I will follow fix this in next version.
any updates here? Is there a date for the next version?
just apply the lebetz fix editing /usr/local/lib/python3.9/dist-packages/psa_car_controller/psacc/application/psa_client.py and re authenticate to have new trips recorded in the meantime!
@flobz I analyzed a little bit more and found the reason for the problem.
date = car.status.last_position.properties.updated_at if date is None or date < datetime.now(timezone.utc) - timedelta(days=1): # if position isn't updated date = car.status.service.updated_at
Without GPS I have no last position so it falls back to updatedAt of the service. But updatedAt of the service is frozen since 2012-10-20. I changed the fallback line now to
date = charge_date
which seems to be updated. Now it seems that I get entries again in database.
Hi, please could you explain where we need change the valor? I don't understend what line I need modify. Thankyou
And how i Can modify this file? I can't acces this.
Ssh to the raspberry and edit the file wtih nano or vi...
See: https://github.com/flobz/psa_car_controller/issues/415#issuecomment-1353834251
=> Attention: Maybe you have python3.7...
new year....and it still dont work....no even charging record work anymore
The controller still records charging events in the database. But it shows nothing on UI (to few data) and also does not record any trips. Everything was working fine till 20.10.2022. These are the logs: