From 322480b2c9f3b7a1b094fd3578728c40ea8ac076 Mon Sep 17 00:00:00 2001 From: BigThunderSR <17056173+BigThunderSR@users.noreply.github.com> Date: Wed, 27 Mar 2024 09:36:17 -0500 Subject: [PATCH] Update HA-MQTT.md --- HA-MQTT.md | 35 +++++++++++++++++++++++++++++++++++ 1 file changed, 35 insertions(+) diff --git a/HA-MQTT.md b/HA-MQTT.md index a6a83af4..19c14028 100644 --- a/HA-MQTT.md +++ b/HA-MQTT.md @@ -127,6 +127,41 @@ mqtt: device_class: timestamp ``` +### MQTT Command Status Monitor + +Create a MQTT sensor in Home Assistant for each command status you want to monitor. Below is an example for the getLocation command and other commands follow a similar format. + +```yaml +mqtt: + sensor: + - name: "Vehicle1 Location Command Status Message" + unique_id: vehicle1_location_command_status_message + availability_topic: homeassistant/YOUR_CAR_VIN/available + payload_available: "false" + payload_not_available: "true" + state_topic: "homeassistant/YOUR_VEHICLE_VIN/command/getLocation/state" + value_template: "{{ value_json.Command.error.message }}" + icon: mdi:message-alert +``` + +### MQTT Command Status Timestamp Monitor + +Create a MQTT sensor in Home Assistant for each command timestamp you want to monitor. Below is an example for the getLocation command and other commands follow a similar format. + +```yaml +mqtt: + sensor: + - name: "Vehicle1 Location Command Status Timestamp" + unique_id: vehicle1_location_command_status_timestamp + availability_topic: homeassistant/YOUR_CAR_VIN/available + payload_available: "false" + payload_not_available: "true" + state_topic: "homeassistant/YOUR_VEHICLE_VIN/command/getLocation/state" + value_template: "{{ value_json.completionTimestamp}}" + icon: mdi:calendar-clock + device_class: timestamp +``` + ### Automation Create an automation to update the location whenever the odometer changes, instead of on a time interval.