Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Location update is lost during the last updates #400

Closed
synack666 opened this issue Apr 17, 2024 · 28 comments
Closed

Location update is lost during the last updates #400

synack666 opened this issue Apr 17, 2024 · 28 comments
Labels
more info needed Further information is requested

Comments

@synack666
Copy link

Describe the bug
during the last updates the location update is not working anymore, the car is always at home
To Reproduce

Your Vehicle Details
Model: S4
Year: 2018

@Kolbi
Copy link
Contributor

Kolbi commented Apr 18, 2024

Can you please provide a log?

Logfile
How to enable audiconnect debugging?
Settings > Integrations > Audi Connect > Enable Debug Logging
Run service refresh_cloud_data
Disable Debug Logging

@synack666
Copy link
Author

@Kolbi
Copy link
Contributor

Kolbi commented Apr 18, 2024

2024-04-18 07:45:24.531 DEBUG (MainThread) [custom_components.audiconnect.audi_connect_account] POSITION: Starting update_vehicle_position for VIN: *************2845
2024-04-18 07:45:24.531 DEBUG (MainThread) [custom_components.audiconnect.audi_connect_account] POSITION: Attempting to retrieve stored vehicle position for VIN: *************2845
2024-04-18 07:45:25.266 DEBUG (MainThread) [custom_components.audiconnect.audi_connect_account] POSITION: Vehicle position data received for VIN: *************2845, lat: ##.######, lon: ##.#####, timestamp: 2024-04-17 18:56:35+00:00, parktime: 2024-04-17 18:56:35+00:00
2024-04-18 07:45:25.267 DEBUG (MainThread) [custom_components.audiconnect.audi_connect_account] POSITION: Vehicle position updated successfully for VIN: *************2845

It seems location was successfully updated?

@synack666
Copy link
Author

Yes, it looks like this in the log, but when I drive somewhere and park 10 kilometers away, for example, HA still says that I am at home, i.e. my car

@Kolbi
Copy link
Contributor

Kolbi commented Apr 18, 2024

Can you then check the gps location in the device_tracker if it's still the home gps location or has the coordinates 10 kilometers away?

@synack666
Copy link
Author

will try, not so easy cause only with mobile

@synack666
Copy link
Author

Screenshot 2024-04-19 070609

today next try, yesterday i get the debug on mobile but dont be able to save ist, funny thing, back at home, car in garage, the location toggle

@synack666
Copy link
Author

Hi!
test today, the position gets an update but then jumps back and forth between home and somewhere else, after a while it calms down. at the same time in the app the position remains unchanged. now the car is standing in front of the house, does not move and is recognized as absent and home again. but i don't see any constant position updates in the log. very strange

@synack666
Copy link
Author

synack666 commented Apr 19, 2024

log from today

2024-04-19 09:43:06.350 DEBUG (MainThread) [custom_components.audiconnect.audi_connect_account] POSITION: Starting update_vehicle_position for VIN: *************2845
2024-04-19 09:43:06.350 DEBUG (MainThread) [custom_components.audiconnect.audi_connect_account] POSITION: Attempting to retrieve stored vehicle position for VIN: *************2845
2024-04-19 09:43:07.900 DEBUG (MainThread) [custom_components.audiconnect.audi_connect_account] POSITION: Timestamp not available for vehicle position data of VIN: *************2845.
2024-04-19 09:43:07.900 DEBUG (MainThread) [custom_components.audiconnect.audi_connect_account] POSITION: Vehicle position data received for VIN: *************2845, lat: ##.######, lon: ##.######, timestamp: None, parktime: None
2024-04-19 09:43:07.900 DEBUG (MainThread) [custom_components.audiconnect.audi_connect_account] POSITION: Vehicle position updated successfully for VIN: *************2845
2024-04-19 10:50:54.409 ERROR (MainThread) [homeassistant.components.device_tracker] Platform audiconnect does not generate unique IDs. ID Audi S4 Avant Position already exists - ignoring device_tracker.audi_s4_avant_position
2024-04-19 11:11:12.215 DEBUG (MainThread) [custom_components.audiconnect.audi_connect_account] POSITION: Starting update_vehicle_position for VIN: *************2845
2024-04-19 11:11:12.215 DEBUG (MainThread) [custom_components.audiconnect.audi_connect_account] POSITION: Vehicle position support is disabled for VIN: *************2845. Exiting update process.

@arandax
Copy link

arandax commented Apr 19, 2024

I've lost the sensor, it's not present anymore in the integration after I deleted and re-added the HUB

@synack666
Copy link
Author

i am back to 1.6.1 as a trial and the problem has disappeared

@Kolbi
Copy link
Contributor

Kolbi commented Apr 19, 2024

2024-04-19 10:50:54.409 ERROR (MainThread) [homeassistant.components.device_tracker] Platform audiconnect does not generate unique IDs. ID Audi S4 Avan

what have you done between 09:43 and 10:50?

I wonder what happens if timestampd and parktime is None like in your example but position is set....

self._vehicle.state["position"] = {

i am back to 1.6.1 as a trial and the problem has disappeared

Yeah some would now happen if you upgrade to v1.6.3 again I guess. Both versions seem to have the same bug but starting Home-Assistant new should help to get self.support_position to True again until the next failure.

I found a bug and corrected it immediately and pushed v1.6.4 - it could be related to your issue. Because we stopped position update by accident if climater support is not possible: #403

@Kolbi
Copy link
Contributor

Kolbi commented Apr 19, 2024

I found the confirmation in your logs:

2024-04-18 07:45:25.431 DEBUG (MainThread) [custom_components.audiconnect.audi_connect_account] ClientResponseError with status 403 while updating climater for VIN: *************2845. Disabling climater support.

Exactly what I though climater support was not available for your vehicle and disabled the position update per accident. This bug was introduced with v1.6.0 : #379 :)

@synack666
Copy link
Author

just updated, will see

@synack666
Copy link
Author

what have you done between 09:43 and 10:50?

I was in the garage for service

@synack666
Copy link
Author

synack666 commented Apr 19, 2024

ok, seems like fixed for me
thanks a lot for support (fast and good)
i close here

@synack666 synack666 reopened this Apr 23, 2024
@synack666
Copy link
Author

Unfortunately I have to realize that it is not fixed after all, one day it worked without any problems, after that the car is permanently at home again.

@coreywillwhat
Copy link
Contributor

At this point I'm thinking it may be an API issue. I have also noticed GPS location doesn't always update for me either, but then other days it does work. The only thing left is to evaluate the raw data in your logs. We currently redact the GPS coordinates for obvious reasons, but i will add a PR for a commented line which will allow the user to remove the comment and display the raw data in the logs. User can then compare the raw GPS data coordinates to their expected vehicle position. If the data provided by Audi is incorrect to where the vehicle is actually positioned, this is an Audi API issue and we won't be able to address it further.

See #407 PR.

@Kolbi
Copy link
Contributor

Kolbi commented Apr 24, 2024

I also have some issues with the position API. My car still seems to be on the place it was yesterday. In the device_tracker the old GPS coordinates there present.

Changed code that I have full log with GPS coordinate, restarted HA and now everything is alright.... sadly no log file... in the next event I try to catch the log file. And then we will see if API gives us wrong information (and after HA restart the correct one?!?) or if there is still a bug somewhere we are not aware currently.

@Kolbi
Copy link
Contributor

Kolbi commented Apr 24, 2024

At this point I'm thinking it may be an API issue. I have also noticed GPS location doesn't always update for me either, but then other days it does work. The only thing left is to evaluate the raw data in your logs. We currently redact the GPS coordinates for obvious reasons, but i will add a PR for a commented line which will allow the user to remove the comment and display the raw data in the logs. User can then compare the raw GPS data coordinates to their expected vehicle position. If the data provided by Audi is incorrect to where the vehicle is actually positioned, this is an Audi API issue and we won't be able to address it further.

See #407 PR.

Added PR - next version will contain this debug method or update to master via HACS.

@synack666
Copy link
Author

try to catch infos/logs today

@coreywillwhat
Copy link
Contributor

Thank you @synack666 !
Just be sure to follow the instructions in #407 to enable the unredacted data in your logs.

You don't need to provide the data to us, but please verify the GPS coordinates are accurate from the Audi API using Google maps or other map software.

@synack666
Copy link
Author

Screenshot 2024-04-24 125109

ok, here wo go, this try everything was ok, location changed... next try this evening
i use this data for position, ist was correct

@coreywillwhat coreywillwhat added the more info needed Further information is requested label Apr 25, 2024
@synack666
Copy link
Author

I have now looked closely for 2 days, in the app everything is ok, in HA after a restart it also works, so for one day, after that the change of location is no longer accepted, in the GEO data the position remains.

@coreywillwhat
Copy link
Contributor

Hi @synack666 thanks for doing some extensive testing. So the GPS coordinates returned in the logs always remained the same? and you either have active polling set to run frequently enough that it would capture the changes in your coordinates while you are out of the house, or you are running the refresh_cloud_data service call when the vehicle is in a different location?

@synack666
Copy link
Author

what can i say, now it has been running for three days without any problems, current version is installed

i have previously compared the app with ha and checked the geo with maps, long enough somewhere else so that an update should have come, door on or so has also come

Should i close here?

@Kolbi
Copy link
Contributor

Kolbi commented May 2, 2024

Today I had:

POSITION: ClientResponseError with status 502 for VIN: *****************. Disabling vehicle position support.

Need to try to fetch debug log later.

@synack666
Copy link
Author

i close here, it works for a couple of days without problems, thnx for support.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
more info needed Further information is requested
Projects
None yet
Development

No branches or pull requests

4 participants