-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathscripts.yaml
45 lines (45 loc) · 1.37 KB
/
scripts.yaml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
alarm_sound_loop:
alias: Alarm Triggered Sound Loop
sequence:
- condition: or
conditions:
- condition: state
entity_id: alarm_control_panel.alarm
state: triggered
- condition: state
entity_id: alarm_control_panel.alarm
state: pending
- service: script.turn_on
entity_id: script.alarm_sound
alarm_sound:
alias: Alarm Triggered Sound
sequence:
- service: media_player.volume_set
data:
entity_id: media_player.tablet3
volume_level: 0.2
- service: media_player.play_media
data:
entity_id: media_player.tablet3
media_content_type: music
data_template:
media_content_id: '{% if is_state(''alarm_control_panel.alarm'',''pending'')
%}https://linux.garden/local/alarm_beep.mp3{% elif is_state(''alarm_control_panel.alarm'',''triggered'')
%}https://linux.garden/local/alarm_beep.mp3{% endif %}'
- delay:
seconds: '{% if is_state(''alarm_control_panel.alarm'',''pending'') %}2{% elif
is_state(''alarm_control_panel.alarm'',''triggered'') %}2{% endif %}'
- service: script.turn_on
entity_id: script.alarm_sound_loop
mode: single
reset_reminder:
alias: Reset Reminder
mode: single
variables:
dagen: 3
sequence:
- service: input_datetime.set_datetime
data:
datetime: '{{ now() + timedelta(days=dagen) }}'
target:
entity_id: '{{ entity_id }}'