Audi MMI support

It’s broken again, I suspect Audi has changed login procedure.

This error originated from a custom integration.

Logger: homeassistant.config_entries
Source: custom_components/audiconnect/audi_services.py:241
Integration: Audi Connect
First occurred: 09:54:33 (1 occurrences)
Last logged: 09:54:33

Error setting up entry <redacted> for audiconnect
Traceback (most recent call last):
  File "/usr/src/homeassistant/homeassistant/config_entries.py", line 313, in async_setup
    result = await component.async_setup_entry(hass, self)  # type: ignore
  File "/config/custom_components/audiconnect/__init__.py", line 106, in async_setup_entry
    return await data.update(utcnow())
  File "/config/custom_components/audiconnect/audi_account.py", line 162, in update
    if not await self.connection.update(None):
  File "/config/custom_components/audiconnect/audi_connect_account.py", line 113, in update
    vehicles_response = await self._audi_service.get_vehicle_information()
  File "/config/custom_components/audiconnect/audi_services.py", line 241, in get_vehicle_information
    "Authorization": "Bearer " + self.audiToken["access_token"],
KeyError: 'access_token'

Here, in DE, it works. Yesterday was a problem during evening, myAudi in Browser wont work too, this morning everything went find.

Still broken for me. It did only break after i restarted HA. Would yopu mind checking that?

I see a pull request in ha integration:

There is a commit that removes the "Bearer " string from the client-id.

Yes, couple of reboot today caused other things (integrate new things), works without problems.
Today my first way was myaudi and i have to confirm some things about data protection to see my car in browser.

And just to confirm: with the PR it works for me.

Since some time I started to see in my log file errors related to this integration. Strangely all the sensors work fine. Any idea what this indicates:

2022-02-12 15:35:06 ERROR (MainThread) [custom_components.audiconnect.audi_connect_account] Unable to obtain the vehicle shortTerm tripdata of WAUZZZFY1Hxxxxxxx: 403, message='Forbidden', url=URL('https://mal-1a.prd.ece.vwg-connect.com/api/bs/tripstatistics/v1/vehicles/WAUZZZFY1Hxxxxxxx/tripdata/shortTerm?type=list&from=1970-01-01T00:00:00Z&to=2022-02-12T16:05:05Z')
2022-02-12 15:35:06 ERROR (MainThread) [custom_components.audiconnect.audi_connect_account] Unable to obtain the vehicle longTerm tripdata of WAUZZZFY1Hxxxxxxx: 403, message='Forbidden', url=URL('https://mal-1a.prd.ece.vwg-connect.com/api/bs/tripstatistics/v1/vehicles/WAUZZZFY1Hxxxxxxx/tripdata/longTerm?type=list&from=1970-01-01T00:00:00Z&to=2022-02-12T16:05:06Z')

After the last update, the service to start climatisation is working with the E-Tron thanks to arjenvrh!

Anyone else in the US no longer able to log in? I’m getting errors on startup so I deleted and tried to re-add the integration and it simply gives me “Invalid Credentials.” I’ve confirmed the account is good in both the phone app and the web. My guess is the web has changed and the HA integration doesn’t match it now.

I got the same in DE region, when try to add Audi Connect intergration and place data get info Invalid credentials. Anyone has the same and can help?

This fixed on my side:

Thank you very much! Working!! :slight_smile:

Same here - working again!! Thank you for the folks contributing to this integration.

What change did you exactly made to make it working again? From linked post it seems that only version number was changed from 4.5.1 to 4.6.0 (or I missed something more), but it does not resolve the problem, at least for me…

In the link on the page, in menue, files changed, there are 3 files changed, this change you have to change on your side to make it run.

1 Like

Ups… did not expanded the view :man_facepalming:
Thanks a lot!

I installed this integration about a year ago, but it stopped working (Audi was complaining too much activity I think), so I removed it.

I added it again yesterday.

  1. This time Model reports as unknown, so everything got named with “None/none” in the name instead of my model name.

  2. Anyone know where the poll interval is stored? I forgot to check this when I installed, and want to maybe change it to a longer time (to avoid any potential issue as I may have had the first time I tried this.)

Thanks!

Found it in core.config_entries. Is it safe to change this file, or is there a UI way to update Scan_Interval? I would have thought there should be a UI method, since maybe one might need to update a password, etc., occasionally.

At every core update I have issues with this integration, Now
I I disable the integration before upgrading the core and enable after update.
But also sensors fail (update of integration?)
image

Is there any way to make this integraton only get new info by the press of a button instead of every 10 minutes?

When first installed, it worked fine, but eventually (within a few days) I start getting “forbidden” errors, like I’ve been throttled or something. I reinstalled this 10 days ago (Mar 1) and it stopped Mar 6 with those errors coming every 10 minutes as it attempts to login.

2022-03-06 17:15:53 ERROR (MainThread) [custom_components.audiconnect.audi_connect_account] Unable to obtain the vehicle shortTerm tripdata of WA1Cxxxxxxxxx: 403, message='Forbidden', url=URL('https://mal-1a.prd.ece.vwg-connect.com/api/bs/tripstatistics/v1/vehicles/WA1Cxxxxxxxxx/tripdata/shortTerm?type=list&from=1970-01-01T00:00:00Z&to=2022-03-06T23:45:53Z')

I reported this error some time ago: Audi MMI support - #448 by mirekmal
Ended with disabling logger writing this to file:

logger:
  default: warning
  #default: info
  logs:
    custom_components.audiconnect.audi_connect_account: fatal

I wonder if this is somehow model specific and audi connect does not report this for every car? I do not see any shortTerm tripdata data for my car (2017 Q5) inside the app…

BTW, integration again stopped to work for me yesterday… typical issue with logging into service, perhaps URL changes by them again. How are they maintaining this for their native app? It is not updated so frequently as URLs change…