From b8f43538fe4da38acef0cc9cd6b9f2f215eac9b5 Mon Sep 17 00:00:00 2001 From: alorente Date: Fri, 6 Dec 2024 23:01:18 +0100 Subject: [PATCH] Add missing discovery prefix on device tracker's MQTT topics (#36119) --- source/_integrations/device_tracker.mqtt.markdown | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/source/_integrations/device_tracker.mqtt.markdown b/source/_integrations/device_tracker.mqtt.markdown index 47346c4564f..b6f5ae80915 100644 --- a/source/_integrations/device_tracker.mqtt.markdown +++ b/source/_integrations/device_tracker.mqtt.markdown @@ -205,27 +205,27 @@ You can use the command line tool `mosquitto_pub` shipped with `mosquitto` or th To create the device_tracker: ```bash -mosquitto_pub -h 127.0.0.1 -t homeassistant/device_tracker/a4567d663eaf/config -m '{"state_topic": "a4567d663eaf/state", "name": "My Tracker", "payload_home": "home", "payload_not_home": "not_home"}' +mosquitto_pub -h 127.0.0.1 -t homeassistant/device_tracker/a4567d663eaf/config -m '{"state_topic": "homeassistant/device_tracker/a4567d663eaf/state", "name": "My Tracker", "payload_home": "home", "payload_not_home": "not_home"}' ``` To set the state of the device tracker to "home": ```bash -mosquitto_pub -h 127.0.0.1 -t a4567d663eaf/state -m 'home' +mosquitto_pub -h 127.0.0.1 -t homeassistant/device_tracker/a4567d663eaf/state -m 'home' ``` To set the state of the device tracker to a named location: ```bash -mosquitto_pub -h 127.0.0.1 -t a4567d663eaf/state -m 'location_name' +mosquitto_pub -h 127.0.0.1 -t homeassistant/device_tracker/a4567d663eaf/state -m 'location_name' ``` If the device supports GPS coordinates then they can be sent to Home Assistant by specifying an attributes topic (i.e. "json_attributes_topic") in the configuration payload: -- Attributes topic: `a4567d663eaf/attributes` +- Attributes topic: `homeassistant/device_tracker/a4567d663eaf/attributes` - Example attributes payload: -Example message to be received at topic `a4567d663eaf/attributes`: +Example message to be received at topic `homeassistant/device_tracker/a4567d663eaf/attributes`: ```json { @@ -238,7 +238,7 @@ Example message to be received at topic `a4567d663eaf/attributes`: To create the device_tracker with GPS coordinates support: ```bash -mosquitto_pub -h 127.0.0.1 -t homeassistant/device_tracker/a4567d663eaf/config -m '{"json_attributes_topic": "a4567d663eaf/attributes", "name": "My Tracker"}' +mosquitto_pub -h 127.0.0.1 -t homeassistant/device_tracker/a4567d663eaf/config -m '{"json_attributes_topic": "homeassistant/device_tracker/a4567d663eaf/attributes", "name": "My Tracker"}' ``` {% note %} @@ -250,7 +250,7 @@ Using `state_topic` is optional when using `json_attributes_topic` to determine To set the state of the device tracker to specific coordinates: ```bash -mosquitto_pub -h 127.0.0.1 -t a4567d663eaf/attributes -m '{"latitude": 32.87336, "longitude": -117.22743, "gps_accuracy": 1.2}' +mosquitto_pub -h 127.0.0.1 -t homeassistant/device_tracker/a4567d663eaf/attributes -m '{"latitude": 32.87336, "longitude": -117.22743, "gps_accuracy": 1.2}' ```