Minimizing of the configuration sample (#1012)

This commit is contained in:
Fabian Affolter 2016-09-30 20:49:47 +02:00 committed by GitHub
parent 695f16c114
commit 53ab256231
5 changed files with 68 additions and 37 deletions

View file

@ -29,17 +29,6 @@ cover:
- platform: mqtt
state_topic: "home-assistant/cover"
command_topic: "home-assistant/cover/set"
name: "MQTT Sensor"
qos: 0
retain: true
payload_open: "PAYLOAD_OPEN"
payload_close: "PAYLOAD_CLOSE"
payload_stop: "PAYLOAD_STOP"
state_open: "STATE_OPEN"
state_closed: "STATE_CLOSED"
optimistic: false
retain: false
value_template: '{% raw %}{{ value.x }}{% endraw %}'
```
Configuration variables:
@ -52,14 +41,41 @@ Configuration variables:
- **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_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:
## {% linkable_title Examples %}
```bash
$ mosquitto_pub -h 127.0.0.1 -t home-assistant/cover/set -m "PAYLOAD_CLOSE"
In this section you find some real life examples of how to use this sensor.
### {% linkable_title Full configuration %}
The example below shows a full configuration for a cover.
```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
retain: false
value_template: '{% raw %}{{ value.x }}{% endraw %}'
```
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:
```bash
$ mosquitto_pub -h 127.0.0.1 -t home-assistant/cover/set -m "CLOSE"
```