Audi MMI support

Still only two entities.

This is what appears on the register:

2023-07-08 12:48:07.190 ERROR (MainThread) [custom_components.audiconnect.audi_connect_account] support_status_report set to False: 502 2023-07-08 12:48:07.563 ERROR (MainThread) [custom_components.audiconnect.audi_connect_account] Unable to obtain the vehicle shortTerm tripdata of WAUZZZFZ4PP020290: 403, message='', url=URL('https://mal-3a.prd.eu.dp.vwg-connect.com/api/bs/tripstatistics/v1/vehicles/WAUZZZFZ4PP020290/tripdata/shortTerm?type=list&from=1970-01-01T00:00:00Z&to=2023-07-08T12:18:07Z') 2023-07-08 12:48:07.663 ERROR (MainThread) [custom_components.audiconnect.audi_connect_account] Unable to obtain the vehicle longTerm tripdata of WAUZZZFZ4PP020290: 403, message='', url=URL('https://mal-3a.prd.eu.dp.vwg-connect.com/api/bs/tripstatistics/v1/vehicles/WAUZZZFZ4PP020290/tripdata/longTerm?type=list&from=1970-01-01T00:00:00Z&to=2023-07-08T12:18:07Z') 2023-07-08 12:48:07.770 ERROR (MainThread) [custom_components.audiconnect.audi_connect_account] support_position set to False: 502 2023-07-08 12:48:07.880 ERROR (MainThread) [custom_components.audiconnect.audi_connect_account] support_climater set to False: 403 2023-07-08 12:48:07.985 ERROR (MainThread) [custom_components.audiconnect.audi_connect_account] support_charger set to False: 403 2023-07-08 12:48:08.092 ERROR (MainThread) [custom_components.audiconnect.audi_connect_account] support_preheater set to False: 502

I’ve exactly the same and didn’t find a solution for it yet.

Anybody familiar with another script or whatsoever that is able to capture information from Audi’s API?

I have those messages as well but always have those message about the trip data. I updated to 2023.7.2 from 2023.7.1 and all my entities are gone.

Not seeing any connection errors in the logs. The integration not complaining.

image

However my entites are all gone.

image

Integration was working great for me but seems very broken again :frowning: I am assuming it’s Audi and not HA updates

Hi, I’ve installed again, and with username and password I get 2 entities, model and lock (which isn’t an option in the myAudi app, so its spurious) and a bunch of error logs suggesting it couldn’t detect available other features. I mainly wanted battery charge level for my q4 etron. Came across this, which seems to work better, as long as the free tronity account I made lasts. Give tronity a few moments to grab car data, it wasn’t immediate:

1 Like

Thanks so much for this suggestion! It took a while for the app to load the details (about 10 minutes I guess), but data was available in HA immediately when I added the integration.

Let’s hope the free-account lasts for a while :slight_smile: Based on the pricing page I didn’t see why not, so we’ll see.

Hm… after another restart integrations stopped to work again, though this time it looks not like the authorisation/connection to audi servers issue, but something internal to integration or HA itself (just updated to 2023.7 and this might be the issue). Now I get whole bunch of errors in the log:

2023-08-03 17:57:09.266 ERROR (MainThread) [homeassistant.components.sensor] Error adding entities for domain sensor with platform audiconnect
Traceback (most recent call last):
  File "/usr/src/homeassistant/homeassistant/helpers/entity_platform.py", line 510, in async_add_entities
    await asyncio.gather(*tasks)
  File "/usr/src/homeassistant/homeassistant/helpers/entity_platform.py", line 619, in _async_add_entity
    device = dev_reg.async_get(self.hass).async_get_or_create(
             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
TypeError: DeviceRegistry.async_get_or_create() got an unexpected keyword argument 'device_type'
2023-08-03 17:57:09.267 ERROR (MainThread) [homeassistant.components.binary_sensor] Error adding entities for domain binary_sensor with platform audiconnect
Traceback (most recent call last):
  File "/usr/src/homeassistant/homeassistant/helpers/entity_platform.py", line 510, in async_add_entities
    await asyncio.gather(*tasks)
  File "/usr/src/homeassistant/homeassistant/helpers/entity_platform.py", line 619, in _async_add_entity
    device = dev_reg.async_get(self.hass).async_get_or_create(
             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
TypeError: DeviceRegistry.async_get_or_create() got an unexpected keyword argument 'device_type'
2023-08-03 17:57:09.268 ERROR (MainThread) [homeassistant.components.lock] Error adding entities for domain lock with platform audiconnect
Traceback (most recent call last):
  File "/usr/src/homeassistant/homeassistant/helpers/entity_platform.py", line 510, in async_add_entities
    await asyncio.gather(*tasks)
  File "/usr/src/homeassistant/homeassistant/helpers/entity_platform.py", line 619, in _async_add_entity
    device = dev_reg.async_get(self.hass).async_get_or_create(
             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
TypeError: DeviceRegistry.async_get_or_create() got an unexpected keyword argument 'device_type'
2023-08-03 17:57:09.269 ERROR (MainThread) [homeassistant.components.device_tracker] Error adding entities for domain device_tracker with platform audiconnect
Traceback (most recent call last):
  File "/usr/src/homeassistant/homeassistant/helpers/entity_platform.py", line 510, in async_add_entities
    await asyncio.gather(*tasks)
  File "/usr/src/homeassistant/homeassistant/helpers/entity_platform.py", line 619, in _async_add_entity
    device = dev_reg.async_get(self.hass).async_get_or_create(
             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
TypeError: DeviceRegistry.async_get_or_create() got an unexpected keyword argument 'device_type'
2023-08-03 17:57:09.270 ERROR (MainThread) [homeassistant.components.sensor] Error while setting up audiconnect platform for sensor
Traceback (most recent call last):
  File "/usr/src/homeassistant/homeassistant/helpers/entity_platform.py", line 370, in _async_setup_platform
    await asyncio.gather(*pending)
  File "/usr/src/homeassistant/homeassistant/helpers/entity_platform.py", line 510, in async_add_entities
    await asyncio.gather(*tasks)
  File "/usr/src/homeassistant/homeassistant/helpers/entity_platform.py", line 619, in _async_add_entity
    device = dev_reg.async_get(self.hass).async_get_or_create(
             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
TypeError: DeviceRegistry.async_get_or_create() got an unexpected keyword argument 'device_type'
2023-08-03 17:57:09.271 ERROR (MainThread) [homeassistant.components.binary_sensor] Error while setting up audiconnect platform for binary_sensor
Traceback (most recent call last):
  File "/usr/src/homeassistant/homeassistant/helpers/entity_platform.py", line 370, in _async_setup_platform
    await asyncio.gather(*pending)
  File "/usr/src/homeassistant/homeassistant/helpers/entity_platform.py", line 510, in async_add_entities
    await asyncio.gather(*tasks)
  File "/usr/src/homeassistant/homeassistant/helpers/entity_platform.py", line 619, in _async_add_entity
    device = dev_reg.async_get(self.hass).async_get_or_create(
             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
TypeError: DeviceRegistry.async_get_or_create() got an unexpected keyword argument 'device_type'
2023-08-03 17:57:09.272 ERROR (MainThread) [homeassistant.components.lock] Error while setting up audiconnect platform for lock
Traceback (most recent call last):
  File "/usr/src/homeassistant/homeassistant/helpers/entity_platform.py", line 370, in _async_setup_platform
    await asyncio.gather(*pending)
  File "/usr/src/homeassistant/homeassistant/helpers/entity_platform.py", line 510, in async_add_entities
    await asyncio.gather(*tasks)
  File "/usr/src/homeassistant/homeassistant/helpers/entity_platform.py", line 619, in _async_add_entity
    device = dev_reg.async_get(self.hass).async_get_or_create(
             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
TypeError: DeviceRegistry.async_get_or_create() got an unexpected keyword argument 'device_type'
2023-08-03 17:57:09.273 ERROR (MainThread) [homeassistant.components.device_tracker] Error while setting up audiconnect platform for device_tracker
Traceback (most recent call last):
  File "/usr/src/homeassistant/homeassistant/helpers/entity_platform.py", line 370, in _async_setup_platform
    await asyncio.gather(*pending)
  File "/usr/src/homeassistant/homeassistant/helpers/entity_platform.py", line 510, in async_add_entities
    await asyncio.gather(*tasks)
  File "/usr/src/homeassistant/homeassistant/helpers/entity_platform.py", line 619, in _async_add_entity
    device = dev_reg.async_get(self.hass).async_get_or_create(
             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
TypeError: DeviceRegistry.async_get_or_create() got an unexpected keyword argument 'device_type'

Anyone else experiencing similar problem? Any known solution?

There’s a solution to this here and here. Alternatively, there’s a better maintained fork: cyr-ius/hass-audiconnect: Adds an audi connect integration to home assistant (github.com)

Thank you!

For information, those fixes are incorporated in this other fork as well GitHub - t0bias-r/audi_connect_ha: Adds an audi connect integration to home assistant - seems to be slightly further ahead and working for at least that e-tron owner.

However, despite that, for my Q4 e-tron I’m still seeing that the integration fails to get much from the audi servers at all, except the correct model and VIN.

The error /debug messages the component provides:

2023-08-24 17:12:08.872 INFO (MainThread) [homeassistant.setup] Setting up audiconnect
2023-08-24 17:12:08.872 INFO (MainThread) [homeassistant.setup] Setup of domain audiconnect took 0.0 seconds
2023-08-24 17:12:11.695 ERROR (MainThread) [custom_components.audiconnect.audi_connect_account] Unable to obtain the vehicle shortTerm tripdata of [VIN]: 403, message='', url=URL('https://mal-1a.prd.ece.vwg-connect.com/api/bs/tripstatistics/v1/vehicles/[VIN]/tripdata/shortTerm?type=list&from=1970-01-01T00:00:00Z&to=2023-08-24T17:42:11Z')
2023-08-24 17:12:11.841 ERROR (MainThread) [custom_components.audiconnect.audi_connect_account] Unable to obtain the vehicle longTerm tripdata of [VIN]: 403, message='', url=URL('https://mal-1a.prd.ece.vwg-connect.com/api/bs/tripstatistics/v1/vehicles/[VIN]/tripdata/longTerm?type=list&from=1970-01-01T00:00:00Z&to=2023-08-24T17:42:11Z')
2023-08-24 17:12:12.393 INFO (MainThread) [homeassistant.components.sensor] Setting up sensor.audiconnect
2023-08-24 17:12:12.395 INFO (MainThread) [homeassistant.components.binary_sensor] Setting up binary_sensor.audiconnect
2023-08-24 17:12:12.397 INFO (MainThread) [homeassistant.components.switch] Setting up switch.audiconnect
2023-08-24 17:12:12.400 INFO (MainThread) [homeassistant.components.device_tracker] Setting up device_tracker.audiconnect
2023-08-24 17:12:12.403 INFO (MainThread) [homeassistant.components.lock] Setting up lock.audiconnect
2023-08-24 17:12:12.408 INFO (MainThread) [homeassistant.helpers.entity_registry] Registered new sensor.audiconnect entity: sensor.audi_q4_e_tron_model
2023-08-24 17:12:12.409 INFO (MainThread) [homeassistant.helpers.entity_registry] Registered new lock.audiconnect entity: lock.audi_q4_e_tron_door_lock

Sometimes those come up as 401 errors instead. Given the integration doesn’t seem to be throwing exceptions in the initial communication and got some correct details of the car, its not falling over at the login credentials or because the audi servers are rejecting the integration spoofing the app out of hand. My suspicion is a lot of the assumed features aren’t available/exposed in the way the integration expects. e.g. errors on trip data aren’t surprising as I don’t get that on the app either; but I also don’t get lock control on the app - its not a function this car version supports - yet the integration is setting up a switch. Suggests its not really handling the responses its getting and may be more variations than the original developer expected.

I tried

service: audiconnect.refresh_data
data: 
  vin: [VIN]

and got

2023-08-24 17:16:53.147 DEBUG (MainThread) [custom_components.audiconnect.audi_connect_account] Sending command to refresh data to vehicle [VIN]
2023-08-24 17:16:53.440 ERROR (MainThread) [custom_components.audiconnect.util] Unable to refresh vehicle data of [VIN]: 502, message='', url=URL('https://msg.volkswagen.de/fs-car/bs/vsr/v1/Audi/DE/vehicles/[VIN]/requests')
2023-08-24 17:16:53.442 ERROR (MainThread) [custom_components.audiconnect.audi_account] Error refreshing vehicle data [VIN]
NoneType: None

I’m posting only in case someone else has the energy and enthusiasm to debug further. For the past few weeks I’ve got usable and fairly reliable data on battery level and charge status via the 3rd party tronity solution I posted above, slightly more latency but enough for what I need. If that stops or I get a round toit I might create a fork with a lot more debug logging to see what is actually going on, as turning on “debug” log level doesn’t add much at all. Pretty sure if someone could find the right place to put in more verbose reporting of the responses coming back it’d be possible to improve some of the handling…

What is “[VIN]”? Did you replace your real VIN with the string “[VIN]” for posting, so that we do not see your real VIN? Or did you really use the string “[VIN]” in the code?

Replaced my actual vin for posting. The actual vin is correct for the vehicle.

I have try this integration with q4 etron but I have no entities and this errors

  1. Error 1

Logger: homeassistant.components.sensor
Source: helpers/entity_platform.py:616
Integration: Sensore (documentation, issues)
First occurred: 7 settembre 2023 alle ore 22:33:26 (6 occurrences)
Last logged: 22:36:13

  • Error adding entities for domain sensor with platform audiconnect
  • Error while setting up audiconnect platform for sensor

Traceback (most recent call last): File “/usr/src/homeassistant/homeassistant/helpers/entity_platform.py”, line 507, in async_add_entities await asyncio.gather(*tasks) File “/usr/src/homeassistant/homeassistant/helpers/entity_platform.py”, line 616, in _async_add_entity device = dev_reg.async_get(self.hass).async_get_or_create( ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ TypeError: DeviceRegistry.async_get_or_create() got an unexpected keyword argument ‘device_type’

ERROR 2

Logger: custom_components.audiconnect.audi_connect_account
Source: custom_components/audiconnect/audi_connect_account.py:109
Integration: Audi Connect (documentation, issues)
First occurred: 7 settembre 2023 alle ore 22:43:29 (290 occurrences)
Last logged: 22:41:02

The device type error is fixed in the branch I link above, I think, but I also still see the the long term trip data error. Fwiw, I’ve discovered via other Audi forums that I have quite an early SW version and may not work with other integrations ( that aren’t HA based ). Not convinced the API is returning what this integration expects and therefore it’s falling over parsing the responses. Do you get long term trip data in the app? I don’t so it’s looking for data not even exposed in my version of the myAudi app.

My energy supplier Octopus has an ‘Intelligent’ tariff that needs to control the charge time for the vehicle and they report “There are known issues with Audi at the moment that we are working to fix”. This is independent of HA but I think it suggests not all q4/e-tron/SW builds are equal.

It seems that Q4 e-tron is still in bad shape. Has anyone managed to get enything else out that model information and lock status?

I posted this up the thread: suggest you sign up for a free account at https://www.tronity.io/ then there is an integration GitHub - tronity/homeassistant: The Tronity Integration is a custom integration developed for Home Assistant, designed to enable you to monitor and utilize the data provided by Tronity. By integrating Tronity with Home Assistant, you can easily monitor your vehicle's data and create automations based on it.

Since I got a software update at its service, I get 9 entities including range and odometer, charge status, charge level, plugged, charge power, tracker etc. 2021 q4 e-tron.

There is a 14-days free trial. Afterwards it costs 2.99 € / month.

I’m not paying been using it for more than 14d. Turns out I must have got some kind of early access free 12 month subscription. Maybe that isn’t available any more.

Here’s a referral link/code for 25% off TRONITY | Your Car. Your Data
| or Code: ZDZEHSBW

I can’t say its worth it just to get reliable data into HA.

hey @vic

You have a nice card, is it possible to paste your yaml here?

thnx

I’ve setup iobroker which provides a nice vw-connect integration (useable with Q4 etron 2023 at least) and also talks mqtt.
Let it talk to your mqtt broker and use the data in homeassistant.

result:

card from:

then you just need a little automation for device_tracker.see to move the car on the map according to the location data you get by mqtt so you can track your trips