audiconnect / audi_connect_ha

Adds an audi connect integration to home assistant
MIT License
243 stars 100 forks source link

Audi Q6 preheater missing #499

Open jojoac opened 1 week ago

jojoac commented 1 week ago

Describe the bug from time to time, the reported data from the car is not shown, all have unknown state. But I really miss the option to start the preheater. If possible, it would also be home-assistant_audiconnect_2024-11-22T15-13-25.287Z.log helpful to know is there is a service or update needed.

To Reproduce Steps to reproduce the behavior:

It is just not there nothing need to be done

Expected behavior at least, I would be happy if I could switch on the preheater. Nice would be to have the same option as in the app. setting the Mode Comfort or Economy. and if I would like to switch on the seat heating for all 4 seats.

Screenshots If applicable, add screenshots to help explain your problem.

Logfile attached

Your Vehicle Details Model: Audi Q6 e-tron

Year: 2024 Type (Electric): Region (EU/US/CA/CN): DE

home-assistant_audiconnect_2024-11-22T15-13-25.287Z.log

Pastaloverzzz commented 5 days ago

If you mean to start the climatisation manually you can try this in your yaml file.. It works for my Q4 2024.

The following is line 548 to 574. This is the fix from issue #450 I was lucky enough to download the beta that was cancelled again because it could break the climatisation for other models.

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

After that you can start climatisation via: tap_action: action: perform-action perform_action: audiconnect.execute_vehicle_action data: vin: XXXXXXYOUR-VIN-HEREXXXXX action: start_climatisation And stop: hold_action: action: perform-action perform_action: audiconnect.execute_vehicle_action data: vin: XXXXXXYOUR-VIN-HEREXXXXX action: stop_climatisation

You will have to change the yaml to change the settings for the climatisation though. Setting zoneFrontLeftEnabled/zoneFrontRightEnabled/zoneRearLeftEnabled/zoneRearRightEnabled to true enables the seat heating. is also set the "climatizationAtUnlock" to true so it heats when i unlock it. And also "climatisationWithoutExternalPower" to true so it also heats up without the car plugged in.

Still a big thanks to pergolafabio for sharing this code, it already helped me out a lot these colder days :)