audiconnect / audi_connect_ha

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

Invalid Credentials #488

Closed jonny190 closed 2 weeks ago

jonny190 commented 3 weeks ago

Describe the bug Cannot login to plugin after it working for months

To Reproduce add plugin and try to login

Expected behavior To login and pull sensors

Screenshots n/a

Logfile 2024-11-01 19:31:09.895 DEBUG (MainThread) [custom_components.audiconnect.audi_connect_account] LOGIN: Requesting login to Audi service... 2024-11-01 19:31:09.895 DEBUG (MainThread) [custom_components.audiconnect.audi_services] LOGIN: Starting login to Audi service... 2024-11-01 19:31:14.955 DEBUG (MainThread) [custom_components.audiconnect.audi_connect_account] LOGIN: Requesting login to Audi service... 2024-11-01 19:31:14.956 DEBUG (MainThread) [custom_components.audiconnect.audi_services] LOGIN: Starting login to Audi service...

Your Vehicle Details Model: Etron 55 Quattro Year: 2019 Type (Gas/Hybrid/Electric): Electric Region (EU/US/CA/CN): EU

cdnninja commented 3 weeks ago

Can you login using the native app?

N3rdix commented 3 weeks ago

The native App is working for me, but the Integration stopped working yesterday morning.

Logger: custom_components.audiconnect.audi_connect_account
Quelle: custom_components/audiconnect/audi_connect_account.py:90
Integration: Audi Connect (Dokumentation, Probleme)
Erstmals aufgetreten: 2. November 2024 um 20:10:23 (106 Vorkommnisse)
Zuletzt protokolliert: 09:18:47

LOGIN: Login to Audi service failed: 'Timeout' object does not support the context manager protocol
Logger: custom_components.audiconnect.audi_connect_account
Quelle: custom_components/audiconnect/audi_connect_account.py:75
Integration: Audi Connect (Dokumentation, Probleme)
Erstmals aufgetreten: 2. November 2024 um 20:10:03 (212 Vorkommnisse)
Zuletzt protokolliert: 09:18:37

LOGIN: Login to Audi service failed, trying again in 10 seconds
jonny190 commented 3 weeks ago

Yeah, the native app works fine for me... However when signing in to the app I noticed my password manager didn't prompt to auto fill (bitwarden)

Then I logged in, it prompted me to save fresh credentials for a different URL (VW related) not sure if there may have been a change the app was prepared for?

Jabei1969 commented 3 weeks ago

Same for me. Native app is fine but can’t now log into HA integration

eskholm commented 3 weeks ago

Same issue here.

2024-11-04 10:28:06.690 ERROR (MainThread) [custom_components.audiconnect.audi_connect_account] LOGIN: Login to Audi service failed, trying again in 10 seconds 2024-11-04 10:28:16.692 ERROR (MainThread) [custom_components.audiconnect.audi_connect_account] LOGIN: Login to Audi service failed, trying again in 10 seconds 2024-11-04 10:28:26.693 ERROR (MainThread) [custom_components.audiconnect.audi_connect_account] LOGIN: Login to Audi service failed: 'Timeout' object does not support the context manager protocol 2024-11-04 10:28:26.693 WARNING (MainThread) [custom_components.audiconnect.audi_account] Failed refresh cloud data

minosrex commented 3 weeks ago

Also cannot login anymore, says my credentials are not valid.

gomble commented 3 weeks ago

same

Just-inc-ace commented 2 weeks ago

Same here

andrewbuckingham commented 2 weeks ago

I had a similar problem a week ago or so. Tried removing and re-adding the HA integration; couldn't get it to sign in.

But, I noticed it coincided with Audi changing the T&Cs. It required me to go into the native app and view the T&Cs, then accept them again. Once I'd done that, the HA integration worked again. This is with an Etron 55 quattro 2022. Might just be coincidence, of course.

jonny190 commented 2 weeks ago

@andrewbuckingham I had the same a few weeks ago, thats when i tried logging out and back in to the app just in case it was the same again.

Thats when i noticed my password manager no longer autofilled and prompted me to save the credentials again previously it was saved as de.myaudi.mobile.assistant

now its saving as uk.co.volkswagen.myvw

minosrex commented 2 weeks ago

I had a similar problem a week ago or so. Tried removing and re-adding the HA integration; couldn't get it to sign in.

But, I noticed it coincided with Audi changing the T&Cs. It required me to go into the native app and view the T&Cs, then accept them again. Once I'd done that, the HA integration worked again. This is with an Etron 55 quattro 2022. Might just be coincidence, of course.

Same here, connection is now re-established.

N3rdix commented 2 weeks ago

No luck with my Q4, I already accepted some new EULAs a few weeks ago when the integration was still working fine. Seems not to be the root cause, or not the only one 😀

EDIT: tried with no luck to log out everywhere, delete the integration. Signing into the app worked, the HA integration now cannot be set up at all...

EDIT2: i am using the location "DE"

korsmann commented 2 weeks ago

I had a similar problem a week ago or so. Tried removing and re-adding the HA integration; couldn't get it to sign in.

But, I noticed it coincided with Audi changing the T&Cs. It required me to go into the native app and view the T&Cs, then accept them again. Once I'd done that, the HA integration worked again. This is with an Etron 55 quattro 2022. Might just be coincidence, of course.

This actually worked for me as well. E-tron MY 2019. Had to log out of the app, back in, confirm T&Cs, log back in with HA.

menloperk commented 2 weeks ago

For me this is broken... logging out and back in into the app doesn't have any effect. Also deleting the integration and trying to configure it back again, doesn't help either... I immediately get 'invalid credentials'. Before deleting the integration I had this in the logs: LOGIN: Login to Audi service failed: 'Timeout' object does not support the context manager protocol

N3rdix commented 2 weeks ago

I just tried to add my account into a dev container instance and this worked without any issues. In my productive environment it is still giving the invalid credentials error, that's what I see in addition when logging some more details of the exception:

Traceback (most recent call last):
  File "/config/custom_components/audiconnect/audi_connect_account.py", line 85, in try_login
    await self._audi_service.login(self._username, self._password, False)
  File "/config/custom_components/audiconnect/audi_services.py", line 118, in login
    await self.login_request(user, password)
  File "/config/custom_components/audiconnect/audi_services.py", line 909, in login_request
    markets_json = await self._api.request(
                   ^^^^^^^^^^^^^^^^^^^^^^^^
  File "/config/custom_components/audiconnect/audi_api.py", line 49, in request
    with async_timeout.timeout(TIMEOUT):
TypeError: 'Timeout' object does not support the context manager protocol

Could this be some abandoned cache somewhere? Couldn't find anything in my config folder so far...

jonny190 commented 2 weeks ago

I've tried uninstalling the plugin, restarting and then reinstalling but still the same error. But it could be cached elsewhere, good shout

N3rdix commented 2 weeks ago

I found the issue 🥳 I will submit a PR this evening and hopefully someone can merge it.

If anyone volunteers to test this locally upfront by replacing source files let me know. I'll then share the details

eskholm commented 2 weeks ago

I found the issue 🥳 I will submit a PR this evening and hopefully someone can merge it.

If anyone volunteers to test this locally upfront by replacing source files let me know. I'll then share the details

I’ll happily test it out 👍

N3rdix commented 2 weeks ago

just download the changed audi_api.py from the PR #489 and overwrite the existing file in your custom_components folder. After a HA restart it should work as usual.

florie1706 commented 2 weeks ago

I found the issue 🥳 I will submit a PR this evening and hopefully someone can merge it.

If anyone volunteers to test this locally upfront by replacing source files let me know. I'll then share the details

Works again :) thx

eskholm commented 2 weeks ago

just download the changed audi_api.py from the PR #489 and overwrite the existing file in your custom_components folder. After a HA restart it should work as usual.

Confirmed working! Thank you!

menloperk commented 2 weeks ago

Works but why was this closed as we still need a proper fix merged? OK, I see it in #489

N3rdix commented 2 weeks ago

Works but why was this closed as we still need a proper fix merged?

OK, I see it in #489

The fix was merged, it just needs to be shipped in a new release.