Skip to content

Commit

Permalink
Update HA-MQTT.md
Browse files Browse the repository at this point in the history
  • Loading branch information
BigThunderSR authored Mar 27, 2024
1 parent 684c566 commit 322480b
Showing 1 changed file with 35 additions and 0 deletions.
35 changes: 35 additions & 0 deletions HA-MQTT.md
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down

0 comments on commit 322480b

Please sign in to comment.