-
-
Notifications
You must be signed in to change notification settings - Fork 15
Autodiscovery commands for Home Assistant weconnect mqtt sensors
danielszilagyi edited this page Nov 20, 2023
·
3 revisions
Here is how to set up MQTT sensors for the most important metrics/controls in Home Assistant for a Volkswagen e-up!:
mosquitto_pub -r -h <BROKERIP> -u <MQTT_USER> -P <MQTT_PASSWORD> -p 1883 -t "homeassistant/sensor/eup_soc/config" -m '{"name": "e-up battery level", "device_class": "battery", "state_topic": "weconnect/vehicles/YOURCARVIN/domains/charging/batteryStatus/currentSOC_pct", "unique_id": "eup_soc", "unit_of_measurement": "%"}'
mosquitto_pub -r -h <BROKERIP> -u <MQTT_USER> -P <MQTT_PASSWORD> -p 1883 -t "homeassistant/sensor/eup_range/config" -m '{"name": "e-up range", "device_class": "distance", "state_topic": "weconnect/vehicles/YOURCARVIN/domains/fuelStatus/rangeStatus/primaryEngine/remainingRange_km", "unique_id": "eup_range", "unit_of_measurement": "km"}'
mosquitto_pub -r -h <BROKERIP> -u <MQTT_USER> -P <MQTT_PASSWORD> -p 1883 -t "homeassistant/sensor/eup_odo/config" -m '{"name": "e-up odometer", "device_class": "distance", "state_topic": "weconnect/vehicles/YOURCARVIN/domains/measurements/odometerStatus/odometer", "unique_id": "eup_odometer", "unit_of_measurement": "km"}'
mosquitto_pub -r -h <BROKERIP> -u <MQTT_USER> -P <MQTT_PASSWORD> -p 1883 -t "homeassistant/sensor/eup_chrgtime/config" -m '{"name": "e-up charging time left", "device_class": "duration", "state_topic": "weconnect/vehicles/YOURCARVIN/domains/charging/chargingStatus/remainingChargingTimeToComplete_min", "unique_id": "eup_chrgtime", "unit_of_measurement": "min"}'
mosquitto_pub -r -h <BROKERIP> -u <MQTT_USER> -P <MQTT_PASSWORD> -p 1883 -t "homeassistant/sensor/eup_inspection_kms/config" -m '{"name": "e-up next inspection due kms", "device_class": "distance", "state_topic": "weconnect/vehicles/YOURCARVIN/domains/vehicleHealthInspection/maintenanceStatus/inspectionDue_km", "unique_id": "eup_inspection_kms", "unit_of_measurement": "km"}'
mosquitto_pub -r -h <BROKERIP> -u <MQTT_USER> -P <MQTT_PASSWORD> -p 1883 -t "homeassistant/sensor/eup_inspection_days/config" -m '{"name": "e-up next inspection due days", "device_class": "duration", "state_topic": "weconnect/vehicles/YOURCARVIN/domains/vehicleHealthInspection/maintenanceStatus/inspectionDue_days", "unique_id": "eup_inspection_days", "unit_of_measurement": "d"}'
mosquitto_pub -r -h <BROKERIP> -u <MQTT_USER> -P <MQTT_PASSWORD> -p 1883 -t "homeassistant/switch/eup_charge/config" -m '{"name": "e-up Charge", "command_topic": "weconnect/vehicles/YOURCARVIN/controls/charging_writetopic", "state_topic": "weconnect/vehicles/YOURCARVIN/domains/charging/chargingStatus/chargingState", "optimistic": "true", "state_on": "charging", "state_off": "readyForCharging", "state_off": "notReadyForCharging", "payload_on": "start", "payload_off": "stop", "unique_id": "eup_charging"}'
mosquitto_pub -r -h <BROKERIP> -u <MQTT_USER> -P <MQTT_PASSWORD> -p 1883 -t "homeassistant/switch/eup_climatisation/config" -m '{"name": "e-up Climatisation", "command_topic": "weconnect/vehicles/YOURCARVIN/controls/climatisation_writetopic", "state_topic": "weconnect/vehicles/YOURCARVIN/domains/climatisation/climatisationStatus/climatisationState", "optimistic": "true", "state_on": "heat", "state_off": "off", "payload_on": "start", "payload_off": "stop", "unique_id": "eup_climatisation"}'
Please note that if this works, the WeConnect ID integration should also when the new models will be added in the integration code for Home Assistant.