Added opening and closing states to the MQTT cover (#11905)

Updated the MQTT cover documentation with support for the opening and closing states.
This commit is contained in:
Rick 2020-02-03 11:09:19 +01:00 committed by GitHub
parent 857a14750b
commit 6de61ae1c9
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -12,8 +12,8 @@ The `mqtt` cover platform allows you to control an MQTT cover (such as blinds, a
## Configuration ## Configuration
The device state (`open` or `closed`) will be updated only after a new message is published on `state_topic` matching `state_open` or `state_closed`. If these messages are published with the `retain` flag set, the cover 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`. The device state (`open`, `opening`, `closed` or `closing`) will be updated only after a new message is published on `state_topic` matching `state_open`, `state_opening`, `state_closed` or `state_closing`. If these messages are published with the `retain` flag set, the cover 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`.
`state_topic` can only manage `state_open` and `state_closed`. No percentage positions etc. `state_topic` can only manage `state_open`, `state_opening`, `state_closed` and `state_closing`. No percentage positions etc.
For this purpose is `position_topic` which can set state of the cover and position. For this purpose is `position_topic` which can set state of the cover and position.
Default setting are 0 means the device is `closed` and all other intermediate positions means the device is `open`. Default setting are 0 means the device is `closed` and all other intermediate positions means the device is `open`.
@ -70,11 +70,21 @@ state_open:
required: false required: false
type: string type: string
default: open default: open
state_opening:
description: The payload that represents the opening state.
required: false
type: string
default: opening
state_closed: state_closed:
description: The payload that represents the closed state. description: The payload that represents the closed state.
required: false required: false
type: string type: string
default: closed default: closed
state_closing:
description: The payload that represents the closing state.
required: false
type: string
default: closing
position_topic: position_topic:
description: The MQTT topic subscribed to receive cover position messages. If `position_topic` is set `state_topic` is ignored. description: The MQTT topic subscribed to receive cover position messages. If `position_topic` is set `state_topic` is ignored.
required: false required: false
@ -242,7 +252,9 @@ cover:
payload_close: "CLOSE" payload_close: "CLOSE"
payload_stop: "STOP" payload_stop: "STOP"
state_open: "open" state_open: "open"
state_opening: "opening"
state_closed: "closed" state_closed: "closed"
state_closing: "closing"
payload_available: "online" payload_available: "online"
payload_not_available: "offline" payload_not_available: "offline"
optimistic: false optimistic: false
@ -297,7 +309,9 @@ cover:
payload_close: "CLOSE" payload_close: "CLOSE"
payload_stop: "STOP" payload_stop: "STOP"
state_open: "open" state_open: "open"
state_opening: "opening"
state_closed: "closed" state_closed: "closed"
state_closing: "closing"
payload_available: "online" payload_available: "online"
payload_not_available: "offline" payload_not_available: "offline"
optimistic: false optimistic: false