You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: source/_components/cover.template.markdown
+8-23Lines changed: 8 additions & 23 deletions
Original file line number
Diff line number
Diff line change
@@ -13,12 +13,9 @@ ha_iot_class: "Local Push"
13
13
logo: home-assistant.png
14
14
---
15
15
16
-
The `template` platform can create covers that combine components and provides
17
-
the ability to run scripts or invoke services for each of the open, close,
18
-
stop, position, and tilt commands of a cover.
16
+
The `template` platform can create covers that combine components and provides the ability to run scripts or invoke services for each of the open, close, stop, position, and tilt commands of a cover.
19
17
20
-
To enable Template Covers in your installation, add the following to your
21
-
`configuration.yaml` file:
18
+
To enable Template Covers in your installation, add the following to your `configuration.yaml` file:
22
19
23
20
{% raw %}
24
21
```yaml
@@ -87,12 +84,12 @@ cover:
87
84
optimistic:
88
85
description: Force cover position to use [optimistic mode](#optimistic-mode).
89
86
required: false
90
-
type: bool
87
+
type: boolean
91
88
default: false
92
89
tilt_optimistic:
93
90
description: Force cover tilt position to use [optimistic mode](#optimistic-mode).
94
91
required: false
95
-
type: bool
92
+
type: boolean
96
93
default: false
97
94
tilt_template:
98
95
description: Defines a template to get the tilt state of the cover. Legal values are numbers between `0` (closed) and `100` (open).
@@ -102,36 +99,24 @@ cover:
102
99
103
100
## {% linkable_title Considerations %}
104
101
105
-
If you are using the state of a platform that takes extra time to load, the
106
-
Template Cover may get an `unknown` state during startup. This results
107
-
in error messages in your log file until that platform has completed loading.
102
+
If you are using the state of a platform that takes extra time to load, the Template Cover may get an `unknown` state during startup. This results in error messages in your log file until that platform has completed loading.
108
103
If you use `is_state()` function in your template, you can avoid this situation.
109
104
For example, you would replace
110
105
{% raw %}`{{ states.switch.source.state == 'on' }}`{% endraw %}
111
-
with this equivalent that returns `true`/`false` and never gives an unknown
112
-
result:
106
+
with this equivalent that returns `true`/`false` and never gives an unknown result:
113
107
{% raw %}`{{ is_state('switch.source', 'on') }}`{% endraw %}
114
108
115
109
## {% linkable_title Optimistic Mode %}
116
110
117
-
In optimistic mode, the cover position state is maintained internally. This
118
-
mode is automatically enabled if neither [`value_template`](#value_template) or
119
-
[`position_template`](#position_template) are specified. Note that this is
120
-
unlikely to be very reliable without some feedback mechanism, since there is
121
-
otherwise no way to know if the cover is moving properly. The cover can be
122
-
forced into optimistic mode by using the [`optimistic`](#optimistic)
123
-
attribute. There is an equivalent mode for `tilt_position` that is enabled
124
-
when [`tilt_template`](#tilt_template) is not specified or when the
125
-
[`tilt_optimistic`](#tilt_optimistic) attribute is used.
111
+
In optimistic mode, the cover position state is maintained internally. This mode is automatically enabled if neither [`value_template`](#value_template) or [`position_template`](#position_template) are specified. Note that this is unlikely to be very reliable without some feedback mechanism, since there is otherwise no way to know if the cover is moving properly. The cover can be forced into optimistic mode by using the [`optimistic`](#optimistic) attribute. There is an equivalent mode for `tilt_position` that is enabled when [`tilt_template`](#tilt_template) is not specified or when the [`tilt_optimistic`](#tilt_optimistic) attribute is used.
126
112
127
113
## {% linkable_title Examples %}
128
114
129
115
In this section you will find some real life examples of how to use this cover.
130
116
131
117
### {% linkable_title Garage Door %}
132
118
133
-
This example converts a garage door with a controllable switch and position
134
-
sensor into a cover.
119
+
This example converts a garage door with a controllable switch and position sensor into a cover.
0 commit comments