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

@ -26,14 +26,6 @@ cover:
command_open: move_command up garage command_open: move_command up garage
command_close: move_command down garage command_close: move_command down garage
command_stop: move_command stop garage command_stop: move_command stop garage
command_state: state_command garage
value_template: {% raw %}>
{% if value == 'open' %}
100
{% elif value == 'closed' %}
0
{% endif %}
{% endraw %}
``` ```
Configuration variables: Configuration variables:
@ -46,3 +38,28 @@ Configuration variables:
- **command_state** (*Optional*): If given, this will act as a sensor that runs in the background and updates the state of the cover. If the command returns a `0` the indicates the cover is fully closed, whereas a 100 indicates the cover is fully open. - **command_state** (*Optional*): If given, this will act as a sensor that runs in the background and updates the state of the cover. If the command returns a `0` the indicates the cover is fully closed, whereas a 100 indicates the cover is fully open.
- **value_template** (*optional - default: '{% raw %}{{ value }}{% endraw%}'*): if specified, `command_state` will ignore the result code of the command but the template evaluating will indicate the position of the cover. For example, if your `command_state` returns a string "open", using `value_template` as in the example config above will allow you to translate that into the valid state `100`. - **value_template** (*optional - default: '{% raw %}{{ value }}{% endraw%}'*): if specified, `command_state` will ignore the result code of the command but the template evaluating will indicate the position of the cover. For example, if your `command_state` returns a string "open", using `value_template` as in the example config above will allow you to translate that into the valid state `100`.
- **friendly_name** (*Optional*): The name used to display the cover in the frontend. - **friendly_name** (*Optional*): The name used to display the cover in the frontend.
## {% linkable_title Examples %}
In this section you find some real life examples of how to use this sensor.
### {% linkable_title Full configuration %}
```yaml
# Example configuration.yaml entry
cover:
- platform: command_line
covers:
garage_door:
command_open: move_command up garage
command_close: move_command down garage
command_stop: move_command stop garage
command_state: state_command garage
value_template: {% raw %}>
{% if value == 'open' %}
100
{% elif value == 'closed' %}
0
{% endif %}
{% endraw %}
```

View File

@ -9,8 +9,8 @@ sharing: true
footer: true footer: true
--- ---
Home Assistant can give you an interface to control covers such as Home Assistant can give you an interface to control covers such as rollershutters, blinds, and garage doors.
rollershutters and garage doors.
## {% linkable_title Services %} ## {% linkable_title Services %}
### {% linkable_title Cover control services %} ### {% linkable_title Cover control services %}

View File

@ -29,17 +29,6 @@ cover:
- platform: mqtt - platform: mqtt
state_topic: "home-assistant/cover" state_topic: "home-assistant/cover"
command_topic: "home-assistant/cover/set" 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: Configuration variables:
@ -52,14 +41,41 @@ Configuration variables:
- **payload_open** (*Optional*): The payload that opens the cover. Default is "UP" - **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_close** (*Optional*): The payload that closes the cover. Default is "DOWN"
- **payload_stop** (*Optional*): The payload that stops the rollershutter. default is "STOP" - **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" - **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`. - **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. - **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 In this section you find some real life examples of how to use this sensor.
$ mosquitto_pub -h 127.0.0.1 -t home-assistant/cover/set -m "PAYLOAD_CLOSE"
### {% 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"
``` ```

View File

@ -18,7 +18,8 @@ First you have to set up your [rfxtrx hub](/components/rfxtrx/).
### {% linkable_title Configuration %} ### {% linkable_title Configuration %}
##### Siemens/LightwaveRF ##### {% linkable_title Siemens/LightwaveRF %}
The easiest way to find your roller shutters is to add this to your `configuration.yaml`: The easiest way to find your roller shutters is to add this to your `configuration.yaml`:
```yaml ```yaml
@ -27,11 +28,9 @@ cover:
automatic_add: True automatic_add: True
``` ```
Launch your homeassistant and go the website (e.g http://localhost:8123). Launch your homeassistant and go the website (e.g http://localhost:8123). Push your remote and your device should be added.
Push your remote and your device should be added.
Once added it will show an ID (e.g `0b11000102ef9f210010f70`) and you can verify that it works from the frontend. Once added it will show an ID (e.g `0b11000102ef9f210010f70`) and you can verify that it works from the frontend. Then you should update your configuration to:
Then you should update your configuration to:
```yaml ```yaml
cover: cover:
@ -41,10 +40,12 @@ cover:
name: device_name name: device_name
``` ```
##### RFY ##### {% linkable_title RFY %}
The [RFXtrx433e](http://www.rfxcom.com/RFXtrx433E-USB-43392MHz-Transceiver/en) is required for RFY support, however it does not support receive for the RFY protocol - as such devices cannot be automatically added. Instead, configure the device in the [rfxmngr](http://www.rfxcom.com/downloads.htm) tool. Make a note of the assigned ID and Unit Code and then add a device to the configuration with the following id `071a0000[id][unit_code]`. Eg, if the id was `0a` `00` `01`, and the unit code was `01` then the fully qualified id would be `071a00000a000101`. The [RFXtrx433e](http://www.rfxcom.com/RFXtrx433E-USB-43392MHz-Transceiver/en) is required for RFY support, however it does not support receive for the RFY protocol - as such devices cannot be automatically added. Instead, configure the device in the [rfxmngr](http://www.rfxcom.com/downloads.htm) tool. Make a note of the assigned ID and Unit Code and then add a device to the configuration with the following id `071a0000[id][unit_code]`. Eg, if the id was `0a` `00` `01`, and the unit code was `01` then the fully qualified id would be `071a00000a000101`.
##### Common ##### {% linkable_title Common %}
Example configuration: Example configuration:
```yaml ```yaml
@ -63,6 +64,6 @@ cover:
Configuration variables: Configuration variables:
- **devices** (*Required*): A list of devices with their name to use in the frontend. - **devices** (*Required*): A list of devices with their name to use in the frontend.
- **automatic_add** (*Optional*): To enable the automatic addition of new roller shutters (Siemens/LightwaveRF only). - **automatic_add** (*Optional*): To enable the automatic addition of new covers (Siemens/LightwaveRF only).
- **signal_repetitions** (*Optional*): Because the rxftrx device sends its actions via radio and from most receivers it's impossible to know if the signal was received or not. Therefore you can configure the roller shutter to try to send each signal repeatedly. - **signal_repetitions** (*Optional*): Because the rxftrx device sends its actions via radio and from most receivers it's impossible to know if the signal was received or not. Therefore you can configure the roller shutter to try to send each signal repeatedly.
- **fire_event** (*Optional*): Fires an event even if the state is the same as before. Can be used for automations. - **fire_event** (*Optional*): Fires an event even if the state is the same as before. Can be used for automations.

View File

@ -19,7 +19,7 @@ It uses two pins on the Raspberry Pi.
- The `state_pin` will detect if the cover is closed, and - The `state_pin` will detect if the cover is closed, and
- the `relay_pin` will trigger the cover to open or close. - the `relay_pin` will trigger the cover to open or close.
Although you do not need Andrews Hilliday's software controller when you run Home Assistant, he has written clear instructions on how to hook your garage door & sensors up to your Raspberry Pi, which can be found [here](https://github.com/andrewshilliday/garage-door-controller#hardware-setup). Although you do not need Andrews Hilliday's software controller when you run Home Assistant, he has written clear instructions on how to hook your garage door and sensors up to your Raspberry Pi, which can be found [here](https://github.com/andrewshilliday/garage-door-controller#hardware-setup).
To enable Raspberry Pi Covers in your installation, add the following to your `configuration.yaml` file: To enable Raspberry Pi Covers in your installation, add the following to your `configuration.yaml` file:
@ -27,12 +27,9 @@ To enable Raspberry Pi Covers in your installation, add the following to your `c
# Example configuration.yaml entry # Example configuration.yaml entry
cover: cover:
platform: rpi_gpio platform: rpi_gpio
state_pull_mode: DOWN
relay_time: 1
covers: covers:
- relay_pin: 10 - relay_pin: 10
state_pin: 11 state_pin: 11
name: 'Left door'
- relay_pin: 12 - relay_pin: 12
state_pin: 13 state_pin: 13
name: 'Right door' name: 'Right door'