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

start_climate_control not working #450

Open
coreywillwhat opened this issue Jul 24, 2024 · 63 comments · May be fixed by #422
Open

start_climate_control not working #450

coreywillwhat opened this issue Jul 24, 2024 · 63 comments · May be fixed by #422
Labels
bug Something isn't working planned Planned fix or feature

Comments

@coreywillwhat
Copy link
Contributor

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)

@coreywillwhat
Copy link
Contributor Author

@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:

data = {
"action": {
"type": "startClimatisation",
"settings": {
"targetTemperature": target_temperature,
"climatisationWithoutHVpower": True,
"heaterSource": "electric",
"climaterElementSettings": {
"isClimatisationAtUnlock": False,
"isMirrorHeatingEnabled": glass_heating,
"zoneSettings": {"zoneSetting": zone_settings},
},
},
}
}

and what it is now:

{
  "targetTemperature": 22,
  "targetTemperatureUnit": "celsius",
  "climatisationWithoutExternalPower": true,
  "climatizationAtUnlock": false,
  "windowHeatingEnabled": false,
  "zoneFrontLeftEnabled": false,
  "zoneFrontRightEnabled": false,
  "zoneRearLeftEnabled": false,
  "zoneRearRightEnabled": false
}

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 start_climate_control

        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 get_stored_position and that is functioning correctly for US region.

async def get_stored_position(self, vin: str):
self._api.use_token(self._bearer_token_json)
return await self._api.get(
"https://{region}.bff.cariad.digital/vehicle/v1/vehicles/{vin}/parkingposition".format(
region="emea" if self._country.upper() != "US" else "na",
vin=vin.upper(),
)
)

@cdnninja @t0bias-r @Kolbi any ideas? API is outside my comfort zone so I'm probably missing something.

@pergolafabio
Copy link

pergolafabio commented Jul 24, 2024

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

@t0bias-r
Copy link
Contributor

@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 {}

@coreywillwhat
Copy link
Contributor Author

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

The parking position doesnt work, in the sniff i did from the app, i also get a 404 error using this one: https://emea.bff.cariad.digital/vehicle/v1/vehicles/XXX/parkingposition

Interesting...https://na.bff.cariad.digital/vehicle/v1/vehicles/XXX/parkingposition (note na) is successful for me in the US.

@pergolafabio
Copy link

pergolafabio commented Jul 24, 2024

SNiffed the temp setting:

URL:

https://emea.bff.cariad.digital/vehicle/v1/vehicles/XXX/climatisation/settings

Request:

{
  "targetTemperature": 21,
  "targetTemperatureUnit": "celsius",
  "climatisationWithoutExternalPower": true,
  "climatizationAtUnlock": false,
  "windowHeatingEnabled": false,
  "zoneFrontLeftEnabled": false,
  "zoneFrontRightEnabled": false
}

After fort state if succesfull:

https://emea.bff.cariad.digital/vehicle/v1/vehicles/XXXX/pendingrequests

response:

{
  "data": [
    {
      "id": "ab1cef0e-d047-4fba-9dc3-b3b6691a6336",
      "userId": "0e0f02f7-620c-42e5-87d3-35d76f700a75",
      "vin": "XXXX",
      "httpMethod": "PUT",
      "path": "/vehicles/XXXX/climatisation/settings",
      "capability": "climatisation",
      "operation": "settings",
      "operationGroup": "climatisationSettings",
      "body": "{\"callback\":\"https://emea.bff.cariad.digital/vehicle/v1/vehicles/callbacks/XXXX/climatisation/settings/PUT\",\"climatisationWithoutExternalPower\":true,\"targetTemperature\":21,\"targetTemperatureUnit\":\"celsius\",\"climatizationAtUnlock\":false,\"windowHeatingEnabled\":false,\"zoneFrontLeftEnabled\":false,\"zoneFrontRightEnabled\":false}",
      "vcfRequestId": "94f83793-6c2d-43ce-9f6f-95098b372d53",
      "status": "in_progress",
      "queuedOperation": null,
      "timestamp": "2024-07-24T11:30:13.249758808Z"
    }
  ]
}

After a few, the status changes to:

"status": "successful",

@pergolafabio
Copy link

pergolafabio commented Jul 24, 2024

while adding/changing thise code, is it also possible to add the "climate" state? seems that one is missing from this integration?

            "climatisationState": "off"

          "climatisation": {
            "climatisationSettings": {
              "value": {
                "carCapturedTimestamp": "2024-06-10T09:47:00Z",
                "targetTemperature_C": 20,
                "targetTemperature_F": 68,
                "climatisationWithoutExternalPower": true,
                "climatizationAtUnlock": false,
                "windowHeatingEnabled": true,
                "zoneFrontLeftEnabled": false,
                "zoneFrontRightEnabled": false
              }
            },
            "climatisationStatus": {
              "value": {
                "carCapturedTimestamp": "2024-06-10T09:47:05Z",
                "remainingClimatisationTime_min": -256,
                "climatisationState": "off"
              }

EDIT: already added now with a new PR !!

@coreywillwhat
Copy link
Contributor Author

This is available for my vehicle:
image

Can you provide debug logs for your vehicle showing the vehicle data returned by a refresh_cloud_data service call?

@coreywillwhat
Copy link
Contributor Author

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

@pergolafabio
Copy link

I show you the debugs later today

@pergolafabio
Copy link

pergolafabio commented Jul 24, 2024

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 : 'climatisationState': 'off' ... probably its another place for me compared to other cars (api level? )
audi etro q45 model 2024 (45)

image
image

here is the debug:

2024-07-24 19:07:14.946 DEBUG (MainThread) [custom_components.audiconnect.audi_account] Starting refresh cloud data...
2024-07-24 19:07:15.598 DEBUG (MainThread) [custom_components.audiconnect.audi_services] Vehicle data returned for VIN: *************6552: {'access': {'accessStatus': {'value': {'overallStatus': 'safe', 'carCapturedTimestamp': datetime.datetime(1, 1, 1, 0, 0, tzinfo=datetime.timezone.utc), 'doors': [{'name': 'bonnet', 'status': ['unsupported']}, {'name': 'trunk', 'status': ['unsupported']}, {'name': 'rearRight', 'status': ['unsupported']}, {'name': 'rearLeft', 'status': ['unsupported']}, {'name': 'frontRight', 'status': ['unsupported']}, {'name': 'frontLeft', 'status': ['unsupported']}], 'windows': [{'name': 'sunRoof', 'status': ['unsupported']}, {'name': 'roofCover', 'status': ['unsupported']}, {'name': 'sunRoofRear', 'status': ['unsupported']}, {'name': 'frontLeft', 'status': ['unsupported']}, {'name': 'frontRight', 'status': ['unsupported']}, {'name': 'rearLeft', 'status': ['unsupported']}, {'name': 'rearRight', 'status': ['unsupported']}], 'doorLockStatus': 'locked'}}}, 'batteryChargingCare': {'chargingCareSettings': {'value': {'batteryCareMode': 'deactivated'}}}, 'charging': {'batteryStatus': {'value': {'carCapturedTimestamp': datetime.datetime(2024, 7, 24, 11, 2, 32, tzinfo=datetime.timezone.utc), 'currentSOC_pct': 85, 'cruisingRangeElectric_km': 490}}, 'chargingStatus': {'value': {'carCapturedTimestamp': datetime.datetime(2024, 7, 24, 11, 2, 32, tzinfo=datetime.timezone.utc), 'remainingChargingTimeToComplete_min': 0, 'chargingState': 'notReadyForCharging', 'chargeMode': 'manual', 'chargePower_kW': 0, 'chargeRate_kmph': 0, 'chargeType': 'invalid', 'chargingSettings': 'profile'}}, 'chargingSettings': {'value': {'carCapturedTimestamp': datetime.datetime(2024, 7, 24, 11, 35, 49, tzinfo=datetime.timezone.utc), 'targetSOC_pct': 100}}, 'plugStatus': {'value': {'carCapturedTimestamp': datetime.datetime(2024, 7, 24, 11, 35, 48, tzinfo=datetime.timezone.utc), 'plugConnectionState': 'disconnected', 'plugLockState': 'unlocked', 'externalPower': 'unavailable', 'ledColor': 'invalid'}}, 'chargeMode': {'value': {'preferredChargeMode': 'manual', 'availableChargeModes': ['manual', 'timer']}}, 'chargingCareSettings': {'value': {'batteryCareMode': 'deactivated'}}}, 'chargingTimers': {'chargingTimersStatus': {'value': {'carCapturedTimestamp': datetime.datetime(2024, 7, 24, 11, 35, 49, tzinfo=datetime.timezone.utc), 'timeInCar': datetime.datetime(2024, 7, 24, 13, 35, 49, tzinfo=datetime.timezone(datetime.timedelta(seconds=7200))), 'timers': [{'id': 1, 'enabled': False, 'climatisation': False, 'recurringTimer': {'departureTime': '10:00', 'targetTime': '10:00', 'repetitionDays': ['monday', 'tuesday', 'wednesday', 'thursday', 'friday', 'saturday', 'sunday'], 'recurringOn': {'mondays': True, 'tuesdays': True, 'wednesdays': True, 'thursdays': True, 'fridays': True, 'saturdays': True, 'sundays': True}}}, {'id': 2, 'enabled': False, 'climatisation': False, 'recurringTimer': {'departureTime': '10:00', 'targetTime': '10:00', 'repetitionDays': ['monday', 'tuesday', 'wednesday', 'thursday', 'friday', 'saturday', 'sunday'], 'recurringOn': {'mondays': True, 'tuesdays': True, 'wednesdays': True, 'thursdays': True, 'fridays': True, 'saturdays': True, 'sundays': True}}}, {'id': 3, 'enabled': False, 'climatisation': False, 'recurringTimer': {'departureTime': '10:00', 'targetTime': '10:00', 'repetitionDays': ['monday', 'tuesday', 'wednesday', 'thursday', 'friday', 'saturday', 'sunday'], 'recurringOn': {'mondays': True, 'tuesdays': True, 'wednesdays': True, 'thursdays': True, 'fridays': True, 'saturdays': True, 'sundays': True}}}, {'id': 4, 'enabled': False, 'climatisation': False, 'recurringTimer': {'departureTime': '10:00', 'targetTime': '10:00', 'repetitionDays': ['monday', 'tuesday', 'wednesday', 'thursday', 'friday', 'saturday', 'sunday'], 'recurringOn': {'mondays': True, 'tuesdays': True, 'wednesdays': True, 'thursdays': True, 'fridays': True, 'saturdays': True, 'sundays': True}}}, {'id': 5, 'enabled': False, 'climatisation': False, 'recurringTimer': {'departureTime': '10:00', 'targetTime': '10:00', 'repetitionDays': ['monday', 'tuesday', 'wednesday', 'thursday', 'friday', 'saturday', 'sunday'], 'recurringOn': {'mondays': True, 'tuesdays': True, 'wednesdays': True, 'thursdays': True, 'fridays': True, 'saturdays': True, 'sundays': True}}}]}}}, 'chargingProfiles': {'chargingProfilesStatus': {'value': {'carCapturedTimestamp': '2024-07-24T11:35:49.208Z', 'timeInCar': datetime.datetime(2024, 7, 24, 13, 35, 49, tzinfo=datetime.timezone(datetime.timedelta(seconds=7200))), 'vehiclePositionedInProfileID': 1, 'nextChargingTimer': {'id': 0, 'targetSOCreachable': 'calculating'}, 'profiles': []}}}, 'climatisation': {'climatisationSettings': {'value': {'carCapturedTimestamp': datetime.datetime(2024, 7, 24, 11, 35, 53, tzinfo=datetime.timezone.utc), 'targetTemperature_C': 21, 'targetTemperature_F': 70, 'unitInCar': 'celsius', 'climatizationAtUnlock': False, 'windowHeatingEnabled': False, 'zoneFrontLeftEnabled': False, 'zoneFrontRightEnabled': False}}, 'climatisationStatus': {'value': {'carCapturedTimestamp': datetime.datetime(2024, 7, 24, 12, 5, 51, tzinfo=datetime.timezone.utc), 'remainingClimatisationTime_min': 0, 'climatisationState': 'off'}}, 'windowHeatingStatus': {'value': {'carCapturedTimestamp': datetime.datetime(2024, 7, 24, 11, 35, 49, tzinfo=datetime.timezone.utc), 'windowHeatingStatus': [{'windowLocation': 'front', 'windowHeatingState': 'off'}, {'windowLocation': 'rear', 'windowHeatingState': 'off'}]}}}, 'climatisationTimers': {'climatisationTimersStatus': {'value': {'carCapturedTimestamp': datetime.datetime(2024, 7, 24, 11, 35, 43, tzinfo=datetime.timezone.utc), 'timeInCar': datetime.datetime(2024, 7, 24, 13, 35, 43, tzinfo=datetime.timezone(datetime.timedelta(seconds=7200))), 'timers': [{'id': 1, 'enabled': False, 'singleTimer': {'startDateTime': datetime.datetime(2024, 7, 22, 22, 0, tzinfo=datetime.timezone.utc), 'targetDateTime': datetime.datetime(2024, 7, 22, 22, 0, tzinfo=datetime.timezone.utc)}}, {'id': 2, 'enabled': False, 'singleTimer': {'startDateTime': datetime.datetime(2024, 7, 22, 22, 0, tzinfo=datetime.timezone.utc), 'targetDateTime': datetime.datetime(2024, 7, 22, 22, 0, tzinfo=datetime.timezone.utc)}}]}}}, 'fuelStatus': {'rangeStatus': {'value': {'carCapturedTimestamp': datetime.datetime(2024, 7, 24, 11, 2, 32, tzinfo=datetime.timezone.utc), 'carType': 'electric', 'primaryEngine': {'type': 'electric', 'currentSOC_pct': 85, 'remainingRange_km': 490}, 'totalRange_km': 490}}}, 'measurements': {'rangeStatus': {'value': {'carCapturedTimestamp': '2024-07-24T12:05:43.613Z', 'electricRange': 487, 'totalRange_km': 487}}, 'odometerStatus': {'value': {'carCapturedTimestamp': '2024-07-24T12:05:43.22Z', 'odometer': 44}}, 'fuelLevelStatus': {'value': {'carCapturedTimestamp': '2024-07-24T12:05:43.663Z', 'currentSOC_pct': 84, 'primaryEngineType': 'electric', 'carType': 'electric'}}}, 'readiness': {'readinessStatus': {'value': {'connectionState': {'isOnline': True, 'isActive': False, 'batteryPowerLevel': 'comfort', 'dailyPowerBudgetAvailable': True}, 'connectionWarning': {'insufficientBatteryLevelWarning': False, 'dailyPowerBudgetWarning': False}}}}, 'vehicleLights': {'lightsStatus': {'value': {'carCapturedTimestamp': datetime.datetime(1, 1, 1, 0, 0, tzinfo=datetime.timezone.utc), 'lights': [{'name': 'right', 'status': 'invalid'}, {'name': 'left', 'status': 'invalid'}]}}}, 'vehicleHealthWarnings': {'warningLights': {'value': {'carCapturedTimestamp': '2024-07-23T15:59:21.686Z', 'mileage_km': 44}}}}
2024-07-24 19:07:15.599 DEBUG (MainThread) [custom_components.audiconnect.audi_models] TRY APPEND FIELD: Searching for 'TOTAL_RANGE' at location=['fuelStatus', 'rangeStatus', 'value', 'totalRange_km']
2024-07-24 19:07:15.599 DEBUG (MainThread) [custom_components.audiconnect.audi_models] TRY APPEND FIELD: Found 'TOTAL_RANGE' with value=490, loc=['fuelStatus', 'rangeStatus', 'value', 'carCapturedTimestamp'], ts=2024-07-24 11:02:32+00:00
2024-07-24 19:07:15.599 DEBUG (MainThread) [custom_components.audiconnect.audi_models] TRY APPEND FIELD: Searching for 'TANK_LEVEL_IN_PERCENTAGE' at location=['measurements', 'fuelLevelStatus', 'value', 'currentFuelLevel_pct']
2024-07-24 19:07:15.599 DEBUG (MainThread) [custom_components.audiconnect.audi_models] TRY APPEND FIELD: Value for 'TANK_LEVEL_IN_PERCENTAGE' is None or missing; not appending field.
2024-07-24 19:07:15.599 DEBUG (MainThread) [custom_components.audiconnect.audi_models] TRY APPEND FIELD: Searching for 'UTC_TIME_AND_KILOMETER_STATUS' at location=['measurements', 'odometerStatus', 'value', 'odometer']
2024-07-24 19:07:15.599 DEBUG (MainThread) [custom_components.audiconnect.audi_models] TRY APPEND FIELD: Found 'UTC_TIME_AND_KILOMETER_STATUS' with value=44, loc=['measurements', 'odometerStatus', 'value', 'carCapturedTimestamp'], ts=2024-07-24T12:05:43.22Z
2024-07-24 19:07:15.599 DEBUG (MainThread) [custom_components.audiconnect.audi_models] TRY APPEND FIELD: Searching for 'MAINTENANCE_INTERVAL_TIME_TO_INSPECTION' at location=['vehicleHealthInspection', 'maintenanceStatus', 'value', 'inspectionDue_days']
2024-07-24 19:07:15.599 DEBUG (MainThread) [custom_components.audiconnect.audi_models] TRY APPEND FIELD: Value for 'MAINTENANCE_INTERVAL_TIME_TO_INSPECTION' is None or missing; not appending field.
2024-07-24 19:07:15.600 DEBUG (MainThread) [custom_components.audiconnect.audi_models] TRY APPEND FIELD: Searching for 'MAINTENANCE_INTERVAL_DISTANCE_TO_INSPECTION' at location=['vehicleHealthInspection', 'maintenanceStatus', 'value', 'inspectionDue_km']
2024-07-24 19:07:15.600 DEBUG (MainThread) [custom_components.audiconnect.audi_models] TRY APPEND FIELD: Value for 'MAINTENANCE_INTERVAL_DISTANCE_TO_INSPECTION' is None or missing; not appending field.
2024-07-24 19:07:15.600 DEBUG (MainThread) [custom_components.audiconnect.audi_models] TRY APPEND FIELD: Searching for 'MAINTENANCE_INTERVAL_TIME_TO_OIL_CHANGE' at location=['vehicleHealthInspection', 'maintenanceStatus', 'value', 'oilServiceDue_days']
2024-07-24 19:07:15.600 DEBUG (MainThread) [custom_components.audiconnect.audi_models] TRY APPEND FIELD: Value for 'MAINTENANCE_INTERVAL_TIME_TO_OIL_CHANGE' is None or missing; not appending field.
2024-07-24 19:07:15.600 DEBUG (MainThread) [custom_components.audiconnect.audi_models] TRY APPEND FIELD: Searching for 'MAINTENANCE_INTERVAL_DISTANCE_TO_OIL_CHANGE' at location=['vehicleHealthInspection', 'maintenanceStatus', 'value', 'oilServiceDue_km']
2024-07-24 19:07:15.600 DEBUG (MainThread) [custom_components.audiconnect.audi_models] TRY APPEND FIELD: Value for 'MAINTENANCE_INTERVAL_DISTANCE_TO_OIL_CHANGE' is None or missing; not appending field.
2024-07-24 19:07:15.600 DEBUG (MainThread) [custom_components.audiconnect.audi_models] TRY APPEND FIELD: Searching for 'OIL_LEVEL_DIPSTICKS_PERCENTAGE' at location=['oilLevel', 'oilLevelStatus', 'value', 'value']
2024-07-24 19:07:15.600 DEBUG (MainThread) [custom_components.audiconnect.audi_models] TRY APPEND FIELD: Value for 'OIL_LEVEL_DIPSTICKS_PERCENTAGE' is None or missing; not appending field.
2024-07-24 19:07:15.600 DEBUG (MainThread) [custom_components.audiconnect.audi_models] TRY APPEND FIELD: Searching for 'ADBLUE_RANGE' at location=['measurements', 'rangeStatus', 'value', 'adBlueRange']
2024-07-24 19:07:15.600 DEBUG (MainThread) [custom_components.audiconnect.audi_models] TRY APPEND FIELD: Value for 'ADBLUE_RANGE' is None or missing; not appending field.
2024-07-24 19:07:15.600 DEBUG (MainThread) [custom_components.audiconnect.audi_models] TRY APPEND FIELD: Searching for 'LIGHT_STATUS' at location=['vehicleLights', 'lightsStatus', 'value', 'lights']
2024-07-24 19:07:15.600 DEBUG (MainThread) [custom_components.audiconnect.audi_models] TRY APPEND FIELD: Found 'LIGHT_STATUS' with value=[{'name': 'right', 'status': 'invalid'}, {'name': 'left', 'status': 'invalid'}], loc=['vehicleLights', 'lightsStatus', 'value', 'carCapturedTimestamp'], ts=0001-01-01 00:00:00+00:00
2024-07-24 19:07:15.600 DEBUG (MainThread) [custom_components.audiconnect.audi_models] APPEND WINDOW: Starting to append windows...
2024-07-24 19:07:15.601 DEBUG (MainThread) [custom_components.audiconnect.audi_models] APPEND WINDOW: Timestamp captured from car: 0001-01-01 00:00:00+00:00
2024-07-24 19:07:15.601 DEBUG (MainThread) [custom_components.audiconnect.audi_models] APPEND WINDOW: Processing window: sunRoof with status: ['unsupported']
2024-07-24 19:07:15.601 DEBUG (MainThread) [custom_components.audiconnect.audi_models] APPEND WINDOW: Skipping unsupported window or not mapped in OLDAPI_MAPPING: sunRoof
2024-07-24 19:07:15.601 DEBUG (MainThread) [custom_components.audiconnect.audi_models] APPEND WINDOW: Processing window: roofCover with status: ['unsupported']
2024-07-24 19:07:15.601 DEBUG (MainThread) [custom_components.audiconnect.audi_models] APPEND WINDOW: Skipping unsupported window or not mapped in OLDAPI_MAPPING: roofCover
2024-07-24 19:07:15.601 DEBUG (MainThread) [custom_components.audiconnect.audi_models] APPEND WINDOW: Processing window: sunRoofRear with status: ['unsupported']
2024-07-24 19:07:15.601 DEBUG (MainThread) [custom_components.audiconnect.audi_models] APPEND WINDOW: Skipping unsupported window or not mapped in OLDAPI_MAPPING: sunRoofRear
2024-07-24 19:07:15.601 DEBUG (MainThread) [custom_components.audiconnect.audi_models] APPEND WINDOW: Processing window: frontLeft with status: ['unsupported']
2024-07-24 19:07:15.602 DEBUG (MainThread) [custom_components.audiconnect.audi_models] APPEND WINDOW: Skipping unsupported window or not mapped in OLDAPI_MAPPING: frontLeft
2024-07-24 19:07:15.602 DEBUG (MainThread) [custom_components.audiconnect.audi_models] APPEND WINDOW: Processing window: frontRight with status: ['unsupported']
2024-07-24 19:07:15.602 DEBUG (MainThread) [custom_components.audiconnect.audi_models] APPEND WINDOW: Skipping unsupported window or not mapped in OLDAPI_MAPPING: frontRight
2024-07-24 19:07:15.602 DEBUG (MainThread) [custom_components.audiconnect.audi_models] APPEND WINDOW: Processing window: rearLeft with status: ['unsupported']
2024-07-24 19:07:15.602 DEBUG (MainThread) [custom_components.audiconnect.audi_models] APPEND WINDOW: Skipping unsupported window or not mapped in OLDAPI_MAPPING: rearLeft
2024-07-24 19:07:15.602 DEBUG (MainThread) [custom_components.audiconnect.audi_models] APPEND WINDOW: Processing window: rearRight with status: ['unsupported']
2024-07-24 19:07:15.602 DEBUG (MainThread) [custom_components.audiconnect.audi_models] APPEND WINDOW: Skipping unsupported window or not mapped in OLDAPI_MAPPING: rearRight
2024-07-24 19:07:15.602 DEBUG (MainThread) [custom_components.audiconnect.audi_models] APPEND WINDOW: Finished appending windows
2024-07-24 19:07:15.602 DEBUG (MainThread) [custom_components.audiconnect.audi_models] APPEND DOOR: Starting to append doors...
2024-07-24 19:07:15.602 DEBUG (MainThread) [custom_components.audiconnect.audi_models] APPEND DOOR: Timestamp captured from car: 0001-01-01 00:00:00+00:00
2024-07-24 19:07:15.602 DEBUG (MainThread) [custom_components.audiconnect.audi_models] APPEND DOOR: Processing door: bonnet with status: ['unsupported']
2024-07-24 19:07:15.602 DEBUG (MainThread) [custom_components.audiconnect.audi_models] APPEND DOOR: Unsupported state for door: bonnet
2024-07-24 19:07:15.602 DEBUG (MainThread) [custom_components.audiconnect.audi_models] APPEND DOOR: Processing door: trunk with status: ['unsupported']
2024-07-24 19:07:15.602 DEBUG (MainThread) [custom_components.audiconnect.audi_models] APPEND DOOR: Unsupported state for door: trunk
2024-07-24 19:07:15.603 DEBUG (MainThread) [custom_components.audiconnect.audi_models] APPEND DOOR: Processing door: rearRight with status: ['unsupported']
2024-07-24 19:07:15.603 DEBUG (MainThread) [custom_components.audiconnect.audi_models] APPEND DOOR: Unsupported state for door: rearRight
2024-07-24 19:07:15.603 DEBUG (MainThread) [custom_components.audiconnect.audi_models] APPEND DOOR: Processing door: rearLeft with status: ['unsupported']
2024-07-24 19:07:15.603 DEBUG (MainThread) [custom_components.audiconnect.audi_models] APPEND DOOR: Unsupported state for door: rearLeft
2024-07-24 19:07:15.603 DEBUG (MainThread) [custom_components.audiconnect.audi_models] APPEND DOOR: Processing door: frontRight with status: ['unsupported']
2024-07-24 19:07:15.603 DEBUG (MainThread) [custom_components.audiconnect.audi_models] APPEND DOOR: Unsupported state for door: frontRight
2024-07-24 19:07:15.603 DEBUG (MainThread) [custom_components.audiconnect.audi_models] APPEND DOOR: Processing door: frontLeft with status: ['unsupported']
2024-07-24 19:07:15.603 DEBUG (MainThread) [custom_components.audiconnect.audi_models] APPEND DOOR: Unsupported state for door: frontLeft
2024-07-24 19:07:15.603 DEBUG (MainThread) [custom_components.audiconnect.audi_models] APPEND DOOR: Finished appending doors
2024-07-24 19:07:15.603 DEBUG (MainThread) [custom_components.audiconnect.audi_models] TRY APPEND STATE: Searching for 'carType' at location=['fuelStatus', 'rangeStatus', 'value', 'carType'], tsoff=-1
2024-07-24 19:07:15.603 DEBUG (MainThread) [custom_components.audiconnect.audi_models] TRY APPEND STATE: Found 'carType' with value=electric, tsoff=-1, loc=['fuelStatus', 'rangeStatus', 'value', 'carCapturedTimestamp'], ts=2024-07-24 11:02:32+00:00
2024-07-24 19:07:15.603 DEBUG (MainThread) [custom_components.audiconnect.audi_models] TRY APPEND STATE: Searching for 'engineTypeFirstEngine' at location=['fuelStatus', 'rangeStatus', 'value', 'primaryEngine', 'type'], tsoff=-2
2024-07-24 19:07:15.603 DEBUG (MainThread) [custom_components.audiconnect.audi_models] TRY APPEND STATE: Found 'engineTypeFirstEngine' with value=electric, tsoff=-2, loc=['fuelStatus', 'rangeStatus', 'value', 'carCapturedTimestamp'], ts=2024-07-24 11:02:32+00:00
2024-07-24 19:07:15.603 DEBUG (MainThread) [custom_components.audiconnect.audi_models] TRY APPEND STATE: Searching for 'primaryEngineRange' at location=['fuelStatus', 'rangeStatus', 'value', 'primaryEngine', 'remainingRange_km'], tsoff=-2
2024-07-24 19:07:15.603 DEBUG (MainThread) [custom_components.audiconnect.audi_models] TRY APPEND STATE: Found 'primaryEngineRange' with value=490, tsoff=-2, loc=['fuelStatus', 'rangeStatus', 'value', 'carCapturedTimestamp'], ts=2024-07-24 11:02:32+00:00
2024-07-24 19:07:15.604 DEBUG (MainThread) [custom_components.audiconnect.audi_models] TRY APPEND STATE: Searching for 'primaryEngineRangePercent' at location=['fuelStatus', 'rangeStatus', 'value', 'primaryEngine', 'currentSOC_pct'], tsoff=-2
2024-07-24 19:07:15.604 DEBUG (MainThread) [custom_components.audiconnect.audi_models] TRY APPEND STATE: Found 'primaryEngineRangePercent' with value=85, tsoff=-2, loc=['fuelStatus', 'rangeStatus', 'value', 'carCapturedTimestamp'], ts=2024-07-24 11:02:32+00:00
2024-07-24 19:07:15.604 DEBUG (MainThread) [custom_components.audiconnect.audi_models] TRY APPEND STATE: Searching for 'engineTypeSecondEngine' at location=['fuelStatus', 'rangeStatus', 'value', 'secondaryEngine', 'type'], tsoff=-2
2024-07-24 19:07:15.604 DEBUG (MainThread) [custom_components.audiconnect.audi_models] TRY APPEND STATE: Value for 'engineTypeSecondEngine' is None; not appending state.
2024-07-24 19:07:15.604 DEBUG (MainThread) [custom_components.audiconnect.audi_models] TRY APPEND STATE: Searching for 'secondaryEngineRange' at location=['fuelStatus', 'rangeStatus', 'value', 'secondaryEngine', 'remainingRange_km'], tsoff=-2
2024-07-24 19:07:15.604 DEBUG (MainThread) [custom_components.audiconnect.audi_models] TRY APPEND STATE: Value for 'secondaryEngineRange' is None; not appending state.
2024-07-24 19:07:15.604 DEBUG (MainThread) [custom_components.audiconnect.audi_models] TRY APPEND STATE: Searching for 'secondaryEngineRangePercent' at location=['fuelStatus', 'rangeStatus', 'value', 'secondaryEngine', 'currentSOC_pct'], tsoff=-2
2024-07-24 19:07:15.604 DEBUG (MainThread) [custom_components.audiconnect.audi_models] TRY APPEND STATE: Value for 'secondaryEngineRangePercent' is None; not appending state.
2024-07-24 19:07:15.605 DEBUG (MainThread) [custom_components.audiconnect.audi_models] TRY APPEND STATE: Searching for 'hybridRange' at location=['fuelStatus', 'rangeStatus', 'value', 'totalRange_km'], tsoff=-1
2024-07-24 19:07:15.605 DEBUG (MainThread) [custom_components.audiconnect.audi_models] TRY APPEND STATE: Found 'hybridRange' with value=490, tsoff=-1, loc=['fuelStatus', 'rangeStatus', 'value', 'carCapturedTimestamp'], ts=2024-07-24 11:02:32+00:00
2024-07-24 19:07:15.605 DEBUG (MainThread) [custom_components.audiconnect.audi_models] TRY APPEND STATE: Searching for 'stateOfCharge' at location=['charging', 'batteryStatus', 'value', 'currentSOC_pct'], tsoff=-1
2024-07-24 19:07:15.605 DEBUG (MainThread) [custom_components.audiconnect.audi_models] TRY APPEND STATE: Found 'stateOfCharge' with value=85, tsoff=-1, loc=['charging', 'batteryStatus', 'value', 'carCapturedTimestamp'], ts=2024-07-24 11:02:32+00:00
2024-07-24 19:07:15.605 DEBUG (MainThread) [custom_components.audiconnect.audi_models] TRY APPEND STATE: Searching for 'chargingState' at location=['charging', 'chargingStatus', 'value', 'chargingState'], tsoff=-1
2024-07-24 19:07:15.605 DEBUG (MainThread) [custom_components.audiconnect.audi_models] TRY APPEND STATE: Found 'chargingState' with value=notReadyForCharging, tsoff=-1, loc=['charging', 'chargingStatus', 'value', 'carCapturedTimestamp'], ts=2024-07-24 11:02:32+00:00
2024-07-24 19:07:15.606 DEBUG (MainThread) [custom_components.audiconnect.audi_models] TRY APPEND STATE: Searching for 'chargeMode' at location=['charging', 'chargingStatus', 'value', 'chargeMode'], tsoff=-1
2024-07-24 19:07:15.606 DEBUG (MainThread) [custom_components.audiconnect.audi_models] TRY APPEND STATE: Found 'chargeMode' with value=manual, tsoff=-1, loc=['charging', 'chargingStatus', 'value', 'carCapturedTimestamp'], ts=2024-07-24 11:02:32+00:00
2024-07-24 19:07:15.606 DEBUG (MainThread) [custom_components.audiconnect.audi_models] TRY APPEND STATE: Searching for 'chargingPower' at location=['charging', 'chargingStatus', 'value', 'chargePower_kW'], tsoff=-1
2024-07-24 19:07:15.606 DEBUG (MainThread) [custom_components.audiconnect.audi_models] TRY APPEND STATE: Found 'chargingPower' with value=0, tsoff=-1, loc=['charging', 'chargingStatus', 'value', 'carCapturedTimestamp'], ts=2024-07-24 11:02:32+00:00
2024-07-24 19:07:15.606 DEBUG (MainThread) [custom_components.audiconnect.audi_models] TRY APPEND STATE: Searching for 'actualChargeRate' at location=['charging', 'chargingStatus', 'value', 'chargeRate_kmph'], tsoff=-1
2024-07-24 19:07:15.606 DEBUG (MainThread) [custom_components.audiconnect.audi_models] TRY APPEND STATE: Found 'actualChargeRate' with value=0, tsoff=-1, loc=['charging', 'chargingStatus', 'value', 'carCapturedTimestamp'], ts=2024-07-24 11:02:32+00:00
2024-07-24 19:07:15.606 DEBUG (MainThread) [custom_components.audiconnect.audi_models] TRY APPEND STATE: Searching for 'chargingMode' at location=['charging', 'chargingStatus', 'value', 'chargeType'], tsoff=-1
2024-07-24 19:07:15.606 DEBUG (MainThread) [custom_components.audiconnect.audi_models] TRY APPEND STATE: Found 'chargingMode' with value=invalid, tsoff=-1, loc=['charging', 'chargingStatus', 'value', 'carCapturedTimestamp'], ts=2024-07-24 11:02:32+00:00
2024-07-24 19:07:15.606 DEBUG (MainThread) [custom_components.audiconnect.audi_models] TRY APPEND STATE: Searching for 'targetstateOfCharge' at location=['charging', 'chargingSettings', 'value', 'targetSOC_pct'], tsoff=-1
2024-07-24 19:07:15.606 DEBUG (MainThread) [custom_components.audiconnect.audi_models] TRY APPEND STATE: Found 'targetstateOfCharge' with value=100, tsoff=-1, loc=['charging', 'chargingSettings', 'value', 'carCapturedTimestamp'], ts=2024-07-24 11:35:49+00:00
2024-07-24 19:07:15.606 DEBUG (MainThread) [custom_components.audiconnect.audi_models] TRY APPEND STATE: Searching for 'plugState' at location=['charging', 'plugStatus', 'value', 'plugConnectionState'], tsoff=-1
2024-07-24 19:07:15.606 DEBUG (MainThread) [custom_components.audiconnect.audi_models] TRY APPEND STATE: Found 'plugState' with value=disconnected, tsoff=-1, loc=['charging', 'plugStatus', 'value', 'carCapturedTimestamp'], ts=2024-07-24 11:35:48+00:00
2024-07-24 19:07:15.606 DEBUG (MainThread) [custom_components.audiconnect.audi_models] TRY APPEND STATE: Searching for 'remainingChargingTime' at location=['charging', 'chargingStatus', 'value', 'remainingChargingTimeToComplete_min'], tsoff=-1
2024-07-24 19:07:15.607 DEBUG (MainThread) [custom_components.audiconnect.audi_models] TRY APPEND STATE: Found 'remainingChargingTime' with value=0, tsoff=-1, loc=['charging', 'chargingStatus', 'value', 'carCapturedTimestamp'], ts=2024-07-24 11:02:32+00:00
2024-07-24 19:07:15.607 DEBUG (MainThread) [custom_components.audiconnect.audi_models] TRY APPEND STATE: Searching for 'plugLockState' at location=['charging', 'plugStatus', 'value', 'plugLockState'], tsoff=-1
2024-07-24 19:07:15.607 DEBUG (MainThread) [custom_components.audiconnect.audi_models] TRY APPEND STATE: Found 'plugLockState' with value=unlocked, tsoff=-1, loc=['charging', 'plugStatus', 'value', 'carCapturedTimestamp'], ts=2024-07-24 11:35:48+00:00
2024-07-24 19:07:15.607 DEBUG (MainThread) [custom_components.audiconnect.audi_models] TRY APPEND STATE: Searching for 'externalPower' at location=['charging', 'plugStatus', 'value', 'externalPower'], tsoff=-1
2024-07-24 19:07:15.607 DEBUG (MainThread) [custom_components.audiconnect.audi_models] TRY APPEND STATE: Found 'externalPower' with value=unavailable, tsoff=-1, loc=['charging', 'plugStatus', 'value', 'carCapturedTimestamp'], ts=2024-07-24 11:35:48+00:00
2024-07-24 19:07:15.607 DEBUG (MainThread) [custom_components.audiconnect.audi_models] TRY APPEND STATE: Searching for 'plugledColor' at location=['charging', 'plugStatus', 'value', 'ledColor'], tsoff=-1
2024-07-24 19:07:15.607 DEBUG (MainThread) [custom_components.audiconnect.audi_models] TRY APPEND STATE: Found 'plugledColor' with value=invalid, tsoff=-1, loc=['charging', 'plugStatus', 'value', 'carCapturedTimestamp'], ts=2024-07-24 11:35:48+00:00
2024-07-24 19:07:15.607 DEBUG (MainThread) [custom_components.audiconnect.audi_models] TRY APPEND STATE: Searching for 'climatisationState' at location=['climatisation', 'auxiliaryHeatingStatus', 'value', 'climatisationState'], tsoff=-1
2024-07-24 19:07:15.607 DEBUG (MainThread) [custom_components.audiconnect.audi_models] TRY APPEND STATE: Value for 'climatisationState' is None; not appending state.
2024-07-24 19:07:15.608 DEBUG (MainThread) [custom_components.audiconnect.audi_connect_account] Trip data support is disabled for VIN: *************6552. Exiting update process.
2024-07-24 19:07:15.608 DEBUG (MainThread) [custom_components.audiconnect.audi_connect_account] Trip data support is disabled for VIN: *************6552. Exiting update process.
2024-07-24 19:07:15.608 DEBUG (MainThread) [custom_components.audiconnect.audi_connect_account] POSITION: Starting update_vehicle_position for VIN: *************6552
2024-07-24 19:07:15.608 DEBUG (MainThread) [custom_components.audiconnect.audi_connect_account] POSITION: Attempting to retrieve stored vehicle position for VIN: *************6552
2024-07-24 19:07:16.047 ERROR (MainThread) [custom_components.audiconnect.audi_connect_account] POSITION: ClientResponseError with status 404 for VIN: *************6552. Error: 404, message='Not Found', url=URL('https://emea.bff.cariad.digital/vehicle/v1/vehicles/WAUZZZFZ9RP076552/parkingposition')
2024-07-24 19:07:16.050 DEBUG (MainThread) [custom_components.audiconnect.audi_account] Successfully refreshed cloud data

@pergolafabio
Copy link

pergolafabio commented Jul 24, 2024

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...

2024-07-24 19:20:10.617 ERROR (MainThread) [custom_components.audiconnect.audi_connect_account] POSITION: ClientResponseError with status 404 for VIN: *************6552. Error: 404, message='Not Found', url=URL('https://emea.bff.cariad.digital/vehicle/v1/vehicles/XXXX/parkingposition')

@coreywillwhat
Copy link
Contributor Author

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.

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...

2024-07-24 19:20:10.617 ERROR (MainThread) [custom_components.audiconnect.audi_connect_account] POSITION: ClientResponseError with status 404 for VIN: *************6552. Error: 404, message='Not Found', url=URL('https://emea.bff.cariad.digital/vehicle/v1/vehicles/WAUZZZFZ9RP076552/parkingposition')

GPS is still working for me in app and HA

@pergolafabio
Copy link

Let me know if you need more info! Or if I can help to test...

@coreywillwhat
Copy link
Contributor Author

coreywillwhat commented Jul 24, 2024

Adding info here in case anyone gets to updating the integration endpoints:

US Region - 2021 Q5 PHEV

Climate Control Start URL:
https://mal-3a.prd.eu.dp.vwg-connect.com/api/bs/climatisation/v1/vehicles/{vin}/climater/actions
Climate Control Start Request Body:

{
  "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:
https://mal-3a.prd.eu.dp.vwg-connect.com/api/bs/climatisation/v1/vehicles/{vin}/climater/actions

Climate Stop Request Body:

{
  "action": {
    "type": "stopClimatisation"
  }
}

Climate Stop Response Body: {

  "action": {
    "type": "stopClimatisation",
    "actionId": 1306061699,
    "actionState": "queued"
  }

@pergolafabio
Copy link

pergolafabio commented Jul 24, 2024

Also posting it here for the Q4 2024 model, there are 2 urls for start / stop
But there is also an url to see it it succeded yes or not, i think this is new too ?

START CLIMA

https://emea.bff.cariad.digital/vehicle/v1/vehicles/xxx/climatisation/start

with request:

{
  "targetTemperature": 22,
  "targetTemperatureUnit": "celsius",
  "climatisationWithoutExternalPower": true,
  "climatizationAtUnlock": false,
  "windowHeatingEnabled": false,
  "zoneFrontLeftEnabled": false,
  "zoneFrontRightEnabled": false,
  "zoneRearLeftEnabled": false,
  "zoneRearRightEnabled": false
}

STOP CLIMA:

https://emea.bff.cariad.digital/vehicle/v1/vehicles/xxx/climatisation/stop

GET STATUS FOR START or STOP

https://emea.bff.cariad.digital/vehicle/v1/vehicles/XXX/pendingrequests

with response:

{
  "data": [
    {
      "id": "8cf8437d-94a5-49fa-9b12-60ea1bd9c2c3",
      "userId": "0e0f02f7-620c-42e5-87d3-35d76f700a75",
      "vin": "XXXX",
      "httpMethod": "POST",
      "path": "/vehicles/XXXX/climatisation/start",
      "capability": "climatisation",
      "operation": "start",
      "operationGroup": "climatisation",
      "body": "{\"callback\":\"https://emea.bff.cariad.digital/vehicle/v1/vehicles/callbacks/XXXX/climatisation/start/POST\",\"climatisationWithoutExternalPower\":true,\"targetTemperature\":21,\"targetTemperatureUnit\":\"celsius\",\"climatizationAtUnlock\":false,\"windowHeatingEnabled\":false,\"zoneFrontLeftEnabled\":false,\"zoneFrontRightEnabled\":false}",
      "vcfRequestId": "ad460379-da19-443d-bec9-58818ef275ef",
      "status": "in_progress",
      "queuedOperation": null,
      "timestamp": "2024-07-24T11:35:03.723443436Z"
    },
    {
      "id": "ab1cef0e-d047-4fba-9dc3-b3b6691a6336",
      "userId": "0e0f02f7-620c-42e5-87d3-35d76f700a75",
      "vin": "XXX",
      "httpMethod": "PUT",
      "path": "/vehicles/XXXX/climatisation/settings",
      "capability": "climatisation",
      "operation": "settings",
      "operationGroup": "climatisationSettings",
      "body": "{\"callback\":\"https://emea.bff.cariad.digital/vehicle/v1/vehicles/callbacks/XXX/climatisation/settings/PUT\",\"climatisationWithoutExternalPower\":true,\"targetTemperature\":21,\"targetTemperatureUnit\":\"celsius\",\"climatizationAtUnlock\":false,\"windowHeatingEnabled\":false,\"zoneFrontLeftEnabled\":false,\"zoneFrontRightEnabled\":false}",
      "vcfRequestId": "94f83793-6c2d-43ce-9f6f-95098b372d53",
      "status": "successful",
      "queuedOperation": null,
      "timestamp": "2024-07-24T11:30:13.249758808Z"
    }
  ]
}

eventually:

"status": "successful",
this status is changing .... from "in_progress" to "successful"

@pergolafabio
Copy link

Hi, quick update, seems my GPS location is now working, also i can now see the state of my doors/windows
Seems there was an issue on the backend with my license, so i have a lot more enitties now :-)

anwyay, the last thing not working is indeed the start / stop clima!!

@coreywillwhat
Copy link
Contributor Author

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.

@pergolafabio
Copy link

wow , nice! :-)

@coreywillwhat coreywillwhat added bug Something isn't working planned Planned fix or feature labels Jul 25, 2024
@coreywillwhat
Copy link
Contributor Author

@pergolafabio for the check if the request succeeded, are you seeing anything like:

https://mal-3a.prd.eu.dp.vwg-connect.com/api/bs/climatisation/v1/vehicles/{vin}/climater/actions/1310865457

specifically something with an ID such as 1310865457 in the example above?

@pergolafabio
Copy link

Hi, no it's a different url, scroll a few posts back, I have posted it there

@coreywillwhat
Copy link
Contributor Author

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.

@pergolafabio
Copy link

Ok, I do a trace later again, to check, in 1.5 hour :-)

@coreywillwhat
Copy link
Contributor Author

No rush. Not sure I will have more time today.
Another question: I see you posted the request body, but are you getting any response body from:

POST https://emea.bff.cariad.digital/vehicle/v1/vehicles/xxx/climatisation/start

or

POST https://emea.bff.cariad.digital/vehicle/v1/vehicles/xxx/climatisation/stop

@pergolafabio
Copy link

pergolafabio commented Jul 25, 2024

ok, did a new test:

POST REQ:
https://emea.bff.cariad.digital/vehicle/v1/vehicles/XXXX/climatisation/start

REQ Body:

{
  "targetTemperature": 21,
  "targetTemperatureUnit": "celsius",
  "climatisationWithoutExternalPower": true,
  "climatizationAtUnlock": false,
  "windowHeatingEnabled": false,
  "zoneFrontLeftEnabled": false,
  "zoneFrontRightEnabled": false,
  "zoneRearLeftEnabled": false,
  "zoneRearRightEnabled": false
}

RESPONSE:

{
  "data": {
    "requestID": "b2313fd1-9b8e-4535-b48b-9fcdd22db59c"
  }
}

Afterwards i see every XX seconds this GET REQUEST , its a polling

https://emea.bff.cariad.digital/vehicle/v1/vehicles/XXX/pendingrequests

With RESPONSE BODY:

{
  "data": [
    {
      "id": "b2313fd1-9b8e-4535-b48b-9fcdd22db59c",
      "userId": "0e0f02f7-620c-42e5-87d3-35d76f700a75",
      "vin": "XXXX",
      "httpMethod": "POST",
      "path": "/vehicles/XXXX/climatisation/start",
      "capability": "climatisation",
      "operation": "start",
      "operationGroup": "climatisation",
      "body": "{\"callback\":\"https://emea.bff.cariad.digital/vehicle/v1/vehicles/callbacks/XXXX/climatisation/start/POST\",\"climatisationWithoutExternalPower\":true,\"targetTemperature\":21,\"targetTemperatureUnit\":\"celsius\",\"climatizationAtUnlock\":false,\"windowHeatingEnabled\":false,\"zoneFrontLeftEnabled\":false,\"zoneFrontRightEnabled\":false,\"zoneRearLeftEnabled\":false,\"zoneRearRightEnabled\":false}",
      "vcfRequestId": "4870200d-07ea-46e9-af7f-1ca17d2923f1",
      "status": "in_progress",
      "queuedOperation": null,
      "timestamp": "2024-07-25T18:55:21.398586836Z"
    }
  ]
}

Untill after about 10 times, its succesfull , the state changes:

{
  "data": [
    {
      "id": "b2313fd1-9b8e-4535-b48b-9fcdd22db59c",
      "userId": "0e0f02f7-620c-42e5-87d3-35d76f700a75",
      "vin": "xxxx",
      "httpMethod": "POST",
      "path": "/vehicles/XXXX/climatisation/start",
      "capability": "climatisation",
      "operation": "start",
      "operationGroup": "climatisation",
      "body": "{\"callback\":\"https://emea.bff.cariad.digital/vehicle/v1/vehicles/callbacks/XXXX/climatisation/start/POST\",\"climatisationWithoutExternalPower\":true,\"targetTemperature\":21,\"targetTemperatureUnit\":\"celsius\",\"climatizationAtUnlock\":false,\"windowHeatingEnabled\":false,\"zoneFrontLeftEnabled\":false,\"zoneFrontRightEnabled\":false,\"zoneRearLeftEnabled\":false,\"zoneRearRightEnabled\":false}",
      "vcfRequestId": "4870200d-07ea-46e9-af7f-1ca17d2923f1",
      "status": "successful",
      "queuedOperation": null,
      "timestamp": "2024-07-25T18:55:21.398586836Z"
    }
  ]
}

For a STOP
POST REQUEST:
https://emea.bff.cariad.digital/vehicle/v1/vehicles/XXX/climatisation/stop

RESPONSE BODY:

{
  "data": {
    "requestID": "f2589ba0-9c78-44a4-a1cb-bf83e488d8bc"
  }
}

Then again a polling GET REQUEST:
https://emea.bff.cariad.digital/vehicle/v1/vehicles/XXXX/pendingrequests

RESPONSE BODY:
i see here 2 responses , the start is also in the pendinrequest, but with the other request ID

{
  "data": [
    {
      "id": "b2313fd1-9b8e-4535-b48b-9fcdd22db59c",
      "userId": "0e0f02f7-620c-42e5-87d3-35d76f700a75",
      "vin": "XXXX",
      "httpMethod": "POST",
      "path": "/vehicles/XXXX/climatisation/start",
      "capability": "climatisation",
      "operation": "start",
      "operationGroup": "climatisation",
      "body": "{\"callback\":\"https://emea.bff.cariad.digital/vehicle/v1/vehicles/callbacks/XXXX/climatisation/start/POST\",\"climatisationWithoutExternalPower\":true,\"targetTemperature\":21,\"targetTemperatureUnit\":\"celsius\",\"climatizationAtUnlock\":false,\"windowHeatingEnabled\":false,\"zoneFrontLeftEnabled\":false,\"zoneFrontRightEnabled\":false,\"zoneRearLeftEnabled\":false,\"zoneRearRightEnabled\":false}",
      "vcfRequestId": "4870200d-07ea-46e9-af7f-1ca17d2923f1",
      "status": "successful",
      "queuedOperation": null,
      "timestamp": "2024-07-25T18:55:21.398586836Z"
    },
    {
      "id": "f2589ba0-9c78-44a4-a1cb-bf83e488d8bc",
      "userId": "0e0f02f7-620c-42e5-87d3-35d76f700a75",
      "vin": "XXXX",
      "httpMethod": "POST",
      "path": "/vehicles/XXXX/climatisation/stop",
      "capability": "climatisation",
      "operation": "stop",
      "operationGroup": "climatisation",
      "body": "{\"callback\":\"https://emea.bff.cariad.digital/vehicle/v1/vehicles/callbacks/XXXX/climatisation/stop/POST\"}",
      "vcfRequestId": "f5e565e4-5b69-48d1-9039-707038bf6786",
      "status": "in_progress",
      "queuedOperation": null,
      "timestamp": "2024-07-25T19:01:22.813166877Z"
    }
  ]
}

The second polling i see, there is the stop as primary

{
  "data": [
    {
      "id": "f2589ba0-9c78-44a4-a1cb-bf83e488d8bc",
      "userId": "0e0f02f7-620c-42e5-87d3-35d76f700a75",
      "vin": "XXXX",
      "httpMethod": "POST",
      "path": "/vehicles/XXXX/climatisation/stop",
      "capability": "climatisation",
      "operation": "stop",
      "operationGroup": "climatisation",
      "body": "{\"callback\":\"https://emea.bff.cariad.digital/vehicle/v1/vehicles/callbacks/XXXX/climatisation/stop/POST\"}",
      "vcfRequestId": "f5e565e4-5b69-48d1-9039-707038bf6786",
      "status": "in_progress",
      "queuedOperation": null,
      "timestamp": "2024-07-25T19:01:22.813166877Z"
    },
    {
      "id": "b2313fd1-9b8e-4535-b48b-9fcdd22db59c",
      "userId": "0e0f02f7-620c-42e5-87d3-35d76f700a75",
      "vin": "XXXX",
      "httpMethod": "POST",
      "path": "/vehicles/XXXX/climatisation/start",
      "capability": "climatisation",
      "operation": "start",
      "operationGroup": "climatisation",
      "body": "{\"callback\":\"https://emea.bff.cariad.digital/vehicle/v1/vehicles/callbacks/XXXX/climatisation/start/POST\",\"climatisationWithoutExternalPower\":true,\"targetTemperature\":21,\"targetTemperatureUnit\":\"celsius\",\"climatizationAtUnlock\":false,\"windowHeatingEnabled\":false,\"zoneFrontLeftEnabled\":false,\"zoneFrontRightEnabled\":false,\"zoneRearLeftEnabled\":false,\"zoneRearRightEnabled\":false}",
      "vcfRequestId": "4870200d-07ea-46e9-af7f-1ca17d2923f1",
      "status": "successful",
      "queuedOperation": null,
      "timestamp": "2024-07-25T18:55:21.398586836Z"
    }
  ]
}

A few polls later, i see the succesfull

{
  "data": [
    {
      "id": "f2589ba0-9c78-44a4-a1cb-bf83e488d8bc",
      "userId": "0e0f02f7-620c-42e5-87d3-35d76f700a75",
      "vin": "XXXX",
      "httpMethod": "POST",
      "path": "/vehicles/XXXX/climatisation/stop",
      "capability": "climatisation",
      "operation": "stop",
      "operationGroup": "climatisation",
      "body": "{\"callback\":\"https://emea.bff.cariad.digital/vehicle/v1/vehicles/callbacks/XXXX/climatisation/stop/POST\"}",
      "vcfRequestId": "f5e565e4-5b69-48d1-9039-707038bf6786",
      "status": "successful",
      "queuedOperation": null,
      "timestamp": "2024-07-25T19:01:22.813166877Z"
    },
    {
      "id": "b2313fd1-9b8e-4535-b48b-9fcdd22db59c",
      "userId": "0e0f02f7-620c-42e5-87d3-35d76f700a75",
      "vin": "XXX",
      "httpMethod": "POST",
      "path": "/vehicles/XXXX/climatisation/start",
      "capability": "climatisation",
      "operation": "start",
      "operationGroup": "climatisation",
      "body": "{\"callback\":\"https://emea.bff.cariad.digital/vehicle/v1/vehicles/callbacks/XXXX/climatisation/start/POST\",\"climatisationWithoutExternalPower\":true,\"targetTemperature\":21,\"targetTemperatureUnit\":\"celsius\",\"climatizationAtUnlock\":false,\"windowHeatingEnabled\":false,\"zoneFrontLeftEnabled\":false,\"zoneFrontRightEnabled\":false,\"zoneRearLeftEnabled\":false,\"zoneRearRightEnabled\":false}",
      "vcfRequestId": "4870200d-07ea-46e9-af7f-1ca17d2923f1",
      "status": "successful",
      "queuedOperation": null,
      "timestamp": "2024-07-25T18:55:21.398586836Z"
    }
  ]
}

is this also the same as you?

@pergolafabio
Copy link

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?

@Kolbi Kolbi linked a pull request Jul 26, 2024 that will close this issue
@coreywillwhat
Copy link
Contributor Author

This is different than whats it been in the past. Thanks for all the info.

@pergolafabio
Copy link

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

@pergolafabio
Copy link

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 ;-)

@pergolafabio
Copy link

for the ones interested , i did an hardcode, changed file audi_services.py to this:

    async def set_climatisation(self, vin: str, start: bool):
        if start:
            data = '{ "targetTemperature": 23, "targetTemperatureUnit": "celsius", "climatisationWithoutExternalPower": true, "climatizationAtUnlock": false, "windowHeatingEnabled": true, "zoneFrontLeftEnabled": false, "zoneFrontRightEnabled": false, "zoneRearLeftEnabled": false,  "zoneRearRightEnabled": false }'
            headers = { "Authorization": "Bearer " + self._bearer_token_json["access_token"] }
            res = await self._api.request(
                "POST",
                "https://emea.bff.cariad.digital/vehicle/v1/vehicles/{vin}/climatisation/start".format(
                    vin=vin.upper(),
                ),
                headers=headers,
                data=data,
            ) 
        else:
            data = ''
            headers = { "Authorization": "Bearer " + self._bearer_token_json["access_token"] }
            res = await self._api.request(
                "POST",
                "https://emea.bff.cariad.digital/vehicle/v1/vehicles/{vin}/climatisation/stop".format(
                    vin=vin.upper(),
                ),
                headers=headers,
                data=data,
            )



        # checkUrl = "{homeRegion}/fs-car/bs/climatisation/v1/{type}/{country}/vehicles/{vin}/climater/actions/{actionid}".format(
            # homeRegion=await self._get_home_region(vin.upper()),
            # type=self._type,
            # country=self._country,
            # vin=vin.upper(),
            # actionid=res["action"]["actionId"],
        # )

        # await self.check_request_succeeded(
            # checkUrl,
            # "start climatisation" if start else "stop climatisation",
            # SUCCEEDED,
            # FAILED,
            # "action.actionState",
        # )

@hjaltij
Copy link

hjaltij commented Nov 11, 2024

Are you all using a modified Android binary to sniff the traffic?

There's cert pinning on the iOS app.

@pergolafabio
Copy link

I use Frida to sniff the traffic, rooted test phone

Kolbi added a commit that referenced this issue Nov 12, 2024
set_climatisation #450
@t0bias-r
Copy link
Contributor

I capture the traffic without rooting the phone. You have to patch and re-package the apk, but that's not difficult.
https://koz.io/using-frida-on-android-without-root/

@pergolafabio
Copy link

@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...?

@Kolbi
Copy link
Contributor

Kolbi commented Nov 12, 2024

@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.

@pergolafabio
Copy link

Will probably work, but it will break it for other users that are not using cariad?

@pergolafabio
Copy link

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

@Pastaloverzzz
Copy link

Pastaloverzzz commented Nov 12, 2024

@pergolafabio can you try: https://github.com/audiconnect/audi_connect_ha/releases/tag/v1.10.5a ?

It is tagged as pre-relase and might be also able to be downloaded via HACS.

It is working for me, with the Q4 2024 model.
For some reason HA says their is a update though, wich is 1.10.4. First time it gives a update warning for a previous version.

@Kolbi
Copy link
Contributor

Kolbi commented Nov 12, 2024

Will probably work, but it will break it for other users that are not using cariad?

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)

@pergolafabio
Copy link

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...

@Kolbi
Copy link
Contributor

Kolbi commented Nov 12, 2024

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.

@hjaltij
Copy link

hjaltij commented Nov 12, 2024

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.

@pergolafabio
Copy link

what are you driving ? also Q4 ? then the above should work if you are in same region?

@hjaltij
Copy link

hjaltij commented Nov 12, 2024

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 :)

@pergolafabio
Copy link

if you want, i can sniff it for you, you can give me for example your account with a temp password ... up to you
i'm on discord

@Kolbi
Copy link
Contributor

Kolbi commented Nov 12, 2024

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...

Need to check it when I have some time to do. But got the point. Was to fast C&P your adjustments.

@gomble
Copy link

gomble commented Dec 1, 2024

for the ones interested , i did an hardcode, changed file audi_services.py to this:

    async def set_climatisation(self, vin: str, start: bool):
        if start:
            data = '{ "targetTemperature": 23, "targetTemperatureUnit": "celsius", "climatisationWithoutExternalPower": true, "climatizationAtUnlock": false, "windowHeatingEnabled": true, "zoneFrontLeftEnabled": false, "zoneFrontRightEnabled": false, "zoneRearLeftEnabled": false,  "zoneRearRightEnabled": false }'
            headers = { "Authorization": "Bearer " + self._bearer_token_json["access_token"] }
            res = await self._api.request(
                "POST",
                "https://emea.bff.cariad.digital/vehicle/v1/vehicles/{vin}/climatisation/start".format(
                    vin=vin.upper(),
                ),
                headers=headers,
                data=data,
            ) 
        else:
            data = ''
            headers = { "Authorization": "Bearer " + self._bearer_token_json["access_token"] }
            res = await self._api.request(
                "POST",
                "https://emea.bff.cariad.digital/vehicle/v1/vehicles/{vin}/climatisation/stop".format(
                    vin=vin.upper(),
                ),
                headers=headers,
                data=data,
            )



        # checkUrl = "{homeRegion}/fs-car/bs/climatisation/v1/{type}/{country}/vehicles/{vin}/climater/actions/{actionid}".format(
            # homeRegion=await self._get_home_region(vin.upper()),
            # type=self._type,
            # country=self._country,
            # vin=vin.upper(),
            # actionid=res["action"]["actionId"],
        # )

        # await self.check_request_succeeded(
            # checkUrl,
            # "start climatisation" if start else "stop climatisation",
            # SUCCEEDED,
            # FAILED,
            # "action.actionState",
        # )

This does not work for me:

image

image

@pergolafabio
Copy link

This is only for Q4 models I think, also , maybe you are using another region?

@gomble
Copy link

gomble commented Dec 1, 2024

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
Is this not applicable?

@pergolafabio
Copy link

Yes, but you need to change the code manually, you url is still the old one if I look in your error log

@pergolafabio
Copy link

The code example above is also for the legacy climate start, not for the new service, there are 2 methods to start the clima

@pergolafabio
Copy link

Here is the code for the other clima start service....
#492

@gomble
Copy link

gomble commented Dec 1, 2024

The code example above is also for the legacy climate start, not for the new service, there are 2 methods to start the clima

I've only just noticed that there is another service.
this worked:

image

many thanks!!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working planned Planned fix or feature
Projects
None yet
Development

Successfully merging a pull request may close this issue.

8 participants