audiconnect / audi_connect_ha

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

Car Position Not Updated #428

Open veiter555 opened 3 months ago

veiter555 commented 3 months ago

Car Position is not getting updated even the car is at home for several hours... After reloading the Service in Home assistant the car position will change to home. So the issue should be in the service by updating the car position dynamically

babavers commented 3 months ago

I have the same problem with an Audi Q4 etron. I discovered also that a reload of the service has an influence, but it's not what it seems. I have an automation running that stores the location of my car in a Google Sheet based on a trigger when the latitude changes state. Before doing the reload, the automation obviously stops saving new records because it doesn't get triggered, but after the reload it gets triggered 2 times per minute and thus writes 2 records every minute, alternatively one with the data of the non updated position and one with the accurate position. I think there are 2 instances of the service running after the reload. Thus, a reload doesn't help me, I have to restart HA to get a solved but then less than a day later the location 'freezes' again or in other words doesn't get updated anymore.

rhoddan commented 3 months ago

Same here

bartlde commented 3 months ago

My car position is fluctuating between the old position (my yesterdays trip) and the current position at home. I have arrived at home yesterday evening. My original Audi APP displays the position correctly at home - with no fluctuation. The problem occurs since the last update. After full restart of HA it seems to be OK. Will check with the next trip.

Here a copy from detailed entity view (my GUI is set to German): wurde zuhause erkannt 11:36:12 - Vor 4 Minuten wurde als abwesend erkannt 11:29:54 - Vor 11 Minuten wurde zuhause erkannt 11:21:06 - Vor 19 Minuten wurde als abwesend erkannt 11:14:45 - Vor 26 Minuten wurde zuhause erkannt 11:06:03 - Vor 34 Minuten wurde als abwesend erkannt 10:59:49 - Vor 41 Minuten wurde zuhause erkannt 10:51:19 - Vor 1 Stunde wurde als abwesend erkannt 10:44:47 - Vor 1 Stunde wurde zuhause erkannt 10:36:05 - Vor 1 Stunde wurde als abwesend erkannt 10:29:44 - Vor 1 Stunde

shuntfield commented 3 months ago

image

Mine had been doing this since last night. Its picked the last two locations I have been at, and doesn't update. I enabled debug logging, but not sure where the log is?

moritzmaier84 commented 3 months ago

I have this since a few weeks. Please see #331 Issue is NOT solved.

Hier is a debug file @Kolbi @coreywillwhat home-assistant_audiconnect_2024-04-19T16-15-02.512Z.log

coreywillwhat commented 3 months ago

Appreciate everyone's patience. Thank you for the log @moritzmaier84 . This looks like the issue in your log, I've seen this before in other logs.

2024-04-19 17:49:44.287 ERROR (MainThread) [homeassistant.components.device_tracker] Platform audiconnect does not generate unique IDs. ID Audi A4 Avant Position already exists - ignoring device_tracker.audi_a4_avant_position

Need to investigate further.

@Kolbi I believe Unique ID's as you had proposed a while ago would fix this issue.

moritzmaier84 commented 3 months ago

Appreciate everyone's patience. Thank you for the log @moritzmaier84 . This looks like the issue in your log, I've seen this before in other logs.

2024-04-19 17:49:44.287 ERROR (MainThread) [homeassistant.components.device_tracker] Platform audiconnect does not generate unique IDs. ID Audi A4 Avant Position already exists - ignoring device_tracker.audi_a4_avant_position

Need to investigate further.

@Kolbi I believe Unique ID's as you had proposed a while ago would fix this issue.

Great news that it's going on and you have ideas for this! Thx!!!

ghostwind66 commented 3 months ago

I had the same issue as well a few weeks ago. Downgrading to 1.7.0 resolved the issue for me

veiter555 commented 3 months ago

Thank you Gohstwind66!

After downgrading to Release 1.7.0 it seams to work properly again.

For me the position is crucial due to a programm that reduces the discharge powerlimit of my house battery if a car is charging at home.

moritzmaier84 commented 3 months ago

I had this before 1.7.0 and after it.

It's not every day. Sometimes yes, sometimes no.

Kolbi commented 3 months ago

Downgrading will also only be a temporary solution as I still believe we didn't changed something crucial since 1.7.0 - it is more installing the new (old) version that it loads the interface / service new. I still think restarting Home-Assistant should do the same thing but maybe in the core there are some caches not erased if not uninstalling / installing the extension.

ghostwind66 commented 3 months ago

Downgrading will also only be a temporary solution as I still believe we didn't changed something crucial since 1.7.0 - it is more installing the new (old) version that it loads the interface / service new. I still think restarting Home-Assistant should do the same thing but maybe in the core there are some caches not erased if not uninstalling / installing the extension.

Interestingly enough, I noticed the position not updating on 1.7.0 yesterday as well. A restart fixed the issue. The issue seems to be pretty sporadic and random. This is the first time it has happened since I downgraded a few weeks ago. Strange.

coreywillwhat commented 3 months ago

Downgrading will also only be a temporary solution as I still believe we didn't changed something crucial since 1.7.0 - it is more installing the new (old) version that it loads the interface / service new. I still think restarting Home-Assistant should do the same thing but maybe in the core there are some caches not erased if not uninstalling / installing the extension.

This. No major changes have occurred. I would expect a restart to fix it temporarily as well until we have the actual solution.

moritzmaier84 commented 3 months ago

Downgrading will also only be a temporary solution as I still believe we didn't changed something crucial since 1.7.0 - it is more installing the new (old) version that it loads the interface / service new. I still think restarting Home-Assistant should do the same thing but maybe in the core there are some caches not erased if not uninstalling / installing the extension.

Interestingly enough, I noticed the position not updating on 1.7.0 yesterday as well. A restart fixed the issue. The issue seems to be pretty sporadic and random. This is the first time it has happened since I downgraded a few weeks ago. Strange.

I agree - it seems to be totally random. I really tried to find some "rules"... but no.

ghostwind66 commented 3 months ago

I created a script that I can call whenever the need arises (eg. I drive away) that re-enables the device using Spook:

image Might be handy for those who don't want to reboot their device every time they want to update the position.

Kolbi commented 1 month ago

Maybe similar issue reported here: https://github.com/home-assistant/core/issues/121441

pergolafabio commented 1 month ago

I have the same problem with an Audi Q4 etron. I discovered also that a reload of the service has an influence, but it's not what it seems. I have an automation running that stores the location of my car in a Google Sheet based on a trigger when the latitude changes state. Before doing the reload, the automation obviously stops saving new records because it doesn't get triggered, but after the reload it gets triggered 2 times per minute and thus writes 2 records every minute, alternatively one with the data of the non updated position and one with the accurate position. I think there are 2 instances of the service running after the reload. Thus, a reload doesn't help me, I have to restart HA to get a solved but then less than a day later the location 'freezes' again or in other words doesn't get updated anymore.

Hey , you have an Q4 ? or maybe someone else can help I received my car yesterday, added the integration, it creates a lot of sensor.x devices But i dont see any device.x entity? what kind of entity is providing the location of the car ?

what am i missing?

pergolafabio commented 1 month ago

Hmm, i see below in log

2024-07-23 12:55:22.956 ERROR (MainThread) [custom_components.audiconnect.audi_connect_account] POSITION: ClientResponseError with status 404 for VIN: *************6552. Error: 404, message='Not Found', url=URL('https://emea.bff.cariad.digital/vehicle/v1/vehicles/XXXX/parkingposition')

EDIT: this is fixed for me, seems there was an issue with my license

TheDelta commented 3 weeks ago

Quick update: unsure what solved the issue, did a clean install, updated to latest home assistant version and also fiddled around with the audi app, but it works again as intended and doesn't throw the 4xx errors anymore. Sometimes 5xx but this is to be expected.

(updating this to prevent notification spam)

Original Message

I have a similar issue where nothing is updated and I have to reload the extension to make it work again. This was introduced in one of the newer releases, it was working fine after the whole debacle of the new API changes, but now I have to reload it manually once in a while to make it work. I enabled now debug logging and wait until this happens again (I noticed this multiple times now and reload fixed it all the time). My logs were filled with this issue (error occurred >1k times) #456 Might be also related to #330 ? Is this issue still being worked on? Anything I can help with?