Skip to content

Commit 8c7febb

Browse files
MrMepfabaff
authored andcommitted
New component: JSON MQTT Device Tracker (home-assistant#2416)
* New component: JSON MQTT Device Tracker * Update device_tracker.mqtt_json.markdown * Update device_tracker.mqtt_json.markdown * JSON keys have changed in dev PR * Update device_tracker.mqtt_json.markdown
1 parent e70e8b1 commit 8c7febb

File tree

1 file changed

+39
-0
lines changed

1 file changed

+39
-0
lines changed
Lines changed: 39 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,39 @@
1+
---
2+
layout: page
3+
title: "JSON MQTT Device Tracker"
4+
description: "Instructions how to use JSON MQTT to track devices in Home Assistant."
5+
date: 2017-04-12 20:41
6+
sidebar: true
7+
comments: false
8+
sharing: true
9+
footer: true
10+
logo: mqtt.png
11+
ha_category: Presence Detection
12+
ha_version: 0.44
13+
---
14+
15+
16+
The `mqtt_json` device tracker platform allows you to detect presence by monitoring an MQTT topic for new locations. To use this platform, you specify a unique topic for each device.
17+
18+
To use this device tracker in your installation, add the following to your `configuration.yaml` file:
19+
20+
```yaml
21+
# Example configuration.yaml entry
22+
device_tracker:
23+
- platform: mqtt
24+
devices:
25+
paulus_oneplus: location/paulus
26+
annetherese_n4: location/annetherese
27+
```
28+
29+
Configuration variables:
30+
31+
- **devices** (*Required*): List of devices with their topic.
32+
- **qos** (*Optional*): The QoS level of the topic.
33+
34+
This platform receives JSON formatted payloads containing GPS information, for example:
35+
```json
36+
{"longitude": 1.0,"gps_accuracy": 60,"latitude": 2.0,"battery_level": 99.9}
37+
```
38+
Where `longitude` is the longitude, `latitude` is the latitude, `gps_accuracy` is the accuracy in meters, `battery_level` is the current battery level of the device sending the update.
39+
`longitude` and `latitude` are required keys, `gps_accuracy` and `battery_level` are optional.

0 commit comments

Comments
 (0)