From 57602f6faf3741d45f3a1fb94c5dc0c4ad33f8d7 Mon Sep 17 00:00:00 2001 From: PeteBa Date: Mon, 7 Dec 2020 12:31:35 +0000 Subject: [PATCH] MQTT tracker discovery (#15427) --- source/_docs/mqtt/discovery.markdown | 34 ++++++++++++++++++++++++++++ 1 file changed, 34 insertions(+) diff --git a/source/_docs/mqtt/discovery.markdown b/source/_docs/mqtt/discovery.markdown index c2246e8c3cb..cc7a014cd9c 100644 --- a/source/_docs/mqtt/discovery.markdown +++ b/source/_docs/mqtt/discovery.markdown @@ -12,6 +12,7 @@ Supported by MQTT discovery: - [Binary sensors](/integrations/binary_sensor.mqtt/) - [Cameras](/integrations/camera.mqtt/) - [Covers](/integrations/cover.mqtt/) +- [Device Trackers](/integrations/device_tracker.mqtt/) - [Device Triggers](/integrations/device_trigger.mqtt/) - [Fans](/integrations/fan.mqtt/) - [HVACs](/integrations/climate.mqtt/) @@ -405,3 +406,36 @@ Setting up a climate integration (heat only): "current_temp":"23.60", } ``` + +### Presence detection (device tracker) + +Setting up a device tracker: + +- Configuration topic: `homeassistant/device_tracker/paulus/config` +- Example configuration payload: + +```json +{ + "name":"Paulus", + "state_topic": "homeassistant/device_tracker/paulus/state", + "payload_home": "home", + "payload_not_home": "not_home", + "source_type": "bluetooth", + } +``` + +- State topic: `homeassistant/device_tracker/paulus/state` +- Example state payload: `home` or `not_home` or `location name` + +If the device supports gps co-ordinates then they can be sent to Home Assistant by specifying an attributes topic (i.e. "json_attributes_topic") in the configuration payload: + +- Attributes topic: `homeassistant/device_tracker/paulus/attributes` +- Example attributes payload: + +```json +{ + "latitude": 32.87336, + "longitude": -117.22743, + "gps_accuracy": 1.2, + } +```