-
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
start_climate_control
not working
#450
Comments
@pergolafabio sniffed the endpoint/request. Looks like the Climate Control request data structure has changed along with the endpoint, or its different for different vehicles. Here is the data structure we currently use: audi_connect_ha/custom_components/audiconnect/audi_services.py Lines 611 to 625 in 1669f67
and what it is now:
So that will have to be reworked. I tried updating the endpoint using "na" in place of "emea" for my region (US) and i'm still getting 404 error so maybe the endpoint for NA hasn't been migrated yet? Here is what I tried for res = await self._api.request(
"POST",
"https://{region}.bff.cariad.digital/vehicle/v1/vehicles/{vin}/climatisation/start".format(
region="emea" if self._country.upper() != "US" else "na",
vin=vin.upper(),
),
headers=headers,
data=data,
) Of note, we currently use this endpoint for audi_connect_ha/custom_components/audiconnect/audi_services.py Lines 223 to 230 in 1669f67
@cdnninja @t0bias-r @Kolbi any ideas? API is outside my comfort zone so I'm probably missing something. |
Hi, i'm posting all sniffed information here: cyr-ius#86 also the stop command for climate is different, and the reposen to get "succeeded" is different |
@coreywillwhat What I do know is that the request structure depends on the functions of the vehicle. For example, it is not possible to configure the temperature or switch on the seat heating in every car. Try a start request with empty request |
Interesting... |
SNiffed the temp setting: URL: https://emea.bff.cariad.digital/vehicle/v1/vehicles/XXX/climatisation/settings Request:
After fort state if succesfull: https://emea.bff.cariad.digital/vehicle/v1/vehicles/XXXX/pendingrequests response:
After a few, the status changes to:
|
while adding/changing thise code, is it also possible to add the "climate" state? seems that one is missing from this integration?
EDIT: already added now with a new PR !! |
Alright, I've set up frida on a rooted android emulator. I'll work on testing for NA/US. If I can get that working I'm sure we can easily integrate the EMEA endpoints as well. Just hard to test on things I dont know work for myself haha |
I show you the debugs later today |
ok, here is the debug, only 23 entities for me, also the "climate" state sensor is not there, while i see in the debug below , this : here is the debug:
|
Is your GPS location still working? for me it doesnt work in HA and doesnt work in the Android app either, i get an error there too, tough i have it enabled in "audi connect" as a function, guess the App needs to be updated probably, maybe my car is to new yet...
|
Thanks for the logs. The missing values are due to the climatisation data structure being different. I checked my vehicle, and it's still using the old structure. We'll need to add a check for your new structure, as I assume this will be the standard for new vehicles.
GPS is still working for me in app and HA |
Let me know if you need more info! Or if I can help to test... |
Adding info here in case anyone gets to updating the integration endpoints: US Region - 2021 Q5 PHEVClimate Control Start URL: {
"action": {
"type": "startClimatisation",
"settings": {
"targetTemperature": 2930,
"heaterSource": "electric",
"climaterElementSettings": {
"isMirrorHeatingEnabled": false,
"zoneSettings": {
"zoneSetting": [
{
"value": {
"position": "frontLeft",
"isEnabled": true
}
},
{
"value": {
"position": "frontRight",
"isEnabled": true
}
}
]
}
}
}
}
} Climate Start Response Body: {
"action": {
"type": "startClimatisation",
"actionId": 1305943676,
"actionState": "queued",
"settings": {
"targetTemperature": 2930,
"climatisationWithoutHVpower": true,
"heaterSource": "electric",
"climaterElementSettings": {
"isMirrorHeatingEnabled": false,
"zoneSettings": {
"zoneSetting": [
{
"value": {
"isEnabled": true,
"position": "frontLeft"
}
},
{
"value": {
"isEnabled": true,
"position": "frontRight"
}
}
]
}
}
}
}
} Climate Stop URL: Climate Stop Request Body: {
"action": {
"type": "stopClimatisation"
}
} Climate Stop Response Body: { "action": {
"type": "stopClimatisation",
"actionId": 1306061699,
"actionState": "queued"
} |
Also posting it here for the Q4 2024 model, there are 2 urls for start / stop START CLIMA
with request:
STOP CLIMA:
GET STATUS FOR START or STOP https://emea.bff.cariad.digital/vehicle/v1/vehicles/XXX/pendingrequests with response:
eventually:
|
Hi, quick update, seems my GPS location is now working, also i can now see the state of my doors/windows anwyay, the last thing not working is indeed the start / stop clima!! |
FYI - I was able to get Start Climate Control working. Now to figure out what I did and re-implement for different regions other than US. |
wow , nice! :-) |
@pergolafabio for the check if the request succeeded, are you seeing anything like:
specifically something with an |
Hi, no it's a different url, scroll a few posts back, I have posted it there |
I saw that, i was curious if there was another GET which targets the specific action. For my instance I see your version and another for the one targeting the specific action. |
Ok, I do a trace later again, to check, in 1.5 hour :-) |
No rush. Not sure I will have more time today.
or
|
ok, did a new test: POST REQ: REQ Body:
RESPONSE:
Afterwards i see every XX seconds this GET REQUEST , its a polling
With RESPONSE BODY:
Untill after about 10 times, its succesfull , the state changes:
For a STOP RESPONSE BODY:
Then again a polling GET REQUEST: RESPONSE BODY:
The second polling i see, there is the stop as primary
A few polls later, i see the succesfull
is this also the same as you? |
For the stop command polling, you see 2 responses, probably the start command earlier was still reporting also successful, I think that's why we still see 2 responses... Cause I stopped the climate quite soon... But that doesn't matter , you filter on the ID right? |
This is different than whats it been in the past. Thanks for all the info. |
hey @coreywillwhat , i was trying to hardcode some stuff, changing the data and endpoint url ... but i also need to send headers DO you have them by any chance? otherwise i need to trace again |
Or @coreywillwhat , if you already have some draft code... Maybe I can copy paste it in, Im only interested in start/stop climate... If I have some example, I can proceed my self ;-) |
for the ones interested , i did an hardcode, changed file audi_services.py to this:
|
Are you all using a modified Android binary to sniff the traffic? There's cert pinning on the iOS app. |
I use Frida to sniff the traffic, rooted test phone |
I capture the traffic without rooting the phone. You have to patch and re-package the apk, but that's not difficult. |
@Kolbi , don't use my changed code, it's was for personal use, probably now the climate doesnt work for other people? My Q4 model uses the cariad host, o do t think all cars are using it...? |
@pergolafabio can you try: https://github.com/audiconnect/audi_connect_ha/releases/tag/v1.10.5a1 ? It is tagged as pre-relase and might be also able to be downloaded via HACS. |
Will probably work, but it will break it for other users that are not using cariad? |
Als the checkurl for status doesn't work, it's all changed for those models, it's a complete different url, I believe @coreywillwhat was already working on this new api |
It is working for me, with the Q4 2024 model. |
Maybe we need to determine which users need new endpoints and which one needs old logic. Just released https://github.com/audiconnect/audi_connect_ha/releases/tag/v1.10.5a1 (for better versioning) |
Yes, indeed, but I changed the legacy service, it's better to use the climate control service, so we can also send temp/... Now it's hardcoded on the json... Also , those checkurls needs to change, I posted the new ones above in this thread... |
Just deleted the prerelease again need to have a deeper look into it but time is missing a little bit. Feel free to contribute to branch: https://github.com/audiconnect/audi_connect_ha/tree/set_climatisation-%23450 or directly to master. |
Sorry if this is off topic. I just want to help with this. The iOS app doesn't seem to use the standard/simple SSL pinning methods e.g. boringssl. I think it's using swift-ssl-nio for pinning which is harder to patch. Anyone here been successful sniffing traffic from an iOS device? I might have to find an Android device. |
what are you driving ? also Q4 ? then the above should work if you are in same region? |
No, I'm actually diriving a Q7 e-tron (hybrid) and the above didn't seem to work for me although I didn't test it heavily, I just assumed I needed a slightly different version. I am in EU though :) |
if you want, i can sniff it for you, you can give me for example your account with a temp password ... up to you |
Need to check it when I have some time to do. But got the point. Was to fast C&P your adjustments. |
This does not work for me: |
This is only for Q4 models I think, also , maybe you are using another region? |
I have a q4 45 etron from 2024 region germany |
Yes, but you need to change the code manually, you url is still the old one if I look in your error log |
The code example above is also for the legacy climate start, not for the new service, there are 2 methods to start the clima |
Here is the code for the other clima start service.... |
Describe the bug
404 error when running
start_climate_control
Your Vehicle Details
Model: Q5
Year: 2021
Type (ICE/PHEV/BEV): PHEV
Region: US (NA)
The text was updated successfully, but these errors were encountered: