From cdb4cfae6b0f3a1da9ca78e2945566fc3b8ab258 Mon Sep 17 00:00:00 2001 From: emontnemery Date: Sun, 27 Jan 2019 20:50:35 +0100 Subject: [PATCH] Update example for JSON attributes topic (#8299) --- source/_components/sensor.mqtt.markdown | 10 ++-------- 1 file changed, 2 insertions(+), 8 deletions(-) diff --git a/source/_components/sensor.mqtt.markdown b/source/_components/sensor.mqtt.markdown index 6275510999d..f065d0dd55d 100644 --- a/source/_components/sensor.mqtt.markdown +++ b/source/_components/sensor.mqtt.markdown @@ -132,7 +132,7 @@ In this section you find some real-life examples of how to use this sensor. ### {% linkable_title JSON attributes topic configuration %} -The example sensor below shows a configuration example which uses a JSON dict: `{"ClientName": , "IP": , "MAC": , "RSSI": , "HostName": , "ConnectedSSID": }` in a separate topic to add extra attributes. It also makes use of the `availability` topic. Attributes can then be extracted in [Templates](/docs/configuration/templating/#attributes). For example, to extract the `ClientName` attribute from the sensor below, use a template similar to: {% raw %}`{{ state_attr('sensor.bs_rssi', 'ClientName') }}`{% endraw %}. +The example sensor below shows a configuration example which uses a JSON dict: `{"ClientName": , "IP": , "MAC": , "RSSI": , "HostName": , "ConnectedSSID": }` in a separate topic `home/sensor1/attributes` to add extra attributes. It also makes use of the `availability` topic. Extra attributes will be displayed in the frontend and can also be extracted in [Templates](/docs/configuration/templating/#attributes). For example, to extract the `ClientName` attribute from the sensor below, use a template similar to: {% raw %}`{{ state_attr('sensor.bs_rssi', 'ClientName') }}`{% endraw %}. {% raw %} ```yaml @@ -146,13 +146,7 @@ sensor: availability_topic: "home/sensor1/status" payload_available: "online" payload_not_available: "offline" - json_attributes: - - ClientName - - IP - - MAC - - RSSI - - HostName - - ConnectedSSID + json_attributes_topic: "home/sensor1/attributes" ``` {% endraw %}