Skip to content

Commit 3ce673a

Browse files
committed
Add cover open/close all
1 parent 59f957f commit 3ce673a

File tree

3 files changed

+63
-4
lines changed

3 files changed

+63
-4
lines changed

scripts/cover_close_all.yml

+28
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
alias: Close all covers
2+
sequence:
3+
- repeat:
4+
sequence:
5+
- service: cover.close_cover
6+
metadata: {}
7+
data: {}
8+
target:
9+
entity_id: "{{ repeat.item }}"
10+
- if:
11+
- condition: template
12+
value_template: "{{ repeat.index % 5 == 0 }}"
13+
then:
14+
- delay:
15+
hours: 0
16+
minutes: 0
17+
seconds: 0
18+
milliseconds: 200
19+
for_each: >-
20+
[
21+
{% for cover in states.cover | map(attribute='entity_id') | list -%}
22+
{% if state_attr(cover, 'entity_id') == None and (state_attr(cover, 'current_position') > 0 or state_attr(cover, 'current_tilt_position') > 0) -%}
23+
'{{ cover }}',
24+
{% endif -%}
25+
{% endfor %}
26+
]
27+
description: ""
28+
icon: mdi:blinds-horizontal-closed

scripts/cover_open_all.yml

+28
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
alias: Open all covers
2+
sequence:
3+
- repeat:
4+
sequence:
5+
- service: cover.open_cover
6+
metadata: {}
7+
data: {}
8+
target:
9+
entity_id: "{{ repeat.item }}"
10+
- if:
11+
- condition: template
12+
value_template: "{{ repeat.index % 5 == 0 }}"
13+
then:
14+
- delay:
15+
hours: 0
16+
minutes: 0
17+
seconds: 0
18+
milliseconds: 200
19+
for_each: >-
20+
[
21+
{% for cover in states.cover | map(attribute='entity_id') | list -%}
22+
{% if state_attr(cover, 'entity_id') == None and (state_attr(cover, 'current_position') < 100 or state_attr(cover, 'current_tilt_position') < 100) -%}
23+
'{{ cover }}',
24+
{% endif -%}
25+
{% endfor %}
26+
]
27+
description: ""
28+
icon: mdi:blinds-horizontal

scripts/lights_off.yml

+7-4
Original file line numberDiff line numberDiff line change
@@ -17,9 +17,12 @@ sequence:
1717
seconds: 0
1818
milliseconds: 200
1919
for_each: >-
20-
[ {% for light in states.light | map(attribute='entity_id') |
21-
select('is_state', 'on') | list -%} {% if state_attr(light, 'entity_id')
22-
== None and not is_state_attr(light, 'type', 'browser_mod') -%} '{{
23-
light }}', {% endif -%} {% endfor %} ]
20+
[
21+
{% for light in states.light | map(attribute='entity_id') | select('is_state', 'on') | list -%}
22+
{% if state_attr(light, 'entity_id') == None and not is_state_attr(light, 'type', 'browser_mod') -%}
23+
'{{ light }}',
24+
{% endif -%}
25+
{% endfor %}
26+
]
2427
description: ""
2528
icon: mdi:lightbulb-off-outline

0 commit comments

Comments
 (0)