From 9c2e57e72116041eb72ee2949f8eade45e6c8320 Mon Sep 17 00:00:00 2001 From: Erik Montnemery Date: Fri, 15 May 2020 19:31:18 +0200 Subject: [PATCH] Improve JSON attributes template example (#13382) --- source/_integrations/sensor.mqtt.markdown | 14 +++++++++----- 1 file changed, 9 insertions(+), 5 deletions(-) diff --git a/source/_integrations/sensor.mqtt.markdown b/source/_integrations/sensor.mqtt.markdown index a8c67ec2689..cfe318e7b1d 100644 --- a/source/_integrations/sensor.mqtt.markdown +++ b/source/_integrations/sensor.mqtt.markdown @@ -130,7 +130,9 @@ In this section you find some real-life examples of how to use this sensor. ### 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 `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 %}. +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 @@ -150,7 +152,9 @@ sensor: ### JSON attributes template configuration -The example sensor below shows a configuration example which uses a JSON dict: `{"Timer1":{"Arm": , "Time":