Document optional MQTT cover options (#17971)

* Document optional MQTT cover options

* Fix missing quote

Co-authored-by: Franck Nijhof <git@frenck.dev>

Co-authored-by: Franck Nijhof <git@frenck.dev>
This commit is contained in:
Shay Levy 2021-05-26 13:52:01 +03:00 committed by GitHub
parent a81fa58d6c
commit 7fef154549
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -422,6 +422,45 @@ cover:
{% endraw %}
### Configuration for disabling cover commands
The example below shows a configuration for a cover that does not have a close command.
Setting `payload_close` empty or to `null` disables the close command and will not show the close button.
{% raw %}
```yaml
# Example configuration.yaml entry
cover:
- platform: mqtt
payload_open: "on"
payload_close:
payload_stop: "on"
```
{% endraw %}
The following commands can be disabled: `open`, `close`, `stop` by overriding their payloads: `payload_open`, `payload_close`, `payload_stop`
For auto discovery message the payload needs to be set to `null`, example for cover without close command:
{% raw %}
```json
{
"cover": [
{
"platform": "mqtt",
"payload_open": "on",
"payload_close": null,
"payload_stop": "on"
}
]
}
```
{% endraw %}
### Testing your configuration
To test, you can use the command line tool `mosquitto_pub` shipped with `mosquitto` or the `mosquitto-clients` package to send MQTT messages. This allows you to operate your cover manually:
```bash