audiconnect / audi_connect_ha

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

Enhancement Request: Climate Temperature, Glass Surface Heating & Seat Heaters #303

Closed coreywillwhat closed 5 months ago

coreywillwhat commented 5 months ago

Background

After extensive debugging, I've managed to customize the start_climatisation service call for my Audi, allowing for hard-coded control over temperature settings, glass surface heating, and individual seat heaters. This discovery enables a more personalized climate control experience directly from the code.

Current Implementation

Currently, adjustments are made by directly modifying the service call within the audi_services.py file, specifically on line 547. The original line of code is:

data = '{"action":{"type": "startClimatisation","settings": {"targetTemperature": 2941,"climatisationWithoutHVpower": true,"heaterSource": "electric","climaterElementSettings": {"isClimatisationAtUnlock": false, "isMirrorHeatingEnabled": true,}}}}'

Proposed Enhancement

I have successfully modified the code to enable front seat heaters as well, showcasing the potential for variable control:

data = '{"action":{"type": "startClimatisation", "settings": {"targetTemperature": 2941, "climatisationWithoutHVpower": true, "heaterSource": "electric", "climaterElementSettings": {"isClimatisationAtUnlock": false, "isMirrorHeatingEnabled": true, "zoneSettings": {"zoneSetting": [{"value": {"isEnabled": true, "position": "frontLeft"}}, {"value": {"isEnabled": true, "position": "frontRight"}}, {"value": {"isEnabled": false, "position": "rearLeft"}}, {"value": {"isEnabled": false, "position": "rearRight"}}]}}}}}'

Details on Controllable Features

Enhancement Request

Would it be possible to pass variables for temperature, glass surface heating, and seat comfort settings along with the VIN and action in the start_climatisation service call? Ideally, the service would use default values if none are provided. The variables could include:

This enhancement would greatly increase the usability and flexibility of the Audi services integration, allowing users to control these settings directly from the Home Assistant front end.

cdnninja commented 5 months ago

Would this be something you could create a PR for?

coreywillwhat commented 5 months ago

My knowledge is pretty limited past this point. Not sure where to start to pull the values from the front end service call. I can give it a shot, but it will take me a lot of time and testing. I'll work on it, but wanted to put my findings out there if someone else can get to it first.

coreywillwhat commented 5 months ago

Would this be something you could create a PR for?

I think I've done it. Won't be able to test on my vehicle until tomorrow. Will report back after testing.

coreywillwhat commented 5 months ago

Would this be something you could create a PR for?

Tested, working, and submitted pull request. Apologies for the absolute nightmare of commits. I've never used the github process before. Let me know if you need me to submit a different way or change anything.

coreywillwhat commented 5 months ago

Will be implemented with #306