audiconnect / audi_connect_ha

Adds an audi connect integration to home assistant
MIT License
237 stars 97 forks source link

Invalid credentials #169

Closed menloperk closed 7 months ago

menloperk commented 1 year ago

Stopped working for me (I guess) 1 day ago. Deleted the integration and added again. Now I can only get 'Invalid Credentials' where I have checked they do really work when logging in to my.audi.com and they were also working before. Could it be this integration is now broken due to changes at Audi side?

gerofeldmann commented 1 year ago

Hi, I have the exact same problem- Login works on mobile device and Browser. It just stopped working on Home Assistant.

tieskuh commented 1 year ago

Same here…

eightsixeight commented 1 year ago

same here even reset pin... @menloperk what logs do you need ?

tieskuh commented 1 year ago

Duplicate of https://github.com/arjenvrh/audi_connect_ha/issues/168 I suppose

ChrisPolewiak commented 1 year ago

There was an mobile app update, maybe producer change some API and now it is not compatible. Some must deeply analyse what VW changed...

Frankster-NL commented 1 year ago

This should be fixed easily. If I look at: https://github.com/evcc-io/evcc/issues/6522:

menloperk commented 1 year ago

Yes, I have applied these as a temp fix to my audi_services.py and all is good now for me until we get a formal update.

ChrisPolewiak commented 1 year ago

Can you share what you modify in your file. Thanks.

menloperk commented 1 year ago

Here's a diff between original and fixed... (btw, had to restart HA after applying these before being able to add the integration again)...

ubuntu@node1:~/appdata/homeassistant/config/custom_components/audiconnect$ diff audi_services.py.orig audi_services.py
757c757
<         marketcfg_url = "https://content.app.my.audi.com/service/mobileapp/configurations/market/{c}/{l}?v=4.13.0".format(
---
>         marketcfg_url = "https://content.app.my.audi.com/service/mobileapp/configurations/market/{c}/{l}?v=4.15.0".format(
760c760
<         openidcfg_url = "https://idkproxy-service.apps.{0}.vwapps.io/v1/{0}/openid-configuration".format(
---
>         openidcfg_url = "https://{0}.bff.cariad.digital/login/v1/idk/openid-configuration".format(
771c771
<         self._authorizationServerBaseURLLive = "https://aazsproxy-service.apps.emea.vwapps.io"
---
>         self._authorizationServerBaseURLLive = "https://emea.bff.cariad.digital/login/v1/audi"
787c787
<         self._tokenEndpoint = "https://idkproxy-service.apps.emea.vwapps.io/v1/emea/token"
---
>         self._tokenEndpoint = "https://emea.bff.cariad.digital/login/v1/idk/token"
791c791
<             "https://idkproxy-service.apps.emea.vwapps.io/v1/emea/revoke"
---
>             "https://emea.bff.cariad.digital/login/v1/idk/revoke"
menloperk commented 1 year ago

Only entity missing for me now is device_tracker.audi_e_tron_position...

gllmlbrt commented 1 year ago

Confirm all works for me with the above update. Including the position sensor which updates all fine. I would be happy to make a PR on this, but I am not sure there is any maintenance done actively so it would not be merged anytime soon. So instead I share the whoel audi_service.py here that you can download, repalce the extension from .txt to .py and override in your custom_components/audiconnect folder audi_services.txt

gllmlbrt commented 1 year ago

I created a fork and PR with https://github.com/t0bias-r/audi_connect_ha/pull/1 for those interested, as I use the @t0bias-r fork with all doors sensors...

menloperk commented 1 year ago

Confirm all works for me with the above update. Including the position sensor which updates all fine. I would be happy to make a PR on this, but I am not sure there is any maintenance done actively so it would not be merged anytime soon. So instead I share the whoel audi_service.py here that you can download, repalce the extension from .txt to .py and override in your custom_components/audiconnect folder audi_services.txt

Deleted the integration again, restarted and suddenly had 1 additional entity (position) and 36 in total! Don't know what happened before but seems to be alright now since position is looking OK again.

synack666 commented 1 year ago

Thanks a lot!!!

shuntfield commented 1 year ago

image Confirm its all working with the changes made to the audi_services.py from the message.

Good work!

TFhdKi95ae8L commented 1 year ago

I created a fork and PR with https://github.com/t0bias-r/audi_connect_ha/pull/1 for those interested, as I use the @t0bias-r fork with all doors sensors...

Thank you for this!

Larnak23 commented 1 year ago

Thanks it works again

b3rtdb commented 1 year ago

Wonderful, works again after replacing and restart. Thanks !!

philipp-luettecke commented 1 year ago

I can also confirm. After changing above lines on the current install 70eef5d a login was successful again.

Thanks!

eightsixeight commented 1 year ago

i would say this is not a bitcoin transaction thus does not need 450 confirmations, i think we get that it works ;)

chemgeek commented 1 year ago

I still get an error that my credentials are invalid. I tried to delete the integration, restarted, re-download it, copied audi_services.py file, restarted, and still shows invalid credentials. Not sure what to do at this point. I am in the US if that helps.

ikavior commented 1 year ago

@chemgeek, same here. Im from EU.

chemgeek commented 1 year ago

I still get an error that my credentials are invalid. I tried to delete the integration, restarted, re-download it, copied audi_services.py file, restarted, and still shows invalid credentials. Not sure what to do at this point. I am in the US if that helps.

I see there was some emea stuff hardcoded still in the original version which may have worked before but apparently may be broken in the latest update from Audi. I have changed that to be more dynamic. You can try that fix if you want to see if it helps you!? (again, change file type to .py)

audi_services.txt

Unfortunately, that did not work. Thanks for the effort.

menloperk commented 1 year ago

I still get an error that my credentials are invalid. I tried to delete the integration, restarted, re-download it, copied audi_services.py file, restarted, and still shows invalid credentials. Not sure what to do at this point. I am in the US if that helps.

I see there was some emea stuff hardcoded still in the original version which may have worked before but apparently may be broken in the latest update from Audi. I have changed that to be more dynamic. You can try that fix if you want to see if it helps you!? (again, change file type to .py) audi_services.txt

Unfortunately, that did not work. Thanks for the effort.

Sorry, I was a bit too early with that post so I deleted it. I guess it still found you though 😏. I will have a look later

t0bias-r commented 1 year ago

If Audi (or VW) updates the terms of use, you have to login on the MyAudi website and accept the new terms of use, otherwise the script cannot log in.

gllmlbrt commented 1 year ago

If Audi (or VW) updates the terms of use, you have to login on the MyAudi website and accept the new terms of use, otherwise the script cannot log in.

I also solved this issue with the app, by logging out and loggin in again (you are then asked to accept the new terms). Then re-logging in the integration.

chemgeek commented 1 year ago

I don't get it. I've tried everything listed and still get "invalid credentials."

menloperk commented 1 year ago

I don't get it. I've tried everything listed and still get "invalid credentials."

Hey there, as said, the integration was definitely still broken for the US specifcally as some URLs were hardcoded to default to 'emea' and the name in the openid config file had also changed so it wasn't set dynamically. I believe I have now fixed that too but being in Europe I can't test it. At least the updated .py file is working for me so it should have no real errors in it. So if you could test this... just wanna make sure you're using US as country in the integration config and also that you're able to login to either app or website and that you accepted all terms, etc. before testing. Also, probably best or even mandatory to delete your existing audi connect integration first, then restart HA, and then try to add the integration again providing your credentials, PIN, country, etc.

audi_services.txt

aIA78 commented 1 year ago

I'm trying install HA integration but fails with "Invalid credentials". Have been updated the app in the repo? Thanks a lot.

chemgeek commented 1 year ago

I don't get it. I've tried everything listed and still get "invalid credentials."

Hey there, as said, the integration was definitely still broken for the US specifcally as some URLs were hardcoded to default to 'emea' and the name in the openid config file had also changed so it wasn't set dynamically. I believe I have now fixed that too but being in Europe I can't test it. At least the updated .py file is working for me so it should have no real errors in it. So if you could test this... just wanna make sure you're using US as country in the integration config and also that you're able to login to either app or website and that you accepted all terms, etc. before testing. Also, probably best or even mandatory to delete your existing audi connect integration first, then restart HA, and then try to add the integration again providing your credentials, PIN, country, etc.

audi_services.txt

This worked! Thank you.

menloperk commented 1 year ago

I'm trying install HA integration but fails with "Invalid credentials". Have been updated the app in the repo? Thanks a lot.

No, not yet. There is just a quick fix for now, see the above post. I am also waiting for an official update from the maintainer so I can update through HACS.

rosshenning commented 1 year ago

As best I can tell, Audi has gone and changed their endpoint yet again today. It's freshly not working for me again as of this morning:

Logger: custom_components.audiconnect.audi_connect_account Source: custom_components/audiconnect/audi_connect_account.py:94 Integration: Audi Connect First occurred: 12:06:12 PM (9 occurrences) Last logged: 12:21:49 PM

Login to Audi service failed, trying again in 10 seconds Login to Audi service failed: Cannot connect to host idkproxy-service.apps.na.vwapps.io:443 ssl:default [Name does not resolve]

chemgeek commented 1 year ago

The integration fails to initialize after updating via HACS to new version that appeared a couple days ago. Not sure how to resolve.

menloperk commented 1 year ago

That is because the new version is still broken for US. See my previous post. You should ask Arjen to also incorporate those minor changes so it will again also work for the US (as you tested it) in the official release.

menloperk commented 1 year ago

Reopened since it is still not working in US.

menloperk commented 1 year ago

These lines (based on diff) are still missing, so it is still broken for US:

771c771,772
<         self._authorizationServerBaseURLLive = "https://emea.bff.cariad.digital/login/v1/audi"
---
>         self._authorizationServerBaseURLLive = "https://{0}.bff.cariad.digital/login/v1/audi".format(
>            "na" if self._country.upper() == "US" else "emea")
787c788,789
<         self._tokenEndpoint = "https://emea.bff.cariad.digital/login/v1/idk/token"
---
>         self._tokenEndpoint = "https://{0}.bff.cariad.digital/login/v1/idk/token".format(
>            "na" if self._country.upper() == "US" else "emea")
791c793,794
<             "https://emea.bff.cariad.digital/login/v1/idk/revoke"
---
>             "https://{0}.bff.cariad.digital/login/v1/idk/revoke".format(
>                "na" if self._country.upper() == "US" else "emea")

Arjen, could you please update these too? Thanks, Rene.

chemgeek commented 1 year ago

That is because the new version is still broken for US. See my previous post. You should ask Arjen to also incorporate those minor changes so it will again also work for the US (as you tested it) in the official release.

Yes, went back to the provided audi_services.py and all works again. Thanks!

LCMilstein commented 1 year ago

@chemgeek and @menloperk and others, this seems to have broken again with the release of My Audi 4.17.0. Would you be able to propose a diff that I could try to see if I can get it working and/or tell me how you're finding these URLs so I can try to investigate on my end? I am not sure where to begin.

t0bias-r commented 1 year ago

@chemgeek and @menloperk and others, this seems to have broken again with the release of My Audi 4.17.0. Would you be able to propose a diff that I could try to see if I can get it working and/or tell me how you're finding these URLs so I can try to investigate on my end? I am not sure where to begin.

@LCMilstein, @chemgeek, @menloperk Implementation works on my end. Not every app update includes breaking changes. There seem to be problems with the Audi backend at the moment, as the app also show errors on a daily basis. grafik grafik

asemev commented 1 year ago

still doesnt work :(

asemev commented 1 year ago

its now suddenly working again. but its showing only 2 entities :(

github-actions[bot] commented 7 months ago

This issue is stale because it has been open for 30 days with no activity. Are you still experiencing this issue?

github-actions[bot] commented 7 months ago

This issue was closed because it has been inactive for 30 days since being marked as stale.