audiconnect / audi_connect_ha

Adds an audi connect integration to home assistant
MIT License
226 stars 98 forks source link

GPS jumps to „home“ every few minutes - car is not moving #331

Closed moritzmaier84 closed 5 months ago

moritzmaier84 commented 5 months ago

Well, the picture says it all. I‘m in my „Basketball“ zone, car is parked, not moving for hours. GPS location jumps to „home“ again and again while everything is right in the audi app (never jumps around there).

What the heck? Can anybody imagine a reason? I use this sensor alot, would be great. IMG_1889

coreywillwhat commented 5 months ago

can you provide debug logs?

moritzmaier84 commented 5 months ago

can you provide debug logs?

I got only this. Or is there another way to get more data? How? But I think this IS the problem, right?

And I think it started with the latest update - not 100% sure but I did an update and it's a new problem.

Logger: homeassistant.components.device_tracker Quelle: helpers/entity_platform.py:735 Integration: Geräte-Tracker (Dokumentation, Probleme) Erstmals aufgetreten: 19:39:51 (3 Vorkommnisse) Zuletzt protokolliert: 22:51:41

Platform audiconnect does not generate unique IDs. ID Audi A4 Avant Position already exists - ignoring device_tracker.audi_a4_avant_position

coreywillwhat commented 5 months ago

@Kolbi my device tracker has been solid since switching to your new device IDs. Could your PR be a fix for the tracker issues given the reference to unique IDs?

Kolbi commented 5 months ago

@coreywillwhat might be, my device tracker is also working properly.

Edit: We are still using the same unique_id even in my PR for example:

"unique_id":"Audi [...] Position" But interesting why it tries to create it a second time....

Maybe my PR should also fix the unique_ids.... need to think about it.

coreywillwhat commented 5 months ago

@moritzmaier84 it shouldn't be a recent update, nothing has changed for trackers recently, although the Audi servers have been acting strange the last few days for Audi connect even when the Audi app itself seems relatively stable. From my recent review, the endpoints appear to be slightly different.

Can you enable debug logging from the integration screen for Audi connect, let it run to get a few switches to different locations then turn off debug logging. You'll be prompted to download a file, which you can attach here for us to take a look if youd like us to.

Also, what is your polling interval set to? It looks like 5 minutes by the updates in your pic.

coreywillwhat commented 5 months ago

@coreywillwhat might be, my device tracker is also working properly.

Edit: We are still using the same unique_id even in my PR for example:

"unique_id":"Audi [...] Position" But interesting why it tries to create it a second time....

Maybe my PR should also fix the unique_ids.... need to think about it.

I thought I saw we use model name somewhere as an ID in current state, which seems to be what's coming through in the logs provided. It's late here, can't look at the code. I might be misremembering.

moritzmaier84 commented 5 months ago

@moritzmaier84 it shouldn't be a recent update, nothing has changed for trackers recently, although the Audi servers have been acting strange the last few days for Audi connect even when the Audi app itself seems relatively stable. From my recent review, the endpoints appear to be slightly different.

Can you enable debug logging from the integration screen for Audi connect, let it run to get a few switches to different locations then turn off debug logging. You'll be prompted to download a file, which you can attach here for us to take a look if youd like us to.

Also, what is your polling interval set to? It looks like 5 minutes by the updates in your pic.

Okay I'll try to do that. Today I am at home, though and the sensors keeps quite, now. I'll have to check if it starts again if I move the car the next time.

My polling interval is 15mins, though. So that cannot be the reason.

coreywillwhat commented 5 months ago

Okay I'll try to do that. Today I am at home, though and the sensors keeps quite, now. I'll have to check if it starts again if I move the car the next time.

My polling interval is 15mins, though. So that cannot be the reason.

Thanks for checking, wanted to get the full picture for scan interval.

moritzmaier84 commented 5 months ago

@moritzmaier84 it shouldn't be a recent update, nothing has changed for trackers recently, although the Audi servers have been acting strange the last few days for Audi connect even when the Audi app itself seems relatively stable. From my recent review, the endpoints appear to be slightly different. Can you enable debug logging from the integration screen for Audi connect, let it run to get a few switches to different locations then turn off debug logging. You'll be prompted to download a file, which you can attach here for us to take a look if youd like us to. Also, what is your polling interval set to? It looks like 5 minutes by the updates in your pic.

Okay I'll try to do that. Today I am at home, though and the sensor keeps quite, now. I'll have to check if it starts again if I move the car the next time.

My polling interval is 15mins, though. So that cannot be the reason.

coreywillwhat commented 5 months ago

Okay I'll try to do that. Today I am at home, though and the sensor keeps quite, now. I'll have to check if it starts again if I move the car the next time.

sounds good

shuntfield commented 5 months ago

I was getting this but it kept bouncing back and forth to a specific zone. Now, on the latest version its not working at all, which happened a few days ago too, how I resolved both was loading an older version and then loading the latest version again. I have changed a few of the device classes which will mess mine up again until I change them back.

Kolbi commented 5 months ago

Had the same issue 1-2 days ago but couldn't figure out until yet why. Reloading integration / restarting Home-Assistant helped to get it working again...

Platform audiconnect does not generate unique IDs. ID Audi A4 Avant Position already exists - ignoring device_tracker.audi_a4_avant_position

Kolbi commented 5 months ago

354 more debugging options will come

Kolbi commented 5 months ago

Please try version >= 1.4.0 and enable debug mode if you encounter the issue and provide us the specific lines from the logfile.

moritzmaier84 commented 5 months ago

Please try version >= 1.4.0 and enable debug mode if you encounter the issue and provide us the specific lines from the logfile.

I did not have it since a couple of days so I couldn't do it. I mean... if it stays like this, it's kinda solved.

If it comes back again, I'll do the debug stuff.

coreywillwhat commented 5 months ago

Many of the GPS issues have been resolved with #381 #374 . Closing this issue since the original reporter mentioned this is no longer an issue. Please open an issue if you experience this or any other problems.

moritzmaier84 commented 5 months ago

Many of the GPS issues have been resolved with #381 #374 . Closing this issue since the original reporter mentioned this is no longer an issue. Please open an issue if you experience this or any other problems.

So ironic.. Today it came back and it is still going on. I think it has something to do with zones because it's jumps to zones everytime and only zones I was in today. It's more often than the 15 minutes again.

Hier ist my debug log:

home-assistant_audiconnect_2024-04-17T20-56-03.039Z.log

Kolbi commented 5 months ago

Interesting:

2024-04-17 22:55:04.110 DEBUG (MainThread) [custom_components.audiconnect.audi_connect_account] Starting update_vehicle_position for VIN: 9780 2024-04-17 22:55:04.110 DEBUG (MainThread) [custom_components.audiconnect.audi_connect_account] Position support is disabled for VIN: 9780. Exiting update process.

It seems you are using <v1.6.1 can you please upgrade to latest version as you have some 403 issues...

moritzmaier84 commented 5 months ago

Interesting:

2024-04-17 22:55:04.110 DEBUG (MainThread) [custom_components.audiconnect.audi_connect_account] Starting update_vehicle_position for VIN: 9780 2024-04-17 22:55:04.110 DEBUG (MainThread) [custom_components.audiconnect.audi_connect_account] Position support is disabled for VIN: 9780. Exiting update process.

It seems you are using <v1.6.1 can you please upgrade to latest version as you have some 403 issues...

I had 1.6.0 and no 1.6.3 Strange, no update sign showed up before. Okay... So now I will check again if it still happens?

Kolbi commented 5 months ago

Yes please. Although we had no changes in the position update since v.1.6.0 but we disable services with an 403 issue and maybe Audi servers are sensitive if we are trying to call multiple times a service which returns a 403 issue back....

HACS doesn't show immediately updates and currently we are creating a lot of new versions... will be better when we have a stable version running.

moritzmaier84 commented 5 months ago

Yes please. Although we had no changes in the position update since v.1.6.0 but we disable services with an 403 issue and maybe Audi servers are sensitive if we are trying to call multiple times a service which returns a 403 issue back....

HACS doesn't show immediately updates and currently we are creating a lot of new versions... will be better when we have a stable version running.

Thx, I'll let you know if it comes back again.

moritzmaier84 commented 5 months ago

It's still happening. Debuging right now. But we need to reopen the issue again... File is coming up soon.

moritzmaier84 commented 5 months ago

@Kolbi @coreywillwhat

1.6.3

Here is the debug file of a short period. It is still going like this every few minutes, jumping from "home" to the zone I was before and back and again. So annoying :(

home-assistant_audiconnect_2024-04-19T16-15-02.512Z.log

moritzmaier84 commented 4 months ago

Still sometimes...