audiconnect / audi_connect_ha

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

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

Closed hhoehler closed 6 months ago

hhoehler commented 6 months ago

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:

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 commented 6 months ago

You are not alone. I too have the bug.

cdnninja commented 6 months ago

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

derhappy commented 6 months ago

I‘m still running version b693a26 for our Etron 55 in De and I’m affected too. The Audi app is working. I‘m not sure it’s because of the update. Before I restarted a minute ago the sensor at least stated the last update was about 7 hours ago, now it’s just unavailable. Am 27.02.2024 um 18:35 schrieb cdnninja @.***>: I have merge access so if someone finds the fix please create a pr.

—Reply to this email directly, view it on GitHub, or unsubscribe.You are receiving this because you are subscribed to this thread.Message ID: @.***>

anordnes commented 6 months ago

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

sebadv commented 6 months ago

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 commented 6 months ago

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 commented 6 months ago

@hhoehler I suggest to update the title of that issue

t0bias-r commented 6 months ago

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

hhoehler commented 6 months ago

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 commented 6 months ago

Works for me too. Thanks!

pittbull commented 6 months ago

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 commented 6 months ago

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 commented 6 months ago

Hi,

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 commented 6 months ago

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 commented 6 months ago

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 commented 6 months ago

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 commented 6 months ago

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 commented 6 months ago

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 commented 6 months ago

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 commented 6 months ago

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 commented 6 months ago

@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 commented 6 months ago

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

QuiNz0r commented 6 months ago

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

jackc94 commented 6 months ago

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

hhoehler commented 6 months ago

@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 commented 6 months ago

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 commented 6 months ago

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

t0bias-r commented 6 months ago

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.

dariusz737 commented 6 months ago

PLEASE :) How to use "fork", please tell it for people which doesn't know this wired GitHub language.

krulkamyl commented 6 months ago

@dariusz737 paste URL to repository in "Custom repositories" on "Home Assistant Community Store"

dariusz737 commented 6 months ago

Now I know what that HACS, is Home Assistant Community Store... :D I have foud those three dots in upper right corner and "Custom repositories" there. Should I remove Audi integration before? Thank you for help and prompt response.

cpohli commented 6 months ago

All these solutions seem to be very model specific, right? After removal and reinstalling from t0bias-r fork i only get these for my hybrid Audi:

grafik

Nevertheless, thank you for the efforts!

heidle78 commented 6 months ago

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

I tried it, but it doesn´t work for me - 7 entities, same results like cpohli - I have the same car ;-)

heidle78 commented 6 months ago

If somebody shows where what to adapt I would try it on my own - but I have no glue to be honest

moritzmaier84 commented 6 months ago

I think we'll have to wait for @gac3k to develop a fix for all models. I count on you, bro ;)

DivingUp commented 6 months ago

it's hard to see how there is a constant demand here and what kind of pressure is being built up... these are voluntary developers... if it's no longer possible, you have to accept it or do it yourself...I personally think it's a little excessive to always just make demands

t0bias-r commented 6 months ago

I think we'll have to wait for @gac3k to develop a fix for all models. I count on you, bro ;)

I don't have many "sample cars" to use for development and testing. I think everyone here is limited. @moritzmaier84, @cpohli , @heidle78: pls provide you Audi credentials, then I can reserve engineer the app and its network traffic as I did for Q8 e-tron.

moritzmaier84 commented 6 months ago

@t0bias-r

I'll be happy to help you with that and I can test things, if it's helpfull.

My car is an Audi A4 Avant design 2.0 TFSI S tronic

If you need any information, please let me know (maybe I need some step-by-step instructions because I'm still starting with that coding stuff...)

cpohli commented 6 months ago

it's hard to see how there is a constant demand here and what kind of pressure is being built up... these are voluntary developers... if it's no longer possible, you have to accept it or do it yourself...I personally think it's a little excessive to always just make demands

I don't see it as a demand, for me at least it isn't. As someone mentioned before, some have grown strangely to using this integration. So it is not a demand to some persons, just feedback to ongoing changes by some very capable people here and hoping for a solution. That's all, me thinks. If anybody is feeling pressured - that's not, what is meant to be!

cpohli commented 6 months ago

I think we'll have to wait for @gac3k to develop a fix for all models. I count on you, bro ;)

I don't have many "sample cars" to use for development and testing. I think everyone here is limited. @moritzmaier84, @cpohli , @heidle78: pls provide you Audi credentials, then I can reserve engineer the app and its network traffic as I did for Q8 e-tron.

How could i provide the credentials in a personal way? i would not like to go my climate on and off in the middle of the night. :-) And a BIG Thank You for your generous offer!

DivingUp commented 6 months ago

@t0bias-r can we write private ? - i've done a lot... my sq7 works now... so you can reuse my "privat-fork"

moritzmaier84 commented 6 months ago

@cpohli all you said and asked is exactly what I think, too! @t0bias-r same thing as he said and asked :) @DivingUp come on, that's what this tool here is for - we are thankfull and trying to help as much as we noobs can. it's not meant to pressure someone...

DivingUp commented 6 months ago

read the comments and requests above... the project clearly states that it will not be developed further... until it no longer works... "Due to time limitations this project is not actively maintained anymore. It will continue to work as long as Audi does not change the API again. However, I'm open to someone else taking the lead. If you would like to become a maintainer, please contact me."

So now constantly asking whether there is a fix, I find that strange... as I said... put up with it, PATIENTLY hope or do it yourself...

It hit me the same way...

heidle78 commented 6 months ago

pls provide you Audi credentials, then I can reserve engineer the app and its network traffic as I did for Q8 e-tron

I will give you my account information as long as needed if it helps, how? Here in github I can´t send a private message I guess?

cpohli commented 6 months ago

So now constantly asking whether there is a fix, I find that strange... as I said... put up with it, PATIENTLY hope or do it yourself...

I for myself am not capable of doing it myself. So i rely on the efforts of more talented people like you guys. All i do is wait and hope. In the meantime i give feedback and maybe help for ongoing efforts of some here, who are not doing things only for themselves but sharing their solutions and are willing to go a step further and help others. That is regardless if the original thing is maintained or developed by the originator.

Just my 3 cents ...

gac3k commented 6 months ago

I started to work on a fix yesterday, and overall I have some first successes, but the thing is that overall there are already calls to fetch the data from respective parts like charger or position, but the API changed in a way that it's now returning 403 error, it would work by combining the current requests with the data from the endpoint that is used in the fork mentioned above, but what I want to do is to dive a deep further and to understand the root cause by trying to reverse-engineer the issue so that it's more bulletproof for the future, as honestly I have no idea how long the other endpoint will still work.

moritzmaier84 commented 6 months ago

@gac3k Thanks alot for your effort and also for updating us!

dariusz737 commented 6 months ago

I am so sorry. It was not my intention to make any pressure on volunteers who work on this. I defiantly would accept to pay for such product. Its shame for Audi that its not offering such solution and makes other live harder to fix it. I am very glad to see people working on it and thank you very much for your engagement in this. Thank You for your work.

gac3k commented 6 months ago

@t0bias-r hey, since you're also working on that, and I think you're doing reverse engineering as well, can you please let me know whether the data that is being retrieved by your app is the same as it is for me, or do you have some extra endpoints being called? Zrzut ekranu 2024-03-1 o 15 38 16

t0bias-r commented 6 months ago

@t0bias-r hey, since you're also working on that, and I think you're doing reverse engineering as well, can you please let me know whether the data that is being retrieved by your app is the same as it is for me, or do you have some extra endpoints being called?

@gac3k These are the VIN specifc requests that were executed while FTS on Android. They look a little bit different compared your A6.....e.g. timersandprofiles grafik

I guess that the rsp of the selectivestatus query is different from eletric to non-electic cars.