Update cover.mqtt.markdown

This commit is contained in:
John Arild Berentsen 2016-08-29 07:38:14 +02:00 committed by GitHub
parent 216f5a4d02
commit fad9cfa968

View File

@ -30,27 +30,31 @@ cover:
state_topic: "home-assistant/cover"
command_topic: "home-assistant/cover/set"
name: "MQTT Sensor"
optimistic: false
qos: 0
retain: true
payload_open: "PAYLOAD_OPEN"
payload_close: "PAYLOD__CLOSE"
payload_stop: "PAYLOAD_STOP"
state_open: "STATE_OPEN"
state_closed: "STATE_CLOSED"
service_open: "SERVICE_OPEN"
service_close: "SERVICE_CLOSE"
optimistic: false
retain: false
value_template: '{% raw %}{{ value.x }}{% endraw %}'
```
Configuration variables:
- **state_topic** (*Required*): The MQTT topic subscribed to receive sensor values.
- **command_topic** (*Required*): The MQTT topic to publish commands to control the rollershutter.
- **name** (*Optional*): The name of the sensor. Default is "MQTT Sensor".
- **state_open** (*Optional*): The payload that represents open state. Default is"STATE_OPEN"
- **state_closed** (*Optional*): The payload that represents closed state. Default is "STATE_CLOSED"
- **service_open** (*Optional*): The payload that represents open state in service mode. Default is"SERVICE_OPEN"
- **service_close** (*Optional*): The payload that represents closed state in service mode. Default is "SERVICE_CLOSE"
- **optimistic** (*Optional*): Flag that defines if switch works in optimistic mode. Default is `true` if no state topic defined, else `false`.
- **qos** (*Optional*): The maximum QoS level of the state topic. Default is 0 and will also be used to publishing messages.
- **retain** (*Optional*): If the published message should have the retain flag on or not.
- **payload_open** (*Optional*): The payload that opens the cover. Default is "UP"
- **payload_close** (*Optional*): The payload that closes the cover. Default is "DOWN"
- **payload_stop** (*Optional*): The payload that stops the rollershutter. default is "STOP"
- **state_open** (*Optional*): The payload that represents open state. Default is"STATE_OPEN"
- **state_closed** (*Optional*): The payload that represents closed state. Default is "STATE_CLOSED"
- **optimistic** (*Optional*): Flag that defines if switch works in optimistic mode. Default is `true` if no state topic defined, else `false`.
- **value_template** (*Optional*): Defines a [template](/topics/templating/) to extract a value from the payload.
For a quick check you can use the commandline tools shipped with `mosquitto` to send MQTT messages. Set the state of your sensor manually: