-
Notifications
You must be signed in to change notification settings - Fork 4
/
scripts.yaml
107 lines (105 loc) · 3.09 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
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
livingroom_tv_power:
sequence:
- condition: state
entity_id: alarm_control_panel.home_alarm
state: pending
- delay: 00:00:01
- data: {}
entity_id: script.alarm_pending_sound
service: script.turn_on
mode: single
alias: alarm_pending_loop
alarm_pending_sound:
alias: alarm_pending_sound
mode: single
sequence:
- data:
volume_level: 0.1
entity_id: media_player.alarm
service: media_player.volume_set
- data:
media_content_id: http://192.168.1.79:8080/pending-beep.mp3
media_content_type: audio/mp4
entity_id: media_player.alarm
service: media_player.play_media
- delay: 00:00:03
- data: {}
entity_id: script.livingroom_tv_power
service: script.turn_on
alarm_triggered_loop:
alias: alarm_triggered_loop
mode: single
sequence:
- condition: state
entity_id: alarm_control_panel.home_alarm
state: triggered
- delay: 00:00:01
- data: {}
entity_id: script.alarm_triggered_sound
service: script.turn_on
alarm_triggered_sound:
alias: alarm_triggered_sound
mode: single
sequence:
- data: {}
entity_id: media_player.alarm
service: media_player.volume_up
- data:
media_content_id: http://192.168.1.79:8080/purge.m4a
media_content_type: audio/mp4
entity_id: media_player.alarm
service: media_player.play_media
- delay: 00:00:03
- data: {}
entity_id: script.alarm_triggered_loop
service: script.turn_on
increase_brightness:
alias: increase_brightness
sequence:
- service: light.turn_on
data:
entity_id: '{{ group }}'
brightness: "{% set b = state_attr(group, 'brightness') %} {% if b == None %}\n\
\ 15\n{% elif b < 20 %}\n 128\n{% elif b < 140 %}\n 255\n{% else %}\n \
\ 15\n{% endif %}\n"
mode: single
'1606902947169':
alias: lights_off_except
icon: mdi:home-lightbulb
fields:
exclude_lights:
description: Excluded lights as list
sequence:
- service: logbook.log
data_template:
entity_id: script.turn_off_lights
name: Exclude log
message: 'Turning of all lights except: {{ exclude_lights }}'
- service: light.turn_off
data_template:
entity_id: '{%- for device in states.light|rejectattr(''entity_id'',''in'',
exclude_lights )|rejectattr(''state'',''in'',''off'') %}{%- if loop.first
%}{%- else %}, {% endif %}{{ device.entity_id }}{%- if loop.last %}{% endif
%}{%- endfor %}
'
mode: single
switch_off_except:
alias: switch_off_except
sequence:
- service: logbook.log
data_template:
entity_id: script.turn_off_switch
name: Exclude log
message: 'Turning of all switches except: {{ exclude_switch }}'
- service: switch.turn_off
data_template:
entity_id: '{%- for device in states.switch|rejectattr(''entity_id'',''in'',
exclude_switches )|rejectattr(''state'',''in'',''off'') %}{%- if loop.first
%}{%- else %}, {% endif %}{{ device.entity_id }}{%- if loop.last %}{% endif
%}{%- endfor %}
'
icon: mdi:home-lightbulb
fields:
exclude_switches:
description: Excluded switches as list
mode: single