Due to API changes it might be that currently not all functionality is given. Please open a issue to report the topics you are missing.
Due to time limitations this project is not actively maintained anymore. It will continue to work as long as Audi does not change the API again. However, I'm open to someone else taking the lead. If you would like to become a maintainer, please contact me.
The audiconnect
component provides an integration with the Audi Connect cloud service. It adds presence detection, sensors such as range, mileage, and fuel level, and provides car actions such as locking/unlocking and setting the pre-heater.
Note: Certain functions require special permissions from Audi, such as position update via GPS.
Credit for initial API discovery go to the guys at the ioBroker VW-Connect forum, who were able to figure out how the API and the PIN hashing works. Also some implementation credit to davidgiga1993 of the original AudiAPI Python package, on which some of this code is loosely based.
There are two ways this integration can be installed into Home Assistant.
The easiest and recommended way is to install the integration using HACS, which makes future updates easy to track and install.
Alternatively, installation can be done manually by copying the files in this repository into the custom_components
directory in the Home Assistant configuration directory:
custom_components
directory, create it.custom_components
directory, create a new directory called audiconnect
.custom_components/audiconnect/
directory in this repository into the audiconnect
directory.Configuration is done through the Home Assistant UI.
To add the integration, go to Settings ➤ Devices & Services ➤ Integrations, click ➕ Add Integration, and search for "Audi Connect".
username
password
S-PIN
region
scan_interval
Find configuration options under Settings ➤ Devices & Services ➤ Integrations ➤ Audi Connect ➤ Configure:
bool
): Toggle cloud updates at integration startup. Ideal for development or frequent HA restarts.bool
): Enable or disable active polling.int
): Defines polling frequency in minutes (minimum 15). Effective only if "Active Polling at Scan Interval" is enabled.Note: A Home Assistant restart is required for changes to take effect.
audiconnect.refresh_vehicle_data
Normal updates retrieve data from the Audi Connect cloud service, and don't interact directly with the vehicle. This service triggers an update request from the vehicle itself. When data is retrieved successfully, Home Assistant is automatically updated. The service requires a vehicle identification number (VIN) as a parameter.
vin
: The Vehicle Identification Number (VIN) of the Audi you want to control.audiconnect.refresh_cloud_data
This service triggers an update request from the cloud.
none
audiconnect.execute_vehicle_action
This service allows you to perform actions on your Audi vehicle, specified by the vehicle identification number (VIN) and the desired action.
vin
: The Vehicle Identification Number (VIN) of the Audi you want to control.action
: The specific action to perform on the vehicle. Available actions include:
lock
: Lock the vehicle.unlock
: Unlock the vehicle.start_climatisation
: Start the vehicle's climatisation system. (Legacy)stop_climatisation
: Stop the vehicle's climatisation system.start_charger
: Start charging the vehicle.start_timed_charger
: Start the vehicle's charger with a timer.stop_charger
: Stop charging the vehicle.start_preheater
: Start the vehicle's preheater system.stop_preheater
: Stop the vehicle's preheater system.start_window_heating
: Start heating the vehicle's windows.stop_window_heating
: Stop heating the vehicle's windows.To initiate the lock action for a vehicle with VIN WAUZZZ4G7EN123456
, use the following service call:
service: audiconnect.execute_vehicle_action
data:
vin: "WAUZZZ4G7EN123456"
action: "lock"
audiconnect.start_climate_control
This service allows you to start the climate control with options for temperature, glass surface heating, and auto seat comfort.
vin
: The Vehicle Identification Number (VIN) of the Audi you want to control.temp_f
(optional): Desired temperature in Fahrenheit. Default is 70
.temp_c
(optional): Desired temperature in Celsius. Default is 21
.glass_heating
(optional): Enable (True
) or disable (False
) glass heating. Default is False
.seat_fl
(optional): Enable (True
) or disable (False
) the front-left seat heater. Default is False
.seat_fr
(optional): Enable (True
) or disable (False
) the front-right seat heater. Default is False
.seat_rl
(optional): Enable (True
) or disable (False
) the rear-left seat heater. Default is False
.seat_rr
(optional): Enable (True
) or disable (False
) the rear-right seat heater. Default is False
.To start the climate control for a vehicle with VIN WAUZZZ4G7EN123456
with a temperature of 72°F, enable glass heating, and activate both front seat heaters, use the following service call:
service: audiconnect.start_climate_control
data:
vin: "WAUZZZ4G7EN123456"
temp_f: 72
glass_heating: True
seat_fl: True
seat_fr: True
temp_f
and temp_c
parameters are mutually exclusive. If both are provided, temp_f
takes precedence.temp_f
nor temp_c
is provided, the system defaults to 70°F or 21°C.Below is an example Dashboard (Lovelace) card illustrating some of the sensors this Home Assistant addon provides.
The card requires the following front end mods:
These mods can (like this integration) be installed using HACS.
The card uses the following code in ui-lovelace.yaml
(or wherever your Dashboard is configured).
- type: picture-elements
image: /local/pictures/audi_sq7.jpeg
style: |
ha-card {
border-radius: 10px;
border: solid 1px rgba(100,100,100,0.3);
box-shadow: 3px 3px rgba(0,0,0,0.4);
overflow: hidden;
}
elements:
- type: image
image: /local/pictures/cardbackK.png
style:
left: 50%
top: 90%
width: 100%
height: 60px
- type: icon
icon: mdi:car-door
entity: sensor.doors_trunk_sq7
tap_action: more_info
style: {color: white, left: 10%, top: 86%}
- type: state-label
entity: sensor.doors_trunk_sq7
style: {color: white, left: 10%, top: 95%}
- type: state-icon
entity: sensor.windows_sq7
tap_action: more_info
style: {color: white, left: 30%, top: 86%}
- type: state-label
entity: sensor.windows_sq7
style: {color: white, left: 30%, top: 95%}
- type: icon
icon: mdi:oil
entity: sensor.audi_sq7_oil_level
tap_action: more_info
style: {color: white, left: 50%, top: 86%}
- type: state-label
entity: sensor.audi_sq7_oil_level
style: {color: white, left: 50%, top: 95%}
- type: icon
icon: mdi:room-service-outline
entity: sensor.audi_sq7_service_inspection_time
tap_action: more_info
style: {color: white, left: 70%, top: 86%}
- type: state-label
entity: sensor.audi_sq7_service_inspection_time
style: {color: white, left: 70%, top: 95%}
- type: icon
icon: mdi:speedometer
entity: sensor.audi_sq7_mileage
tap_action: more_info
style: {color: white, left: 90%, top: 86%}
- type: state-label
entity: sensor.audi_sq7_mileage
style: {color: white, left: 90%, top: 95%}
- type: custom:circle-sensor-card
entity: sensor.audi_sq7_tank_level
max: 100
min: 0
stroke_width: 15
gradient: true
fill: '#aaaaaabb'
name: tank
units: ' '
font_style:
font-size: 1.0em
font-color: white
text-shadow: '1px 1px black'
style:
top: 5%
left: 80%
width: 4em
height: 4em
transform: none
- type: custom:circle-sensor-card
entity: sensor.audi_sq7_range
max: 630
min: 0
stroke_width: 15
gradient: true
fill: '#aaaaaabb'
name: range
units: ' '
font_style:
font-size: 1.0em
font-color: white
text-shadow: '1px 1px black'
style:
top: 5%
left: 5%
width: 4em
height: 4em
transform: none