forked from basnijholt/home-assistant-config
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathscripts.yaml
202 lines (202 loc) · 5.35 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
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
start_speakers:
alias: Start speakers
description: Start a Spotify playlist on KEF speakers
fields:
volume:
description: Volume at which to play
example: '0.3'
source:
description: Which source to use on the speakers
example: Wifi
sequence:
- service: media_player.turn_on
entity_id: media_player.kef
- service: media_player.select_source
entity_id: media_player.kef
data_template:
source: '{{ source }}'
- wait_template: '{{ is_state("media_player.kef", "on") }}'
timeout: 00:01:00
continue_on_timeout: 'false'
- service: media_player.volume_set
entity_id: media_player.kef
data_template:
volume_level: '{{ volume }}'
start_spotify:
alias: Start Spotify
description: Start a Spotify playlist on KEF speakers
fields:
source:
description: The name of the speaker as it appears in Spotify
example: Sonos One
playlist:
description: The playlist URI from Spotify
example: 6rPTm9dYftKcFAfwyRqmDZ
sequence:
- service: homeassistant.update_entity
entity_id: media_player.spotify
- wait_template: '{{ source in state_attr("media_player.spotify", "source_list") }}'
timeout: 00:01:00
continue_on_timeout: 'false'
- service: media_player.select_source
entity_id: media_player.spotify
data_template:
source: '{{ source }}'
- service: spotify.play_playlist
data_template:
media_content_id: spotify:playlist:{{ playlist }}
random_song: true
- service: media_player.media_play
entity_id: media_player.spotify
cozy_lights_living_room:
alias: Set cozy lights in the living room
sequence:
- data:
entity_id: light.sphere_1
hs_color:
- 336.293
- 80.392
service: light.turn_on
- data:
entity_id: light.sphere_2
hs_color:
- 299.147
- 82.745
service: light.turn_on
- data:
entity_id: light.corner_living_room
hs_color:
- 26.667
- 88.235
service: light.turn_on
- data:
entity_id: light.ceiling_living_room
hs_color:
- 268.267
- 88.235
service: light.turn_on
- data:
entity_id: light.tv_led
hs_color:
- 26.725
- 89.804
service: light.turn_on
- service: input_select.select_option
entity_id: input_select.last_script_living_room
data:
option: script.cozy_lights_living_room
cozy_lights_bedroom:
alias: Set cozy lights in the bedroom
sequence:
- data:
entity_id: light.bamboo
hs_color:
- 299.72
- 83.922
service: light.turn_on
- data:
entity_id: light.philips_go
hs_color:
- 26.725
- 89.804
service: light.turn_on
- data:
entity_id: light.lampan
hs_color:
- 269.86
- 84.314
service: light.turn_on
- data:
entity_id: light.ceiling_bedroom
hs_color:
- 10.118
- 100
service: light.turn_on
- data:
entity_id: light.bed_led
hs_color:
- 10
- 100
service: light.turn_on
- service: input_select.select_option
entity_id: input_select.last_script_bedroom
data:
option: script.cozy_lights_bedroom
white_lights_living_room:
alias: Set white lights in the living room
sequence:
- service: light.turn_on
data:
entity_id:
- light.living_room_lights
color_temp: 366
- service: input_select.select_option
entity_id: input_select.last_script_living_room
data:
option: script.white_lights_living_room
white_lights_bedroom:
alias: Set white lights in the bedroom
sequence:
- data:
color_temp: 366
entity_id:
- light.bedroom_lights
service: light.turn_on
- service: input_select.select_option
entity_id: input_select.last_script_bedroom
data:
option: script.white_lights_bedroom
increase_brightness:
alias: Increase the brightness of a group of lights
fields:
group:
description: The group to apply the light increase to.
example: light.living_room_lights
sequence:
- service: light.turn_on
data_template:
entity_id: '{{ group }}'
brightness: "{% set b = state_attr(group, \"brightness\") %} {% if b == None\
\ %}\n 10\n{% elif b < 20 %}\n 128\n{% elif b < 140 %}\n 255\n{% else %}\n\
\ 10\n{% endif %}\n"
turn_off_everything:
alias: Turn off everything
sequence:
- service: light.turn_off
data:
transition: 4
entity_id:
- light.living_room_lights
- light.bedroom_lights
- service: media_player.turn_off
entity_id: media_player.kef
- service: media_player.turn_off
entity_id: media_player.bedroom_speakers
- service: media_player.turn_off
entity_id: media_player.tv
going_to_sleep:
alias: Going to sleep
sequence:
- entity_id: input_boolean.sleep_mode
service: input_boolean.turn_on
- service: script.turn_off_everything
next_colors:
alias: Change the colors of lights
fields:
input_select:
description: The input select that lists script names.
example: input_select.last_script_living_room
sequence:
- service: input_select.select_next
data_template:
entity_id: '{{ input_select }}'
- service_template: '{{ states(input_select) }}'
start_netflix:
alias: Start Netflix
sequence:
- entity_id: media_player.tv
service: media_player.turn_on
- data:
source: Netflix
entity_id: media_player.tv
service: media_player.select_source