mirror of
https://github.com/GeorgeSG/sarah.git
synced 2026-05-09 10:14:41 +00:00
Refactor cover using script
This commit is contained in:
@@ -1,14 +1,18 @@
|
|||||||
script:
|
script:
|
||||||
|
open_living_room_cover:
|
||||||
|
sequence:
|
||||||
|
- service: cover.set_cover_position
|
||||||
|
entity_id: cover.living_room
|
||||||
|
data:
|
||||||
|
position: "{{ position | default(80) }}"
|
||||||
|
|
||||||
toggle_living_room_cover:
|
toggle_living_room_cover:
|
||||||
sequence:
|
sequence:
|
||||||
- choose:
|
- choose:
|
||||||
- conditions: >
|
- conditions: >
|
||||||
{{ state_attr('cover.living_room', 'current_position') == 0 }}
|
{{ state_attr('cover.living_room', 'current_position') == 0 }}
|
||||||
sequence:
|
sequence:
|
||||||
- service: cover.set_cover_position
|
- service: script.open_living_room_cover
|
||||||
entity_id: cover.living_room
|
|
||||||
data:
|
|
||||||
position: 80
|
|
||||||
- conditions: >
|
- conditions: >
|
||||||
{{ state_attr('cover.living_room', 'current_position') >= 80 }}
|
{{ state_attr('cover.living_room', 'current_position') >= 80 }}
|
||||||
sequence:
|
sequence:
|
||||||
@@ -25,10 +29,7 @@ automation:
|
|||||||
platform: time
|
platform: time
|
||||||
at: "10:00:00"
|
at: "10:00:00"
|
||||||
action:
|
action:
|
||||||
- service: cover.set_cover_position
|
- service: script.open_living_room_cover
|
||||||
entity_id: cover.living_room
|
|
||||||
data:
|
|
||||||
position: 80
|
|
||||||
|
|
||||||
- alias: Cover · Living Room · Close after sunset
|
- alias: Cover · Living Room · Close after sunset
|
||||||
trigger:
|
trigger:
|
||||||
|
|||||||
@@ -52,11 +52,7 @@ script:
|
|||||||
after: sunrise
|
after: sunrise
|
||||||
- condition: sun
|
- condition: sun
|
||||||
before: sunset
|
before: sunset
|
||||||
- service: cover.set_cover_position
|
- service: script.open_living_room_cover
|
||||||
entity_id: cover.living_room
|
|
||||||
data:
|
|
||||||
position: 80
|
|
||||||
|
|
||||||
|
|
||||||
routine_coming_home_after_sunset:
|
routine_coming_home_after_sunset:
|
||||||
alias: Routine · Coming home · After sunset
|
alias: Routine · Coming home · After sunset
|
||||||
|
|||||||
@@ -26,11 +26,7 @@ script:
|
|||||||
- light.bed_led
|
- light.bed_led
|
||||||
- light.bedside
|
- light.bedside
|
||||||
|
|
||||||
- service: cover.set_cover_position
|
- service: script.open_living_room_cover
|
||||||
entity_id: cover.living_room
|
|
||||||
data:
|
|
||||||
position: 80
|
|
||||||
|
|
||||||
- service: script.shield_screensaver
|
- service: script.shield_screensaver
|
||||||
|
|
||||||
- condition: state
|
- condition: state
|
||||||
|
|||||||
@@ -33,9 +33,6 @@ automation:
|
|||||||
from: "off"
|
from: "off"
|
||||||
to: "on"
|
to: "on"
|
||||||
action:
|
action:
|
||||||
- service: cover.set_cover_position
|
- service: script.open_living_room_cover
|
||||||
entity_id: cover.living_room
|
|
||||||
data:
|
|
||||||
position: 80
|
|
||||||
- service: input_boolean.turn_on
|
- service: input_boolean.turn_on
|
||||||
entity_id: input_boolean.speech_notifications
|
entity_id: input_boolean.speech_notifications
|
||||||
|
|||||||
Reference in New Issue
Block a user