From 7fef154549987fd108c3accdcb033e56d9ad8ee9 Mon Sep 17 00:00:00 2001 From: Shay Levy Date: Wed, 26 May 2021 13:52:01 +0300 Subject: [PATCH] Document optional MQTT cover options (#17971) * Document optional MQTT cover options * Fix missing quote Co-authored-by: Franck Nijhof Co-authored-by: Franck Nijhof --- source/_integrations/cover.mqtt.markdown | 39 ++++++++++++++++++++++++ 1 file changed, 39 insertions(+) diff --git a/source/_integrations/cover.mqtt.markdown b/source/_integrations/cover.mqtt.markdown index 476982f3e6d..f1cf7e1c19b 100644 --- a/source/_integrations/cover.mqtt.markdown +++ b/source/_integrations/cover.mqtt.markdown @@ -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