mirror of
https://github.com/home-assistant/home-assistant.io.git
synced 2025-07-16 22:06:50 +00:00
Change MQTT topic names to something more generic (#6979)
* Change MQTT topic names to something more generic * Minor changes
This commit is contained in:
parent
a52f37c913
commit
2edea09daa
@ -33,7 +33,7 @@ state_topic:
|
|||||||
required: true
|
required: true
|
||||||
type: string
|
type: string
|
||||||
name:
|
name:
|
||||||
description: Name of the MQTT sensor.
|
description: The name of the MQTT sensor.
|
||||||
required: false
|
required: false
|
||||||
type: string
|
type: string
|
||||||
default: MQTT Sensor
|
default: MQTT Sensor
|
||||||
@ -47,7 +47,7 @@ unit_of_measurement:
|
|||||||
required: false
|
required: false
|
||||||
type: string
|
type: string
|
||||||
icon:
|
icon:
|
||||||
description: Icon for the sensor.
|
description: The icon for the sensor.
|
||||||
required: false
|
required: false
|
||||||
type: icon
|
type: icon
|
||||||
expire_after:
|
expire_after:
|
||||||
@ -99,18 +99,18 @@ In this section you find some real-life examples of how to use this sensor.
|
|||||||
|
|
||||||
### {% linkable_title JSON attributes configuration %}
|
### {% linkable_title JSON attributes configuration %}
|
||||||
|
|
||||||
The example sensor below shows a configuration example which uses JSON in the state 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 JSON in the state 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 %}.
|
||||||
|
|
||||||
{% raw %}
|
{% raw %}
|
||||||
```yaml
|
```yaml
|
||||||
# Example configuration.yaml entry
|
# Example configuration.yaml entry
|
||||||
sensor:
|
sensor:
|
||||||
- platform: mqtt
|
- platform: mqtt
|
||||||
name: "BS RSSI"
|
name: "RSSI"
|
||||||
state_topic: "HUISHS/BunnyShed/NodeHealthJSON"
|
state_topic: "home/sensor1/infojson"
|
||||||
unit_of_measurement: 'dBm'
|
unit_of_measurement: 'dBm'
|
||||||
value_template: "{{ value_json.RSSI }}"
|
value_template: "{{ value_json.RSSI }}"
|
||||||
availability_topic: "HUISHS/BunnyShed/status"
|
availability_topic: "home/sensor1/status"
|
||||||
payload_available: "online"
|
payload_available: "online"
|
||||||
payload_not_available: "offline"
|
payload_not_available: "offline"
|
||||||
json_attributes:
|
json_attributes:
|
||||||
|
Loading…
x
Reference in New Issue
Block a user