audiconnect / audi_connect_ha

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

integration can no longer log in after update V1.1.0 #322

Closed Heelderpeel closed 7 months ago

Heelderpeel commented 7 months ago

I get the following error message

Logger: custom_components.audiconnect.audi_connect_account Bron: custom_components/audiconnect/audi_connect_account.py:86 integratie: Audi Connect (documentation, issues) First occurred: 2 april 2024 om 23:36:58 (21 gebeurtenissen) Laatst gelogd: 00:48:16

Login to Audi service failed: 'client_id'

Logger: custom_components.audiconnect.audi_connect_account Bron: custom_components/audiconnect/audi_connect_account.py:73 integratie: Audi Connect (documentation, issues) First occurred: 2 april 2024 om 23:36:36 (43 gebeurtenissen) Laatst gelogd: 00:49:27

Login to Audi service failed, trying again in 10 seconds

I can log in to the Audi website with the same credentials. I removed the integration to try to add it again, but now I can't add the integration anymore

jjslegacy commented 7 months ago

Same issue here

cdnninja commented 7 months ago

@coreywillwhat I am seeing same thing but I rolled back to v1.0.3 and have same issue so not sure this is 1.1 caused. I will roll back further to confirm.

coreywillwhat commented 7 months ago

i noticed that around the same time today....i thought I over polled the api during development. I also rolled back to a separate fork I had that was working prior to recent updates and received the same error....

Edit: Just to double down, I had the latest running for several hours today with debugging on and it survived multiple restarts/reconfigs. They must have changed the API midday today.

Kolbi commented 7 months ago

Interesting my version was working until I now restarted Home-Assistant and I have the same issues now.

@t0bias-r can you quickly debug connecting if something changed in the area getting the token from Audi?

N3rdix commented 7 months ago

Same issue here since tonight, seems to be a problem with the Audi Service (temporary or changed API)

Kolbi commented 7 months ago

I'm digging into it: https://content.app.my.audi.com/service/mobileapp/configurations/market/CH/de?v=4.23.1

Currently we have

        # use dynamic config from marketcfg
        self._client_id = "09b6cbec-cd19-4589-82fd-363dfa8c24da@apps_vw-dilab_com"
        if "idkClientIDAndroidLive" in marketcfg_json:
            self._client_id = marketcfg_json["idkClientIDAndroidLive"]

But idkClientIDAndroidLive seems not to be deliverd in marketcfg anymore so maybe our client_id is not valid anymore

but in https://content.app.my.audi.com/service/mobileapp/configurations/market/ there is again a idkClientIDAndroidLive

Edit1: Sorry no time anymore maybe someone can analyse the app in the meantime? Edit2: mbbOAuthBaseURLLive seems to be also missing completely in marketcfg_json (but again available in https://content.app.my.audi.com/service/mobileapp/configurations/market/ ) - so I guess they really changed again the whole API login procedure... or they have a bug :) (but

t0bias-r commented 7 months ago

@t0bias-r can you quickly debug connecting if something changed in the area getting the token from Audi?

Same on my side. I'm on a trip - can debug tomorrow morning.

t0bias-r commented 7 months ago

I'm digging into it: https://content.app.my.audi.com/service/mobileapp/configurations/market/CH/de?v=4.23.1

Currently we have

        # use dynamic config from marketcfg
        self._client_id = "09b6cbec-cd19-4589-82fd-363dfa8c24da@apps_vw-dilab_com"
        if "idkClientIDAndroidLive" in marketcfg_json:
            self._client_id = marketcfg_json["idkClientIDAndroidLive"]

But idkClientIDAndroidLive seems not to be deliverd in marketcfg anymore so maybe our client_id is not valid anymore

but in https://content.app.my.audi.com/service/mobileapp/configurations/market/ there is again a idkClientIDAndroidLive

Edit1: Sorry no time anymore maybe someone can analyse the app in the meantime? Edit2: mbbOAuthBaseURLLive seems to be also missing completely in marketcfg_json (but again available in https://content.app.my.audi.com/service/mobileapp/configurations/market/ ) - so I guess they really changed again the whole API login procedure... or they have a bug :) (but

As far as I remember, the items were not present anymore the last few months. (Maybe they were deprecated and now support is removed.)

wigster commented 7 months ago

It seems that everything is working again for integration v 1.1.0.

For what it’s worth, the MyAudi ap kept on working throughout the “outage”, although I did not try to log out.

N3rdix commented 7 months ago

Can confirm that, integration is working again

coreywillwhat commented 7 months ago

Working here. I was able to set up several new instances using different versions including latest, and have reloaded several times.

coreywillwhat commented 7 months ago

@Heelderpeel Can you confirm if the integration is working again for you?

shuntfield commented 7 months ago

I think something was down overnight. I wasn't able to log in immediately after the update. I am able this morning, though device_tracker isn't working. Which I have mentioned in a seperate thread.

Heelderpeel commented 7 months ago

Yes, everything works again, I am very happy with the update. especially the New Service: Start Climate Control, which is exactly what I was looking for. Thank you all for the good work, I am very happy with it.

Heelderpeel commented 7 months ago

I still see a problem after running the audiconnect.start_climate_control service. but to keep it clean I will make a new issue of that. At least that seems the most useful to me. But this can certainly be closed

coreywillwhat commented 7 months ago

I still see a problem after running the audiconnect.start_climate_control service. but to keep it clean I will make a new issue of that. At least that seems the most useful to me. But this can certainly be closed

I'll keep an eye out for the start_climate_control issue. I only had one vehicle to test on :) so created it with very limited scope of testing. We preserved the legacy execute vehicle action start_climatisation for that reason.

If its the refresh issue you're seeing in the logs, the vehicle refresh is initiated immediately after the start_climate_control, similar to the execute vehicle action, so you'll still be getting those errors until refresh vehicle data is fixed.

I have another service call to refresh_cloud_data, but its dependent on merging an existing pull request before i can submit that one for review.

That said, in my testing, refresh cloud data is working well if you run that service call ~30 seconds after requesting a vehicle action.