updating documentation for mqtt cover

This commit is contained in:
Brian Cribbs 2017-04-28 13:14:20 -04:00
parent 05bfeb3e03
commit 5bb498db03

34
source/_components/cover.mqtt.markdown Normal file → Executable file
View File

@ -46,11 +46,39 @@ Configuration variables:
- **qos** (*Optional*): The maximum QoS level of the state topic. Default is `0`. Will also be used when publishing messages.
- **retain** (*Optional*): If the published message should have the retain flag on or not. Default is `false`.
- **value_template** (*Optional*): Defines a [template](/topics/templating/) to extract a value from the payload.
- **tilt_command_topic** (*Optional*): The MQTT topic to publish commands to control the cover tilt.
- **tilt_status_topic** (*Optional*): The MQTT topic subscribed to receive tilt status update values.
- **tilt_min** (*Optional*): The minimum tilt value. Default is `0`
- **tilt_max** (*Optional*): The maximum tilt value. Default is `100`
- **tilt_closed_value** (*Optional*): The value that will be sent on a `close_cover_tilt` command. Default is `0`
- **tilt_opened_value** (*Optional*): The value that will be sent on an `open_cover_tilt` command. Default is `100`
## {% linkable_title Examples %}
In this section you find some real life examples of how to use this sensor.
### {% linkable_title Full configuration without tilt %}
The example below shows a full configuration for a cover without tilt.
```yaml
# Example configuration.yml entry
cover:
- platform: mqtt
state_topic: "home-assistant/cover"
command_topic: "home-assistant/cover/set"
name: "MQTT Cover"
qos: 0
retain: true
payload_open: "OPEN"
payload_close: "CLOSE"
payload_stop: "STOP"
state_open: "OPEN"
state_closed: "STATE"
optimistic: false
value_template: '{% raw %}{{ value.x }}{% endraw %}'
```
### {% linkable_title Full configuration %}
The example below shows a full configuration for a cover.
@ -71,6 +99,12 @@ cover:
state_closed: "STATE"
optimistic: false
value_template: '{% raw %}{{ value.x }}{% endraw %}'
tilt_command_topic: ''
tilt_status_topic: ''
tilt_min: '0'
tilt_max: '180'
tilt_closed_value: '70'
tilt_opened_value: '180'
```
For a check you can use the command line tools `mosquitto_pub` shipped with `mosquitto` to send MQTT messages. This allows you to operate your cover manually: