Skip to content

Commit 53ab256

Browse files
authored
Minimizing of the configuration sample (home-assistant#1012)
1 parent 695f16c commit 53ab256

File tree

5 files changed

+67
-36
lines changed

5 files changed

+67
-36
lines changed

source/_components/cover.command_line.markdown

Lines changed: 25 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -26,14 +26,6 @@ cover:
2626
command_open: move_command up garage
2727
command_close: move_command down garage
2828
command_stop: move_command stop garage
29-
command_state: state_command garage
30-
value_template: {% raw %}>
31-
{% if value == 'open' %}
32-
100
33-
{% elif value == 'closed' %}
34-
0
35-
{% endif %}
36-
{% endraw %}
3729
```
3830
3931
Configuration variables:
@@ -46,3 +38,28 @@ Configuration variables:
4638
- **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.
4739
- **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`.
4840
- **friendly_name** (*Optional*): The name used to display the cover in the frontend.
41+
42+
## {% linkable_title Examples %}
43+
44+
In this section you find some real life examples of how to use this sensor.
45+
46+
### {% linkable_title Full configuration %}
47+
48+
```yaml
49+
# Example configuration.yaml entry
50+
cover:
51+
- platform: command_line
52+
covers:
53+
garage_door:
54+
command_open: move_command up garage
55+
command_close: move_command down garage
56+
command_stop: move_command stop garage
57+
command_state: state_command garage
58+
value_template: {% raw %}>
59+
{% if value == 'open' %}
60+
100
61+
{% elif value == 'closed' %}
62+
0
63+
{% endif %}
64+
{% endraw %}
65+
```

source/_components/cover.markdown

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,8 +9,8 @@ sharing: true
99
footer: true
1010
---
1111

12-
Home Assistant can give you an interface to control covers such as
13-
rollershutters and garage doors.
12+
Home Assistant can give you an interface to control covers such as rollershutters, blinds, and garage doors.
13+
1414
## {% linkable_title Services %}
1515

1616
### {% linkable_title Cover control services %}

source/_components/cover.mqtt.markdown

Lines changed: 30 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -29,17 +29,6 @@ cover:
2929
- platform: mqtt
3030
state_topic: "home-assistant/cover"
3131
command_topic: "home-assistant/cover/set"
32-
name: "MQTT Sensor"
33-
qos: 0
34-
retain: true
35-
payload_open: "PAYLOAD_OPEN"
36-
payload_close: "PAYLOAD_CLOSE"
37-
payload_stop: "PAYLOAD_STOP"
38-
state_open: "STATE_OPEN"
39-
state_closed: "STATE_CLOSED"
40-
optimistic: false
41-
retain: false
42-
value_template: '{% raw %}{{ value.x }}{% endraw %}'
4332
```
4433
4534
Configuration variables:
@@ -52,14 +41,41 @@ Configuration variables:
5241
- **payload_open** (*Optional*): The payload that opens the cover. Default is "UP"
5342
- **payload_close** (*Optional*): The payload that closes the cover. Default is "DOWN"
5443
- **payload_stop** (*Optional*): The payload that stops the rollershutter. default is "STOP"
55-
- **state_open** (*Optional*): The payload that represents open state. Default is"STATE_OPEN"
44+
- **state_open** (*Optional*): The payload that represents open state. Default is "STATE_OPEN"
5645
- **state_closed** (*Optional*): The payload that represents closed state. Default is "STATE_CLOSED"
5746
- **optimistic** (*Optional*): Flag that defines if switch works in optimistic mode. Default is `true` if no state topic defined, else `false`.
5847
- **value_template** (*Optional*): Defines a [template](/topics/templating/) to extract a value from the payload.
5948

60-
For a quick check you can use the commandline tools shipped with `mosquitto` to send MQTT messages. Set the state of your sensor manually:
49+
## {% linkable_title Examples %}
50+
51+
In this section you find some real life examples of how to use this sensor.
52+
53+
### {% linkable_title Full configuration %}
54+
55+
The example below shows a full configuration for a cover.
56+
57+
```yaml
58+
# Example configuration.yml entry
59+
cover:
60+
- platform: mqtt
61+
state_topic: "home-assistant/cover"
62+
command_topic: "home-assistant/cover/set"
63+
name: "MQTT Cover"
64+
qos: 0
65+
retain: true
66+
payload_open: "OPEN"
67+
payload_close: "CLOSE"
68+
payload_stop: "STOP"
69+
state_open: "OPEN"
70+
state_closed: "STATE"
71+
optimistic: false
72+
retain: false
73+
value_template: '{% raw %}{{ value.x }}{% endraw %}'
74+
```
75+
76+
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:
6177

6278
```bash
63-
$ mosquitto_pub -h 127.0.0.1 -t home-assistant/cover/set -m "PAYLOAD_CLOSE"
79+
$ mosquitto_pub -h 127.0.0.1 -t home-assistant/cover/set -m "CLOSE"
6480
```
6581

source/_components/cover.rfxtrx.markdown

Lines changed: 9 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,8 @@ First you have to set up your [rfxtrx hub](/components/rfxtrx/).
1818

1919
### {% linkable_title Configuration %}
2020

21-
##### Siemens/LightwaveRF
21+
##### {% linkable_title Siemens/LightwaveRF %}
22+
2223
The easiest way to find your roller shutters is to add this to your `configuration.yaml`:
2324

2425
```yaml
@@ -27,11 +28,9 @@ cover:
2728
automatic_add: True
2829
```
2930
30-
Launch your homeassistant and go the website (e.g http://localhost:8123).
31-
Push your remote and your device should be added.
31+
Launch your homeassistant and go the website (e.g http://localhost:8123). Push your remote and your device should be added.
3232
33-
Once added it will show an ID (e.g `0b11000102ef9f210010f70`) and you can verify that it works from the frontend.
34-
Then you should update your configuration to:
33+
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:
3534

3635
```yaml
3736
cover:
@@ -41,10 +40,12 @@ cover:
4140
name: device_name
4241
```
4342

44-
##### RFY
43+
##### {% linkable_title RFY %}
44+
4545
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`.
4646

47-
##### Common
47+
##### {% linkable_title Common %}
48+
4849
Example configuration:
4950

5051
```yaml
@@ -63,6 +64,6 @@ cover:
6364
Configuration variables:
6465

6566
- **devices** (*Required*): A list of devices with their name to use in the frontend.
66-
- **automatic_add** (*Optional*): To enable the automatic addition of new roller shutters (Siemens/LightwaveRF only).
67+
- **automatic_add** (*Optional*): To enable the automatic addition of new covers (Siemens/LightwaveRF only).
6768
- **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.
6869
- **fire_event** (*Optional*): Fires an event even if the state is the same as before. Can be used for automations.

source/_components/cover.rpi_gpio.markdown

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -19,20 +19,17 @@ It uses two pins on the Raspberry Pi.
1919
- The `state_pin` will detect if the cover is closed, and
2020
- the `relay_pin` will trigger the cover to open or close.
2121

22-
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).
22+
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).
2323

2424
To enable Raspberry Pi Covers in your installation, add the following to your `configuration.yaml` file:
2525

2626
```yaml
2727
# Example configuration.yaml entry
2828
cover:
2929
platform: rpi_gpio
30-
state_pull_mode: DOWN
31-
relay_time: 1
3230
covers:
3331
- relay_pin: 10
3432
state_pin: 11
35-
name: 'Left door'
3633
- relay_pin: 12
3734
state_pin: 13
3835
name: 'Right door'

0 commit comments

Comments
 (0)