diff --git a/source/_components/sensor.mqtt.markdown b/source/_components/sensor.mqtt.markdown index 382b4bc0762..e822867625d 100644 --- a/source/_components/sensor.mqtt.markdown +++ b/source/_components/sensor.mqtt.markdown @@ -24,6 +24,7 @@ sensor: name: "MQTT Sensor" qos: 0 unit_of_measurement: "°C" + ``` Configuration variables: diff --git a/source/_components/switch.mqtt.markdown b/source/_components/switch.mqtt.markdown index 717844d1849..24849333339 100644 --- a/source/_components/switch.mqtt.markdown +++ b/source/_components/switch.mqtt.markdown @@ -31,6 +31,7 @@ switch: payload_on: "ON" payload_off: "OFF" optimistic: false + state_format: ``` Configuration variables: @@ -42,6 +43,7 @@ Configuration variables: - **payload_on** (*Optional*): The payload that represents enabled state. Default is "ON". - **payload_off** (*Optional*): The payload that represents disabled state. Default is "OFF". - **optimistic** (*Optional*): Flag that defines if switch works in optimistic mode. Default is true if no state topic defined, else false. +- **state_format** (*Optional*): Value to parse.

Make sure that your topics match exact. `some-topic/` and `some-topic` are different topics.