Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Audi Connect Integration to HA fails: Audi has changed the web API. The old Web-API functions have been disabled #228

Closed
hhoehler opened this issue Feb 27, 2024 · 156 comments

Comments

@hhoehler
Copy link

Hi,
today I upgraded my HA to Core 2024.2.4. For some reason my Audi Connect Integration is not working properly after the upgrade and even with a couple of HA restarts. I don´t receive plenty of error messages in the logs, but for some reason I´m only getting 7 entities after reboot. Most of them are useless for my purpose (since unavailable for my car anyway), but it might play a role to name them:

  • longterm trip data, unavailable
  • longterm trip user reset, unavailable
  • shortterm trip data, unavailable
  • shortterm trip user reset, unavailable
  • Climatisation state, available
  • Door lock, available
  • Model, available

I saw, that you are not actively maintaining the integration anymore, but potentially you have a hint to fix the error for me or could even do the correction?

Thanks in advance for your feedback!

kr,
Holger

@TheMrCappie
Copy link

You are not alone. I too have the bug.

@cdnninja
Copy link
Collaborator

I have merge access so if someone finds the fix please create a pr.

@derhappy
Copy link

derhappy commented Feb 27, 2024 via email

@anordnes
Copy link

Same here. does not work with other than model climate status, model and lock after the 2024.2.4 update

@sebadv
Copy link

sebadv commented Feb 27, 2024

Same here. does not work with other than model climate status, model and lock after the 2024.2.4 update

Same here. I looked at the logs but couldn't see anything except the trip history error (known issue).

@t0bias-r
Copy link
Contributor

What can be seen is that Audi has changed the web API. The new web API has already been used in the latest smartphone apps and now the old Web-API functions have been disabled.
On the smartphone this means that old app versions no longer work and therefore this plugin no longer works, too.
This becomes visible in the HTTP code 403.

Example of status query:
old:
https://fal-3a.prd.eu.dp.vwg-connect.com/fs-car/bs/vsr/v1/Audi/DE/vehicles/WAUZZZGE3RB999999/status
new:
https://emea.bff.cariad.digital/vehicle/v1/vehicles/WAUZZZGE3RB999999/selectivestatus?jobs=charging%2CchargingTimers%2CchargingProfiles%2CfuelStatus%2Cmeasurements%2CoilLevel%2CvehicleHealthInspection%2Caccess%2CvehicleLights%2CvehicleHealthWarnings

Of course, the json format of the response has also changed

@t0bias-r
Copy link
Contributor

@hhoehler I suggest to update the title of that issue

@t0bias-r
Copy link
Contributor

This fork uses the new endpoint:
https://github.com/moritzwiechers/audi_connect_ha_q4

@hhoehler hhoehler changed the title Upgrade to Home Assistant Core 2024.2.4 Audi Connect Integration to HA fails: Audi has changed the web API. The old Web-API functions have been disabled Feb 28, 2024
@hhoehler
Copy link
Author

Thanks Tobias, your proposed solution with the forked code is working for me. Let´s keep fingers crossed that Audi is not changing the API again.

@anordnes
Copy link

Works for me too. Thanks!

@pittbull
Copy link

pittbull commented Feb 28, 2024

I have removed the original integration from hacs and installed this, but that have left me without any Audi-integration. Was I supposed to just change specific code within the existing integration?

Edit: Resolved. Reinstalled both and confirm that it works here as well.

@moritzmaier84
Copy link

Can someone explain me step-by-step what I do have to do to fix that with the other new audi_connect_ha_q4 thing?

Also: I have an A4 - is this working, tough?

I have no clue how do go on. Would be great to get some support.

Thank you!

@hhoehler
Copy link
Author

Hi,

  • I removed the old integration in HA. (settings, integration, audi connect, integration settings, delete) (not sure if these translations are correct, since I´m using my HA in German?)
  • than I downloaded the folked code via HACS (user specific repository, moritzwiechers/audi_connect_ha_q4
    )
  • than I installed the package under integration in HA. I haven´t looked it up, but I think it just overrides the existing code. In any case the name you need to look for is the same (think it was Audi connect)
  • last: configure the solution with your userid, password and so on as before and described.

I can´t tell you if it works for an A4. I´m using an Audi Etron. However, the solution provides me with 25 entities again and I´m just using 1 or 2 in my HA Instance. However, the one or other is renamed compared to the previous package - but the 25 are there in my case and available.

Hope that helps?
Holger

@Gunth
Copy link

Gunth commented Feb 28, 2024

I think it's correclty working only if you have an electric one, it doens't work on my side arround this part of code because my A4 is not a eletric one and I assume that the batteryStatus doens't exist in the payload returned by Audi api

batteryStatus = data["charging"]["batteryStatus"]["value"]["currentSOC_pct"]
cruisingRange = data["charging"]["batteryStatus"]["value"]["cruisingRangeElectric_km"]
tsCarCaptured = data["charging"]["batteryStatus"]["value"]["carCapturedTimestamp"]
milage = data["measurements"]["odometerStatus"]["value"]["odometer"]
milageTsCarCaptured = data["measurements"]["odometerStatus"]["value"]["carCapturedTimestamp"]

@moritzmaier84
Copy link

I think it's correclty working only if you have an electric one, it doens't work on my side arround this part of code because my A4 is not a eletric one and I assume that the batteryStatus doens't exist in the payload returned by Audi api

batteryStatus = data["charging"]["batteryStatus"]["value"]["currentSOC_pct"]
cruisingRange = data["charging"]["batteryStatus"]["value"]["cruisingRangeElectric_km"]
tsCarCaptured = data["charging"]["batteryStatus"]["value"]["carCapturedTimestamp"]
milage = data["measurements"]["odometerStatus"]["value"]["odometer"]
milageTsCarCaptured = data["measurements"]["odometerStatus"]["value"]["carCapturedTimestamp"]

thank you.. yeah mine i non-electric, too :(

@moritzmaier84
Copy link

Hi,

* I removed the old integration in HA. (settings, integration, audi connect, integration settings, delete) (not sure if these translations are correct, since I´m using my HA in German?)

* than I downloaded the folked code via HACS (user specific repository, moritzwiechers/audi_connect_ha_q4
  )

* than I installed the package under integration in HA. I haven´t looked it up, but I think it just overrides the existing code. In any case the name you need to look for is the same (think it was Audi connect)

* last: configure the solution with your userid, password and so on as before and described.

I can´t tell you if it works for an A4. I´m using an Audi Etron. However, the solution provides me with 25 entities again and I´m just using 1 or 2 in my HA Instance. However, the one or other is renamed compared to the previous package - but the 25 are there in my case and available.

Hope that helps? Holger

danke für deine mühe, holger!

mine is non-electric... don't really know if there's a fix for this, though

@cpohli
Copy link

cpohli commented Feb 28, 2024

The workaround only gives me 2 working sensors on my A6 hybrid - door lock and climatization state.
That's all. All others are gone.
So basically the same sensors i still see with the original, unforked integration.
That's a pity ...

@egg02
Copy link

egg02 commented Feb 28, 2024

Same for me. I lost most of the sensors with the workaround. Tank level, mileage, inspection time/distance, oil change time/distance, range, ... all gone.

With the original integration, I only get the model name. With the workaround, I additionally get the charging rate (which I don't need as I have no electric Audi) and the door lock (which I don't use...)

@heidle78
Copy link

heidle78 commented Feb 28, 2024

I tried the same for my A6 hybrid and I just see 5 entities and location works, model is correct, climatization status works,. charging rate is unknown and door unlock is there but shows me an old status. Really strange, anybody has an idea where to check or adapt something? Seems that it´s partially working as the position is real time and correct - but before I had approx 25 entities

@SteffoB
Copy link

SteffoB commented Feb 29, 2024

I have the same issue. According to my understanding the fork solves the issues for electric cars but not for diesel or gasoline driven cars. I have a diesel so I assume that the fork would not solve it for me.
Is there any plans for updating the integration or is there anything I can do myself to fix the issue?
Unfortunately I am not a developer. My coding skills are limited to being able to write simple code in basic on a C64 in the 80:s so I am not at all proficcient in doing something like this.

@gac3k
Copy link

gac3k commented Feb 29, 2024

@egg02 @heidle78 @SteffoB I am a developer and I also have similar problem, so if there's no reply from @arjenvrh I'll try to contribute here with proper fix, or will create another fork :)

@moritzmaier84
Copy link

@gac3k Great news! Thank you I think we‘ll need that.

@QuiNz0r
Copy link

QuiNz0r commented Feb 29, 2024

Same issue, the fork only fixes the endpoints for electric models.
Please somebody with knowledge can look into a fix?

@jackc94
Copy link

jackc94 commented Feb 29, 2024

@gac3k That would be incredible… I’ve become strangely reliant on this integration so would be great to see it return.

@hhoehler
Copy link
Author

@gac3k Hi, even though the forked solution we are mainly discussing in this chain is working for my electric Audi pretty well, I would like to emphasize the need for somebody with appropriate skills taking the code over on a more longer term basis and maybe making it work for a number of (electric and non-electric) Audi models. I´m using this integration since round about a year and had 2 times the problem that Audi changed the API. Actually there is nobody who wants to do the maintenance of this integration and therefore it´s a risk building on it. So please have a look into the code and decide if you have the capacity and freedom helping all of us.

@BiffaGitHub
Copy link

Yes it's very quickly become an integration i use every day. Just a side note, the q4 etron fork doesn't work for all EV cars or etrons. I have an etron but Q8 and only about half of the entities work. I tried this out on my test system and don't want to install into production.

I truly praise any developer that can get arjens version working. 🤞

@GMTheDoctor
Copy link

News for a fix? Still can't use it 😢

@t0bias-r
Copy link
Contributor

t0bias-r commented Mar 1, 2024

I've pushed fixes to my existing fork:
https://github.com/t0bias-r/audi_connect_ha/tree/master

actions like start climatisation fail, but I can query all information from my car.

@t0bias-r
Copy link
Contributor

t0bias-r commented Mar 5, 2024

@t0bias-r , would it be possible to retrieve tyre sensors data as well in future updates?

@guidokieboom If do not have the tyre information for my car in the app, but if you would share your credentials, then I could capture the app's network/API traffic and maybe find the API call for the type information. You could send a private mail to [email protected]

@moritzmaier84
Copy link

@t0bias-r

I did move the car several times but still no GPS sensor. It‘s not „unknown“ or something, it‘s not even there.
Is there anything I can help to find a way back to it?

@Ingrimmsch93
Copy link
Contributor

@t0bias-r

I did move the car several times but still no GPS sensor. It‘s not „unknown“ or something, it‘s not even there.

Is there anything I can help to find a way back to it?

image

Check if you have this line (206) in your audi_services.py. If not, add it and uncomment it.
Afterwards restart Home Assistant. You should find a log entry with "Data from your Audi:".

Post this log data here.

I can try to find the problem this evening. Maybe @t0bias-r or @DivingUp can also have a look :)

@derhappy
Copy link

derhappy commented Mar 5, 2024

For me it's working with the current version from HACS (0332c1a). It's the following entity for our car: device_tracker.audi_e_tron_sportback_position

@BiffaGitHub
Copy link

Thanks for the great work. I have tested the fork https://github.com/t0bias-r/audi_connect_ha version ab3266e with a Audi E-tron 55 2020. Nearly all values are available, there are only missing:

  • longterm and shortterm trip data
  • Climatisation state
  • Energy flow
  • Last Update
  • Max charge current
  • remain charge time
  • Service inspection

If I can do any logging, please give me some instructions.

edit: with commit 35b7209 "last update" is now working

So upfront I apologize for not having a clue how all this works, but I am so happy with @t0bias-r fork, which has got most of the entities I use in Home assistant automations. I have listed below the missing entities, I just don't know if they can be pulled from the interface or if Audi did something to remove them? Also an Etron 55 as below.
Thanks for any pointers.

Audi Etron Q8 DE_Home Assistant

@moritzmaier84
Copy link

moritzmaier84 commented Mar 5, 2024

@t0bias-r
I did move the car several times but still no GPS sensor. It‘s not „unknown“ or something, it‘s not even there.
Is there anything I can help to find a way back to it?

image

Check if you have this line (206) in your audi_services.py. If not, add it and uncomment it. Afterwards restart Home Assistant. You should find a log entry with "Data from your Audi:".

Post this log data here.

I can try to find the problem this evening. Maybe @t0bias-r or @DivingUp can also have a look :)

@Ingrimmsch93
@t0bias-r

Thx, did it. Here is the result.
Interesting: Since 2 hours, I DO have the GPS entity. Strange? I hope it's not vanishing again.
I am still missing "fuel%" and some others like inspection date, oil, lights and more.

Logger: custom_components.audiconnect.audi_services
Source: custom_components/audiconnect/audi_services.py:206
Integration: Audi Connect (documentation, issues)
First occurred: 15:07:28 (1 occurrences)
Last logged: 15:07:28

DATA From AUDI: {'access': {'accessStatus': {'value': {'overallStatus': 'safe', 'carCapturedTimestamp': datetime.datetime(2024, 3, 4, 21, 29, 53, tzinfo=datetime.timezone.utc), 'doors': [{'name': 'bonnet', 'status': ['closed']}, {'name': 'frontLeft', 'status': ['locked', 'closed']}, {'name': 'frontRight', 'status': ['locked', 'closed']}, {'name': 'rearLeft', 'status': ['locked', 'closed']}, {'name': 'rearRight', 'status': ['locked', 'closed']}, {'name': 'trunk', 'status': ['locked', 'closed']}], 'windows': [{'name': 'frontLeft', 'status': ['closed']}, {'name': 'frontRight', 'status': ['closed']}, {'name': 'rearLeft', 'status': ['closed']}, {'name': 'rearRight', 'status': ['closed']}, {'name': 'roofCover', 'status': ['unsupported']}, {'name': 'sunRoof', 'status': ['closed']}], 'doorLockStatus': 'locked'}}}, 'fuelStatus': {'rangeStatus': {'value': {'carCapturedTimestamp': datetime.datetime(2024, 3, 4, 21, 29, 53, tzinfo=datetime.timezone.utc), 'carType': 'gasoline', 'primaryEngine': {'type': 'gasoline', 'currentSOC_pct': 100, 'remainingRange_km': 770, 'currentFuelLevel_pct': 100}, 'totalRange_km': 770}}}, 'measurements': {'rangeStatus': {'value': {'carCapturedTimestamp': datetime.datetime(2024, 3, 4, 21, 29, 53, tzinfo=datetime.timezone.utc), 'gasolineRange': 770, 'totalRange_km': 770}}, 'odometerStatus': {'value': {'carCapturedTimestamp': datetime.datetime(2024, 3, 4, 21, 29, 53, tzinfo=datetime.timezone.utc), 'odometer': 88704}}, 'fuelLevelStatus': {'value': {'carCapturedTimestamp': datetime.datetime(2024, 3, 4, 21, 29, 53, tzinfo=datetime.timezone.utc), 'currentFuelLevel_pct': 100, 'primaryEngineType': 'gasoline', 'carType': 'gasoline'}}}, 'oilLevel': {'oilLevelStatus': {'value': {'carCapturedTimestamp': datetime.datetime(2024, 3, 4, 21, 29, 53, tzinfo=datetime.timezone.utc), 'value': True}}}, 'vehicleLights': {'lightsStatus': {'value': {'carCapturedTimestamp': datetime.datetime(2024, 3, 4, 21, 29, 53, tzinfo=datetime.timezone.utc), 'lights': [{'name': 'right', 'status': 'off'}, {'name': 'left', 'status': 'off'}]}}}}


Logger: py.warnings
Source: custom_components/audiconnect/audi_connect_account.py:19
Integration: Audi Connect (documentation, issues)
First occurred: 15:07:11 (1 occurrences)
Last logged: 15:07:11

/config/custom_components/audiconnect/audi_services.py:886: SyntaxWarning: invalid escape sequence '\s' regex_res = re.findall('"hmac"\s*:\s*"[0-9a-fA-F]+"', email_rsptxt)


Logger: custom_components.audiconnect.audi_connect_account
Source: custom_components/audiconnect/audi_connect_account.py:687
Integration: Audi Connect (documentation, issues)
First occurred: 15:07:28 (2 occurrences)
Last logged: 15:07:28

Unable to obtain the vehicle shortTerm tripdata of WAUZZZxxxxxxxxxxx - {'vin': 'WAUZZZxxxxxxxxxxx', 'csid': 'ce38d6b8a4df429f9f00e262fe587abf', 'model': 'Audi A4 Avant design 2.0 TFSI S tronic', 'model_year': 2018, 'model_family': '', 'title': 'Audi A4 Avant', 'state': {'last_update_time': None, 'engineTypeFirstEngine': 'gasoline', 'primaryEngineRange': 770, 'hybridRange': 770}, 'fields': {'TOTAL_RANGE': 770, 'UTC_TIME_AND_KILOMETER_STATUS': 88704, 'STATE_LEFT_FRONT_WINDOW': '3', 'STATE_RIGHT_FRONT_WINDOW': '3', 'STATE_LEFT_REAR_WINDOW': '3', 'STATE_RIGHT_REAR_WINDOW': '3', 'STATE_SUN_ROOF_MOTOR_COVER': '3', 'LOCK_STATE_LEFT_FRONT_DOOR': '2', 'OPEN_STATE_LEFT_FRONT_DOOR': '3', 'LOCK_STATE_RIGHT_FRONT_DOOR': '2', 'OPEN_STATE_RIGHT_FRONT_DOOR': '3', 'LOCK_STATE_LEFT_REAR_DOOR': '2', 'OPEN_STATE_LEFT_REAR_DOOR': '3', 'LOCK_STATE_RIGHT_REAR_DOOR': '2', 'OPEN_STATE_RIGHT_REAR_DOOR': '3', 'LOCK_STATE_TRUNK_LID': '2', 'OPEN_STATE_TRUNK_LID': '3', 'OPEN_STATE_HOOD': '3'}}: 403, message='', url=URL('https://mal-1a.prd.ece.vwg-connect.com/api/bs/tripstatistics/v1/vehicles/WAUZZZxxxxxxxxxxx/tripdata/shortTerm?type=list&from=1970-01-01T00:00:00Z&to=2024-03-05T15:37:28Z')
Unable to obtain the vehicle longTerm tripdata of WAUZZZxxxxxxxxxxx - {'vin': 'WAUZZZxxxxxxxxxxx', 'csid': 'ce38d6b8a4df429f9f00e262fe587abf', 'model': 'Audi A4 Avant design 2.0 TFSI S tronic', 'model_year': 2018, 'model_family': '', 'title': 'Audi A4 Avant', 'state': {'last_update_time': None, 'engineTypeFirstEngine': 'gasoline', 'primaryEngineRange': 770, 'hybridRange': 770}, 'fields': {'TOTAL_RANGE': 770, 'UTC_TIME_AND_KILOMETER_STATUS': 88704, 'STATE_LEFT_FRONT_WINDOW': '3', 'STATE_RIGHT_FRONT_WINDOW': '3', 'STATE_LEFT_REAR_WINDOW': '3', 'STATE_RIGHT_REAR_WINDOW': '3', 'STATE_SUN_ROOF_MOTOR_COVER': '3', 'LOCK_STATE_LEFT_FRONT_DOOR': '2', 'OPEN_STATE_LEFT_FRONT_DOOR': '3', 'LOCK_STATE_RIGHT_FRONT_DOOR': '2', 'OPEN_STATE_RIGHT_FRONT_DOOR': '3', 'LOCK_STATE_LEFT_REAR_DOOR': '2', 'OPEN_STATE_LEFT_REAR_DOOR': '3', 'LOCK_STATE_RIGHT_REAR_DOOR': '2', 'OPEN_STATE_RIGHT_REAR_DOOR': '3', 'LOCK_STATE_TRUNK_LID': '2', 'OPEN_STATE_TRUNK_LID': '3', 'OPEN_STATE_HOOD': '3'}}: 403, message='', url=URL('https://mal-1a.prd.ece.vwg-connect.com/api/bs/tripstatistics/v1/vehicles/WAUZZZxxxxxxxxxxx/tripdata/longTerm?type=list&from=1970-01-01T00:00:00Z&to=2024-03-05T15:37:28Z')
Traceback (most recent call last):
File "/config/custom_components/audiconnect/audi_connect_account.py", line 687, in update_vehicle_tripdata
td_cur, td_rst = await self._audi_service.get_tripdata(self._vehicle.vin, kind)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/config/custom_components/audiconnect/audi_services.py", line 321, in get_tripdata
data = await self._api.request(
^^^^^^^^^^^^^^^^^^^^^^^^
File "/config/custom_components/audiconnect/audi_api.py", line 66, in request
raise ClientResponseError(
aiohttp.client_exceptions.ClientResponseError: 403, message='', url=URL('https://mal-1a.prd.ece.vwg-connect.com/api/bs/tripstatistics/v1/vehicles/WAUZZZxxxxxxxxxxx/tripdata/shortTerm?type=list&from=1970-01-01T00:00:00Z&to=2024-03-05T15:37:28Z')


Logger: homeassistant.components.device_tracker
Source: helpers/deprecation.py:205
Integration: Geräte-Tracker (documentation, issues)
First occurred: 15:07:33 (2 occurrences)
Last logged: 15:07:33

SOURCE_TYPE_GPS was used from audiconnect, this is a deprecated constant which will be removed in HA Core 2025.1. Use SourceType.GPS instead, please create a bug report at https://github.com/arjenvrh/audi_connect_ha/issues

@Ingrimmsch93
Copy link
Contributor

Ingrimmsch93 commented Mar 5, 2024

Thanks for the great work. I have tested the fork https://github.com/t0bias-r/audi_connect_ha version ab3266e with a Audi E-tron 55 2020. Nearly all values are available, there are only missing:

  • longterm and shortterm trip data
  • Climatisation state
  • Energy flow
  • Last Update
  • Max charge current
  • remain charge time
  • Service inspection

If I can do any logging, please give me some instructions.

edit: with commit 35b7209 "last update" is now working

So upfront I apologize for not having a clue how all this works, but I am so happy with @t0bias-r fork, which has got most of the entities I use in Home assistant automations. I have listed below the missing entities, I just don't know if they can be pulled from the interface or if Audi did something to remove them? Also an Etron 55 as below.

Thanks for any pointers.

For remaining charging time i pulled a fix at @t0bias-r. I think it is the same with your car. Funny this value will be only provided, when charging. The other charging values are not available with my hybrid. So in best case you can provide the log from your audi. I provided the steps to it in my last reply here.

My plans for this evening changed a bit, but i try to look into it later. No promise ;)

@BiffaGitHub
Copy link

So upfront I apologize for not having a clue how all this works, but I am so happy with @t0bias-r fork, which has got most of the entities I use in Home assistant automations. I have listed below the missing entities, I just don't know if they can be pulled from the interface or if Audi did something to remove them? Also an Etron 55 as below.
Thanks for any pointers.

For remaining charging time i pulled a fix at @t0bias-r. I think it is the same with your car. Funny this value will be only provided, when charging. The other charging values are not available with my hybrid. So in best case you can provide the log from your audi. I provided the steps to it in my last reply here.

My plans for this evening changed a bit, but i try to look into it later. No promise ;)

ok, so edited the .py file and pushed the output to Chatgpt to format into something readable and remove any vin. I hopefully(!) have attached the 2 text files with that output, to save on some real estate on this reply. Again, hugely sorry for my incompetence in doing this. currently travelling and having to use my cellphone to do this.

Here's the error log formatted for audi etron .txt
etron2 log trip data.txt

@t0bias-r
Copy link
Contributor

t0bias-r commented Mar 5, 2024

@BiffaGitHub HTTP code 429 means too many requests. You have to until tomorrow (UTC) to be able to make new requests

@BiffaGitHub
Copy link

@BiffaGitHub HTTP code 429 means too many requests. You have to until tomorrow (UTC) to be able to make new requests

OK thanks! So i assume that means when i load the integration I need to set the request time higher? Like 15 or 30 mins etc?

I'll try it.

@DivingUp
Copy link
Contributor

DivingUp commented Mar 5, 2024

@BiffaGitHub HTTP code 429 means too many requests. You have to until tomorrow (UTC) to be able to make new requests

OK thanks! So i assume that means when i load the integration I need to set the request time higher? Like 15 or 30 mins etc?

I'll try it.

Yes.. min. 10min and Not to often restart HA… and Check locks for 403 errors…

@t0bias-r
Copy link
Contributor

t0bias-r commented Mar 5, 2024

  • longterm and shortterm trip data

  • Climatisation state

  • Energy flow

  • Last Update

  • Max charge current

  • remain charge time

  • Service inspection

As far as I have seen, energy-flow and max-charge-current are gone in the new API.

@guidokieboom
Copy link

guidokieboom commented Mar 5, 2024

When using the (un)lock switch, the status is not updated automatically in the lovelace card anymore. When I check in MyAudi app, the result is visible (changed from locked to unlocked). What can I do to have the lovelace card updated as well shortly after hitting (un)lock?

Screenshot 2024-03-05 at 20 34 13

Prior to the API update, the following switch to request updated sensor data worked well, but now it does not work anymore. Anyone any suggestion how to improve or update?

  - platform: template
    switches:
      audiconnectrefreshdata:
        friendly_name: "AudiConnect Refresh Data"
        value_template: "{{ is_state('sensor.audirefresh', 'on') }}"
        turn_on:
          service: audiconnect.refresh_data
          data:
            vin: wauxxxx0123456789
        turn_off:
          service: audiconnect.refresh_data
          data:
            vin: wauxxxx0123456789

Last question: the time as provided by 'last_update' is 1hr behind my time zone (Netherlands).
Edit: HACS installed version 601e5ff

@Ingrimmsch93
Copy link
Contributor

@t0bias-r
I did move the car several times but still no GPS sensor. It‘s not „unknown“ or something, it‘s not even there.
Is there anything I can help to find a way back to it?

Check if you have this line (206) in your audi_services.py. If not, add it and uncomment it. Afterwards restart Home Assistant. You should find a log entry with "Data from your Audi:".
Post this log data here.
I can try to find the problem this evening. Maybe @t0bias-r or @DivingUp can also have a look :)

@Ingrimmsch93 @t0bias-r

Thx, did it. Here is the result. Interesting: Since 2 hours, I DO have the GPS entity. Strange? I hope it's not vanishing again. I am still missing "fuel%" and some others like inspection date, oil, lights and more.

Oh sorry i didn't check, if location is in this data set.
It is working now for you right?

If not, i would recommend to create a new issue.
In this issue you can directly post the log of your location. So we can see, if you receive it or not.

You can replace the get_stored_position part in audi_services.py (close to line 227)
This will give you a log with you longitude and latitude:
async def get_stored_position(self, vin: str):
self._api.use_token(self._bearer_token_json)
audi_location = await self._api.get(
"https://emea.bff.cariad.digital/vehicle/v1/vehicles/{vin}/parkingposition".format(
vin=vin.upper(),
)
)
_LOGGER.warning("Location From your AUDI: " + str(audi_location))
return audi_location

@DivingUp
Copy link
Contributor

DivingUp commented Mar 6, 2024

  • longterm and shortterm trip data
  • Climatisation state
  • Energy flow
  • Last Update
  • Max charge current
  • remain charge time
  • Service inspection

As far as I have seen, energy-flow and max-charge-current are gone in the new API.

@t0bias-r longterm and shortterm trip data did not work.
aiohttp.client_exceptions.ClientResponseError: 403, message='', url=URL('https://mal-1a.prd.ece.vwg-connect.com/api/bs/tripstatistics/v1/vehicles/WAUZZZ4MXXXXXX/tripdata/shortTerm?type=list&from=1970-01-01T00:00:00Z&to=2024-03-06T07:24:03Z')

to many 403 kills access over the day...

@t0bias-r
Copy link
Contributor

t0bias-r commented Mar 6, 2024

@DivingUp
Copy link
Contributor

DivingUp commented Mar 6, 2024

@t0bias-r longterm and shortterm trip data did not work.
aiohttp.client_exceptions.ClientResponseError: 403, message='', url=URL('https://mal-1a.prd.ece.vwg-connect.com/api/bs/tripstatistics/v1/vehicles/WAUZZZ4MXXXXXX/tripdata/shortTerm?type=list&from=1970-01-01T00:00:00Z&to=2024-03-06T07:24:03Z')

Could you test

* a newer 'from'-time, e.g. 2020-01-01T00:00:00T

* and the URL that uses a different parameter for from time [Many sensor value for new Audi API #249 (comment)](https://github.com/arjenvrh/audi_connect_ha/pull/249#issuecomment-1978301293)

* https://mal-3a.prd.eu.dp.vwg-connect.com/api/bs/tripstatistics/v1/vehicles/WAUZZZGE3RB987654/tripdata/shortTerm?type=list&from=setreadingT00:00:00Z&to=2024-02-27T20:03:34Z

@t0bias-r
same error:
aiohttp.client_exceptions.ClientResponseError: 403, message='', url=URL('https://mal-3a.prd.eu.dp.vwg-connect.com/api/bs/tripstatistics/v1/vehicles/WAUZZZ4MXXXXX/tripdata/shortTerm?type=list&from=setreadingT00:00:00Z&to=2024-03-06T09:31:26Z')

@moritzmaier84
Copy link

moritzmaier84 commented Mar 6, 2024

Generel question:

I use @t0bias-r fork at the moment. Now I have TWO update messages in my HACS.
Why? And how do I know which on is which one?
How do I get rid of the "wrong" one?
And why is it showing up generally? Does that mean that @t0bias-r updated something or does it mean the original integration is updated or what?

Most important: How can I check which version I am using at the moment?

Any hints?

@xkakjd88178
Copy link

I'm getting this error and nothing works except logging in and loading vehicle make model:
Unable to update the vehicle position of REMOVEDVINNUMBER: 401, message='Unauthorized', url=URL('https://emea.bff.cariad.digital/vehicle/v1/vehicles/REMOVEDVINNUMBER/parkingposition')

@Ingrimmsch93
Copy link
Contributor

Generel question:

I use @t0bias-r fork at the moment. Now I have TWO update messages in my HACS. Why? And how do I know which on is which one? How do I get rid of the "wrong" one? And why is it showing up generally? Does that mean that @t0bias-r updated something or does it mean the original integration is updated or what?

Most important: How can I check which version I am using at the moment?

Any hints?

In HACS you only have arjenvrh/audi_connect_ha. If you are using t0bias-r fork, you added his fork as custom repository. Just go to HACS > 3 dots right upper corner > custom repositories and delete t0bias-r fork.

arjenvrh will get PR's from t0bias-r. It may be delayed, but will surely happen.
current arjenvrh should be working fine. Only time to fully charge is broken and some new values are missing. PR is already out and will propably be released tomorrow or so.

For checking which version you will install: You can just click on it and there is a link to release notes, which points to its repository ;)

@moritzmaier84
Copy link

Generel question:
I use @t0bias-r fork at the moment. Now I have TWO update messages in my HACS. Why? And how do I know which on is which one? How do I get rid of the "wrong" one? And why is it showing up generally? Does that mean that @t0bias-r updated something or does it mean the original integration is updated or what?
Most important: How can I check which version I am using at the moment?
Any hints?

In HACS you only have arjenvrh/audi_connect_ha. If you are using t0bias-r fork, you added his fork as custom repository. Just go to HACS > 3 dots right upper corner > custom repositories and delete t0bias-r fork.

arjenvrh will get PR's from t0bias-r. It may be delayed, but will surely happen. current arjenvrh should be working fine. Only time to fully charge is broken and some new values are missing. PR is already out and will propably be released tomorrow or so.

For checking which version you will install: You can just click on it and there is a link to release notes, which points to its repository ;)

Thanks, apreciate it!
I'm running arjenvrh 8cfc5f2 at the moment and there is an update suggestion for 4e39860.
At the moment, everything is running perfectly. Should I now just ignore the update? I don't really get what the differences are and if I'm gonna risk everything if I'll do it...
Also, theres is no backup possibilty just for this integration (like it is with "official" addons and stuff).
So I am scared :)

@Ingrimmsch93
Copy link
Contributor

Ingrimmsch93 commented Mar 7, 2024

This update does not make big changes. It just adds easier possibility to get logs to help later on.

I don't think we will have bigger updates, that could break something, in the near future. The integration is running. The NEW API is in it and the smaller fixes are done.

I also changed from t0bias-r fork to base on Tuesday. If something breaks, you can just download the previous version again ;)

@moritzmaier84
Copy link

This update dies not make big changes. It just adds easier possibility to get logs to help later on.

I don't think we will have bigger updates, that could break something, in the near future. The integration is running. The NEW API is in it and the smaller fixes are done.

I also changed from t0bias-r fork to base on Tuesday. I something breaks, you can just download the previous version again ;)

Thx man, you helped me alot with that! Got it now!

@DutchKillerbee
Copy link

DutchKillerbee commented Mar 7, 2024

First of all a big THANKS to everybody who helped switching to new API!
All my relevant sensors are working again.

I found one minor issue:
Using the repo of @t0bias-r the secondary_engine_range sensor exists and is properly filled:

image
In this repo the secondary_engine_range sensor doesn't exists:
image

Besides this minor issue I have a question:
Am I right that the services audiconnect.execute_vehicle_action (start_charger stop_charger) and audiconnect.refresh_vehicle_data are not working (yet)?

Thanks again

@Ingrimmsch93
Copy link
Contributor

Ingrimmsch93 commented Mar 7, 2024

@DutchKillerbee can you please create a new issue and just paste it in there?

@hhoehler i think we can close this issue, right?
The new API is in general implemented and new issues should be in an issue itself. This Thread helped a lot, but is now kind of overloaded :)

@DutchKillerbee
Copy link

DutchKillerbee commented Mar 7, 2024

@DutchKillerbee can you please create a new issue and just paste it in there?

Done
https://github.com/arjenvrh/audi_connect_ha/issues/266

@hhoehler
Copy link
Author

hhoehler commented Mar 8, 2024

Dear community, is has been a great and hard work of you during the last days fixing the API und providing a new integration. I personally switched to the latest version(s) some days ago and it works for my Audi etron 55 quite well. Since it´s not expected that major changes need to be initiated due to the original incident description - I´m closing the issue now. Again, at the beginning I did not have any confidence that there will be somebody else working hard to fix this thing - very well done!

@hhoehler
Copy link
Author

hhoehler commented Mar 8, 2024

Issue fixed

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests