Mqtt binary sensor allow processing unavailable state (#21388)

This commit is contained in:
Jan Bouwhuis 2022-01-31 22:51:48 +01:00 committed by GitHub
parent 69abae8b9f
commit b4d3de2eb9
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -8,9 +8,9 @@ ha_iot_class: Configurable
ha_domain: mqtt
---
The `mqtt` binary sensor platform uses an MQTT message received to set the binary sensor's state to `on` or `off`.
The `mqtt` binary sensor platform uses an MQTT message received to set the binary sensor's state to `on`, `off` or `unknown`.
The state will be updated only after a new message is published on `state_topic` matching `payload_on` or `payload_off`. If these messages are published with the `retain` flag set,
The state will be updated only after a new message is published on `state_topic` matching `payload_on`, `payload_off` or `None`. If these messages are published with the `retain` flag set,
the binary sensor will receive an instant state update after subscription and Home Assistant will display the correct state on startup.
Otherwise, the initial state displayed in Home Assistant will be `unknown`.