-
-
Notifications
You must be signed in to change notification settings - Fork 13
Home assistant sensors
andreasd edited this page Nov 21, 2023
·
1 revision
Please find here some example sensors that can easily be added to home assistant.
This assumes that home assistant has an mqtt broker setup and connected.
Add the mqtt section to your configuration.yaml
:
mqtt: !include mqtt.yaml
Create the file "mqtt.yaml" and adapt the following code to your needs.
You need to add the VIN of your car (replace the whole [YOUR_VIN] in the code below) and can use MQTT Explorer (free for windows, mac and linux) to see what topics your MQTT broker receives. Those sensors are tested and setup with an eGolf but should be available universally and can be used as a starting point for further additions.
sensor:
- name: "eGolf battery level"
unique_id: egolf_battery
state_topic: "weconnect/0/vehicles/[YOUR_VIN]/domains/charging/batteryStatus/currentSOC_pct"
unit_of_measurement: "%"
device_class: "battery"
- name: "eGolf range"
unique_id: egolf_range
device_class: "distance"
state_topic: "weconnect/0/vehicles/[YOUR_VIN]/domains/fuelStatus/rangeStatus/primaryEngine/remainingRange_km"
unit_of_measurement: "km"
- name: "eGolf odometer"
unique_id: egolf_odometer
device_class: "distance"
state_topic: "weconnect/0/vehicles/[YOUR_VIN]/domains/measurements/odometerStatus/odometer"
unit_of_measurement: "km"
- name: "eGolf charge time left"
unique_id: egolf_chrgtime
device_class: "duration"
state_topic: "weconnect/0/vehicles/[YOUR_VIN]/domains/charging/chargingStatus/remainingChargingTimeToComplete_min"
unit_of_measurement: "min"
- name: "eGolf plug connection"
unique_id: egolf_plug_connection
state_topic: "weconnect/0/vehicles/[YOUR_VIN]/domains/charging/plugStatus/plugConnectionState"
- name: "eGolf plug lock"
unique_id: egolf_plug
state_topic: "weconnect/0/vehicles/[YOUR_VIN]/domains/charging/plugStatus/plugLockState"
- name: "eGolf plug external power"
unique_id: egolf_plug_external_power
state_topic: "weconnect/0/vehicles/[YOUR_VIN]/domains/charging/plugStatus/externalPower"
- name: "eGolf door lock"
unique_id: egolf_door
state_topic: "weconnect/0/vehicles/[YOUR_VIN]/domains/access/accessStatus/doorLockStatus"
- name: "eGolf access overall"
unique_id: egolf_access_overall
state_topic: "weconnect/0/vehicles/[YOUR_VIN]/domains/access/accessStatus/overallStatus"
- name: "eGolf door bonnet lock"
unique_id: egolf_door_bonnet
state_topic: "weconnect/0/vehicles/[YOUR_VIN]/domains/access/accessStatus/doors/bonnet/lockState"
- name: "eGolf door bonnet open"
unique_id: egolf_door_bonnet_open
state_topic: "weconnect/0/vehicles/[YOUR_VIN]/domains/access/accessStatus/doors/bonnet/openState"
- name: "eGolf door frontLeft lock"
unique_id: egolf_door_frontLeft
state_topic: "weconnect/0/vehicles/[YOUR_VIN]/domains/access/accessStatus/doors/frontLeft/lockState"
- name: "eGolf door frontLeft open"
unique_id: egolf_door_frontLeft_open
state_topic: "weconnect/0/vehicles/[YOUR_VIN]/domains/access/accessStatus/doors/frontLeft/openState"
- name: "eGolf door frontRight lock"
unique_id: egolf_door_frontRight
state_topic: "weconnect/0/vehicles/[YOUR_VIN]/domains/access/accessStatus/doors/frontRight/lockState"
- name: "eGolf door frontRight open"
unique_id: egolf_door_frontRight_open
state_topic: "weconnect/0/vehicles/[YOUR_VIN]/domains/access/accessStatus/doors/frontRight/openState"
- name: "eGolf door rearLeft lock"
unique_id: egolf_door_rearLeft
state_topic: "weconnect/0/vehicles/[YOUR_VIN]/domains/access/accessStatus/doors/rearLeft/lockState"
- name: "eGolf door rearLeft open"
unique_id: egolf_door_rearLeft_open
state_topic: "weconnect/0/vehicles/[YOUR_VIN]/domains/access/accessStatus/doors/rearLeft/openState"
- name: "eGolf door rearRight lock"
unique_id: egolf_door_rearRight
state_topic: "weconnect/0/vehicles/[YOUR_VIN]/domains/access/accessStatus/doors/rearRight/lockState"
- name: "eGolf door rearRight open"
unique_id: egolf_door_rearRight_open
state_topic: "weconnect/0/vehicles/[YOUR_VIN]/domains/access/accessStatus/doors/rearRight/openState"
- name: "eGolf door trunk lock"
unique_id: egolf_door_trunk
state_topic: "weconnect/0/vehicles/[YOUR_VIN]/domains/access/accessStatus/doors/trunk/lockState"
- name: "eGolf door trunk open"
unique_id: egolf_door_trunk_open
state_topic: "weconnect/0/vehicles/[YOUR_VIN]/domains/access/accessStatus/doors/trunk/openState"
- name: "eGolf window frontLeft"
unique_id: egolf_window_frontLeft
state_topic: "weconnect/0/vehicles/[YOUR_VIN]/domains/access/accessStatus/windows/frontLeft/openState"
- name: "eGolf window frontRight"
unique_id: egolf_window_vehicles
state_topic: "weconnect/0/vehicles/[YOUR_VIN]/domains/access/accessStatus/windows/fronRight/openState"
- name: "eGolf window rearLeft"
unique_id: egolf_window_rearLeft
state_topic: "weconnect/0/vehicles/[YOUR_VIN]/domains/access/accessStatus/windows/rearLeft/openState"
- name: "eGolf window rearRight"
unique_id: egolf_window_rearRight
state_topic: "weconnect/0/vehicles/[YOUR_VIN]/domains/access/accessStatus/windows/rearRight/openState"
- name: "eGolf parking lat"
unique_id: egolf_parking_lat
state_topic: "weconnect/0/vehicles/[YOUR_VIN]/parking/parkingPosition/latitude"
- name: "eGolf parking lng"
unique_id: egolf_parking_lng
state_topic: "weconnect/0/vehicles/[YOUR_VIN]/parking/parkingPosition/longitude"
- name: "eGolf parking time"
unique_id: egolf_parking_time
device_class: "timestamp"
state_topic: "weconnect/0/vehicles/[YOUR_VIN]/parking/parkingPosition/carCapturedTimestamp"
switch:
- name: "eGolf charge"
unique_id: egolf_charging
optimistic: true
command_topic: "weconnect/0/vehicles/[YOUR_VIN]/controls/charging_writetopic"
state_topic: "weconnect/0/vehicles/[YOUR_VIN]/domains/charging/chargingStatus/chargingState"
state_on: "charging"
state_off: "readyForCharging"
state_off: "notReadyForCharging"
payload_on: "start"
payload_off: "stop"
- name: "eGolf AC"
unique_id: egolf_ac
optimistic: true
command_topic: "weconnect/0/vehicles/[YOUR_VIN]/controls/climatisation_writetopic"
state_topic: "weconnect/0/vehicles/[YOUR_VIN]/domains/climatisation/climatisationStatus/climatisationState"
state_on: "heat"
state_off: "off"
payload_on: "start"
payload_off: "stop"