-
Notifications
You must be signed in to change notification settings - Fork 0
/
scripts.yaml
557 lines (552 loc) · 14.3 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
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
living_room_cardio_time:
alias: Living Room - Cardio Time
sequence:
- delay:
hours: 0
minutes: 0
seconds: 2
milliseconds: 0
- if:
- condition: state
entity_id: light.living_room_light
state: 'off'
then:
- action: light.turn_on
data:
brightness_pct: 100
target:
entity_id: light.living_room_light
- action: fan.turn_on
data:
percentage: 100
target:
entity_id:
- fan.living_room_air_purifier
- fan.living_room_fan
mode: single
ben_s_bedroom_all_devices_off:
alias: Ben's Bedroom - All Devices Off
sequence:
- data: {}
target:
area_id: ben_s_bedroom
action: light.turn_off
- data: {}
target:
area_id: ben_s_bedroom
action: media_player.turn_off
- action: select.select_option
metadata: {}
data:
option: Light Off
target:
entity_id: select.ben_s_bedroom_dehumidifier_light_mode
- data:
media_content_type: custom
media_content_id: Turn off Ben's Bedroom TV
action: media_player.play_media
target:
entity_id: media_player.ben_s_echo_dot
mode: single
home_alarm_arm_away:
alias: Home - Alarm - Arm Away
sequence:
- action: notify.alexa_media_last_called
data:
message: alexa.cannedtts.speak.curatedtts-category-goodbye/alexa.cannedtts.speak.curatedtts-random
data:
type: tts
target: last_called
- action: notify.alexa_media_last_called
data:
message: '"you have 30 seconds to exit, then I''ll arm the alarm"'
data:
type: tts
target: last_called
- delay:
hours: 0
minutes: 0
seconds: 30
milliseconds: 0
- action: alarm_control_panel.alarm_arm_away
data: {}
target:
entity_id: alarm_control_panel.home_alarm
mode: single
home_alexa_announce_dinner_time:
alias: Home - Alexa - Announce Dinner Time
sequence:
- data:
volume_level: 1
target:
entity_id:
- media_player.boys_echo_dot
action: media_player.volume_set
- repeat:
count: '3'
sequence:
- data:
data:
method: all
type: announce
message: It's dinner time. Dinner is ready!
target:
- Living Room Echo Dot
- Bedroom Echo Pop
- Boys' Echo Dot
action: notify.alexa_media
- delay:
hours: 0
minutes: 0
seconds: 20
milliseconds: 0
- data:
volume_level: 0.35
target:
entity_id: media_player.boys_echo_dot
action: media_player.volume_set
mode: single
bedroom_turn_on_bedside_lights:
alias: Bedroom - Lighting - Turn on Bedside Lights
sequence:
- action: light.turn_on
data:
brightness_pct: 10
target:
entity_id: light.bedside_lights
mode: single
home_dinner_details:
alias: Home - Dinner Details
sequence:
- action: alexa_media.update_last_called
data: {}
- if:
- condition: template
value_template: '{{ states.calendar.meals.state == ''on'' }}'
then:
- action: notify.alexa_media_last_called
data:
data:
type: tts
message: 'Today''s dinner is {{ state_attr(''calendar.meals'', ''message'')
}}''. ''{{ state_attr(''calendar.meals'', ''description'') }}
'
else:
- action: notify.alexa_media_last_called
data:
data:
type: tts
message: There's no dinner for you today! Ha ha ha!
mode: single
home_heating_room_boost:
alias: Home - Heating - Room Boost
sequence:
- data: {}
action: alexa_media.update_last_called
- choose:
- conditions:
- condition: state
entity_id: sensor.last_alexa
state: media_player.kitchen_echo_show
sequence:
- data:
temperature: 20
target:
entity_id: climate.wiser_kitchen
action: climate.set_temperature
- conditions:
- condition: state
entity_id: sensor.last_alexa
state: media_player.living_room_echo_dot
sequence:
- data:
temperature: 20
target:
entity_id: climate.wiser_living_room
action: climate.set_temperature
- conditions:
- condition: state
entity_id: sensor.last_alexa
state: media_player.bedroom_echo_pop
sequence:
- data:
temperature: 20
target:
entity_id: climate.wiser_bedroom
action: climate.set_temperature
- conditions:
- condition: state
entity_id: sensor.last_alexa
state: media_player.boys_echo_dot
sequence:
- data:
temperature: 20
target:
entity_id: climate.wiser_boys_bedroom
action: climate.set_temperature
- conditions:
- condition: state
entity_id: sensor.last_alexa
state: media_player.ben_s_echo_dot
sequence:
- data:
temperature: 20
target:
entity_id:
- climate.wiser_ben_s_bedroom
action: climate.set_temperature
- data:
data:
type: tts
message: I've boosted the heating in this room
action: notify.alexa_media_last_called
mode: single
home_tv_turn_on:
alias: Home - TV - Turn On
sequence:
- action: remote.turn_on
metadata: {}
data: {}
target:
entity_id:
- remote.living_room
- remote.bedroom
- data: {}
action: alexa_media.update_last_called
- delay:
hours: 0
minutes: 0
seconds: 5
milliseconds: 0
- choose:
- conditions:
- condition: state
entity_id: sensor.last_alexa
state: media_player.living_room_echo_dot
sequence:
- data: {}
target:
entity_id: media_player.living_room
action: media_player.turn_on
- conditions:
- condition: state
entity_id: sensor.last_alexa
state: media_player.bedroom_echo_pop
sequence:
- data: {}
action: media_player.turn_on
target:
entity_id: media_player.bedroom
- conditions:
- condition: state
entity_id: sensor.last_alexa
state: media_player.ben_s_echo_dot
sequence:
- data: {}
target:
entity_id: media_player.ben_s_bedroom_firetvstick
action: media_player.turn_on
mode: single
home_tv_turn_off:
alias: Home - TV - Turn Off
sequence:
- action: remote.turn_on
metadata: {}
data: {}
target:
entity_id:
- remote.bedroom
- remote.living_room
- data: {}
action: alexa_media.update_last_called
- delay:
hours: 0
minutes: 0
seconds: 5
milliseconds: 0
- choose:
- conditions:
- condition: state
entity_id: sensor.last_alexa
state: media_player.living_room_echo_dot
sequence:
- data: {}
target:
entity_id: media_player.living_room
action: media_player.turn_off
- conditions:
- condition: state
entity_id: sensor.last_alexa
state: media_player.bedroom_echo_pop
sequence:
- data: {}
action: media_player.turn_off
target:
entity_id: media_player.bedroom
- conditions:
- condition: state
entity_id: sensor.last_alexa
state: media_player.ben_s_echo_dot
sequence:
- data: {}
action: media_player.turn_off
target:
entity_id: media_player.ben_s_bedroom_firetvstick
- data:
media_content_type: custom
media_content_id: Turn off Ben's Bedroom TV
action: media_player.play_media
target:
entity_id: media_player.ben_s_echo_dot
mode: single
living_room_workout_time_apple_tv:
alias: Living Room - Workout Time Apple TV
sequence:
- if:
- condition: state
entity_id: light.living_room_light
state: 'off'
then:
- data:
brightness_pct: 100
target:
entity_id: light.living_room_light
action: light.turn_on
- data:
percentage: 100
target:
entity_id:
- fan.living_room_air_purifier
- fan.living_room_fan
action: fan.turn_on
- data:
num_repeats: 1
delay_secs: 0.4
hold_secs: 0
command: wakeup
target:
entity_id: remote.living_room
action: remote.send_command
- target:
entity_id:
- media_player.living_room
data: {}
action: media_player.turn_on
- delay:
hours: 0
minutes: 0
seconds: 15
milliseconds: 0
- data:
hold_secs: 0
command: top_menu
num_repeats: 2
delay_secs: 1
target:
entity_id: remote.living_room
action: remote.send_command
- action: media_player.select_source
metadata: {}
data:
source: Fitness
target:
entity_id: media_player.living_room
mode: single
home_open_windows:
alias: Home - Open Windows
sequence:
- action: alexa_media.update_last_called
data: {}
- choose:
- conditions:
- condition: state
entity_id: binary_sensor.all_windows
state: 'on'
sequence:
- action: notify.alexa_media_last_called
data:
data:
type: tts
message: 'Yes, these windows are open! {{ states | selectattr(''entity_id'',''in'',
state_attr(''binary_sensor.all_windows'',''entity_id'')) | selectattr(''state'',''eq'',''on'')
| map(attribute=''name'') | join(''. '') }}
'
- conditions:
- condition: state
entity_id: binary_sensor.all_windows
state: 'off'
sequence:
- action: notify.alexa_media_last_called
data:
data:
type: tts
message: 'There are no windows open.
'
mode: single
home_open_doors:
alias: Home - Open Doors
sequence:
- action: alexa_media.update_last_called
data: {}
- choose:
- conditions:
- condition: state
entity_id: binary_sensor.all_doors
state: 'on'
sequence:
- action: notify.alexa_media_last_called
data:
data:
type: tts
message: 'Yes, these doors are open! {{ states | selectattr(''entity_id'',''in'',
state_attr(''binary_sensor.all_doors'',''entity_id'')) | selectattr(''state'',''eq'',''on'')
| map(attribute=''name'') | join(''. '') }}
'
- conditions:
- condition: state
entity_id: binary_sensor.all_doors
state: 'off'
sequence:
- action: notify.alexa_media_last_called
data:
data:
type: tts
message: There are no doors open.
mode: single
home_dinner_details_tomorrow:
alias: Home - Dinner Details Tomorrow
sequence:
- action: alexa_media.update_last_called
data: {}
- action: calendar.get_events
data:
duration:
hours: 0
minutes: 0
seconds: 1
start_date_time: '{{ (now().date() + timedelta(days=1)).strftime("%Y-%m-%d")
}} 12:00:00'
target:
entity_id: calendar.meals
response_variable: mealTomorrow
- choose:
- conditions:
- condition: template
value_template: '{{ mealTomorrow[''calendar.meals''].events[0] | length !=
0 }}'
sequence:
- action: notify.alexa_media_last_called
data:
data:
type: tts
message: Tomorrow's dinner is {{ mealTomorrow['calendar.meals'].events[0].summary
}}, {{ mealTomorrow['calendar.meals'].events[0].description }}
- conditions:
- condition: template
value_template: '{{ mealTomorrow[''calendar.meals''].events[0] | length !=
0 }}'
sequence:
- action: notify.alexa_media_last_called
data:
data:
type: tts
message: There's no dinner for you tomorrow! Ha ha ha!
mode: single
utility_room_dishwasher_status:
alias: Utility Room - Dishwasher - Status
sequence:
- action: alexa_media.update_last_called
data: {}
- action: notify.alexa_media_last_called
data:
data:
type: tts
message: The dishwasher is {{ states('input_select.utility_room_dishwasher_status')
}}
mode: single
home_who_is_home:
alias: Home - Who Is Home
sequence:
- action: alexa_media.update_last_called
data: {}
- action: notify.alexa_media_last_called
data:
data:
type: tts
message: '{% if state_attr(''zone.home'', ''persons'') | count > 0 %} {% set
folks = expand(state_attr(''zone.home'', ''persons'')) | selectattr(''state'',''eq'',''home'')
| map(attribute=''name'') | list %} These people are at home. {% for folk
in folks %} {{ folk }}. {% endfor %} {% else %} There is nobody at home. {%
endif %}
'
mode: single
living_room_tv_volume_reset:
alias: Living Room - TV - Volume Reset
sequence:
- action: remote.turn_on
metadata: {}
data: {}
target:
entity_id: remote.living_room
- repeat:
sequence:
- repeat:
sequence:
- action: remote.send_command
metadata: {}
data:
command: volume_down
target:
entity_id: remote.living_room
- delay:
hours: 0
minutes: 0
seconds: 1
milliseconds: 0
while:
- condition: numeric_state
entity_id: media_player.living_room_tv
attribute: volume_level
above: 0.1
- repeat:
sequence:
- action: remote.send_command
metadata: {}
data:
command: volume_up
target:
entity_id: remote.living_room
- delay:
hours: 0
minutes: 0
seconds: 1
milliseconds: 0
while:
- condition: numeric_state
entity_id: media_player.living_room_tv
attribute: volume_level
below: 0.1
until:
- condition: numeric_state
entity_id: media_player.living_room_tv
attribute: volume_level
above: 0.09
below: 0.11
description: ''
home_alexa_announce_coffee_time:
alias: Home - Alexa - Announce Coffee Time
sequence:
- repeat:
count: '3'
sequence:
- data:
data:
method: all
type: announce
message: It's coffee time. Coffee is ready!
target:
- Living Room Echo Dot
- Bedroom Echo Pop
action: notify.alexa_media
mode: single
description: ''