-
Notifications
You must be signed in to change notification settings - Fork 100
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
Comments
You are not alone. I too have the bug. |
I have merge access so if someone finds the fix please create a pr. |
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: ***@***.***>
|
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). |
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. Example of status query: Of course, the json format of the response has also changed |
@hhoehler I suggest to update the title of that issue |
This fork uses the new endpoint: |
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. |
Works for me too. Thanks! |
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. |
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! |
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? |
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
|
thank you.. yeah mine i non-electric, too :( |
danke für deine mühe, holger! mine is non-electric... don't really know if there's a fix for this, though |
The workaround only gives me 2 working sensors on my A6 hybrid - door lock and climatization state. |
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...) |
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 |
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. |
@gac3k Great news! Thank you I think we‘ll need that. |
Same issue, the fork only fixes the endpoints for electric models. |
@gac3k That would be incredible… I’ve become strangely reliant on this integration so would be great to see it return. |
@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. |
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. 🤞 |
News for a fix? Still can't use it 😢 |
I've pushed fixes to my existing fork: actions like start climatisation fail, but I can query all information from my car. |
@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] |
I did move the car several times but still no GPS sensor. It‘s not „unknown“ or something, it‘s not even there. |
Check if you have this line (206) in your audi_services.py. If not, add it and uncomment it. Post this log data here. I can try to find the problem this evening. Maybe @t0bias-r or @DivingUp can also have a look :) |
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 |
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. |
Thx, did it. Here is the result. Logger: custom_components.audiconnect.audi_services 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 /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 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') Logger: homeassistant.components.device_tracker 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 |
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 |
@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… |
As far as I have seen, energy-flow and max-charge-current are gone in the new API. |
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? 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?
Last question: the time as provided by 'last_update' is 1hr behind my time zone (Netherlands). |
Oh sorry i didn't check, if location is in this data set. If not, i would recommend to create a new issue. You can replace the get_stored_position part in audi_services.py (close to line 227) |
@t0bias-r longterm and shortterm trip data did not work. to many 403 kills access over the day... |
Could you test
|
@t0bias-r |
Generel question: I use @t0bias-r fork at the moment. Now I have TWO update messages in my HACS. Most important: How can I check which version I am using at the moment? Any hints? |
I'm getting this error and nothing works except logging in and loading vehicle make model: |
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. 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! |
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 ;) |
Thx man, you helped me alot with that! Got it now! |
First of all a big THANKS to everybody who helped switching to new API! I found one minor issue:
Besides this minor issue I have a question: Thanks again |
@DutchKillerbee can you please create a new issue and just paste it in there? @hhoehler i think we can close this issue, right? |
|
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! |
Issue fixed |
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
The text was updated successfully, but these errors were encountered: