-
-
Notifications
You must be signed in to change notification settings - Fork 3
/
scripts.yaml
569 lines (569 loc) · 16.1 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
558
559
560
561
562
563
564
565
566
567
568
569
announcement:
alias: Announcement
use_blueprint:
path: denysdovhan/announcement.yaml
input:
default_notifier: notify.notify
default_tts: tts.google_translate_uk
default_speaker:
- media_player.living_room_homepod
speaker_conditions:
- condition: state
entity_id: binary_sensor.someone_is_home
state: 'on'
- condition: state
entity_id: binary_sensor.do_not_disturb_family
state: 'off'
force_to_speak_conditions:
- condition: state
entity_id: binary_sensor.someone_is_home
state: 'on'
description: Generate random phrase, send notification and speak it out loud on
speakers
icon: mdi:bell
greeting:
alias: Greeting
sequence:
- action: media_player.turn_on
metadata: {}
data: {}
target:
entity_id: media_player.living_room_homepod
- action: conversation.process
data:
agent_id: conversation.ai_greeting
text: "Використовуй такі дані для персоналізації вітання: Денис знаходиться:
{{ states('person.denys') }}. {%- if states('sensor.home_denys_distance')
| int > 100 %}\n Денис за {{ states('sensor.home_denys_distance') }} метрів
від дому.\n{%- endif %}\nМаша знаходиться: home. {%- if states('sensor.home_maria_distance')
| int > 100 %}\n Маша за {{ states('sensor.home_maria_distance') }} метрів
від дому.\n{%- endif %} Кількість людей вдома: {{ states('zone.home') }}.
Сьогодні: {{ now() }}. Час: {{ now().time }}. Погода: {{ states('weather.forecast_fayna_town')
}}. Температура на вулиці: {{ state_attr('weather.forecast_fayna_town', 'temperature')
}}. Температура вдома: {{ states('sensor.home_temperature') }}. Електрика:
{{ states('binary_sensor.electricity') }} Повітряна тривога: {{ states('binary_sensor.alerts_kyiv_air')
}}\n"
response_variable: greeting
alias: Pass environment data-points to OpenAI agent
- action: tts.speak
metadata: {}
data:
cache: true
media_player_entity_id: media_player.living_room_homepod
message: '{{ greeting.response.speech.plain.speech }}'
target:
entity_id:
- tts.google_translate_uk
description: ''
icon: mdi:human-greeting
vacuum_go_to_bin:
alias: 'Vacuum: Go to Bin'
sequence:
- action: vacuum.send_command
data:
params:
- 22800
- 28300
command: app_goto_target
target:
device_id: 2dfb7e90db81c6927aa5e8c11eccc4d5
description: Sends vacuum cleaner to the location of a bin on a map
icon: mdi:delete
vacuum_go_out_from_garage:
alias: 'Vacuum: Access from Garage'
sequence:
- action: vacuum.send_command
data:
params:
- 18800
- 22200
command: app_goto_target
target:
device_id: 2dfb7e90db81c6927aa5e8c11eccc4d5
description: Sends vacuum cleaner to the location in front of its garage
icon: mdi:garage-open-variant
slowly_close_curtains:
alias: Open Bedroom Curtains slowly
sequence:
- repeat:
sequence:
- action: cover.set_cover_position
metadata: {}
data:
position: '{{ state_attr(''cover.bedroom_curtains'', ''current_position'')
+ 1 }}'
target:
entity_id: cover.bedroom_curtains
- delay:
hours: 0
minutes: 2
seconds: 0
milliseconds: 0
while:
- condition: numeric_state
entity_id: cover.bedroom_curtains
below: 100
attribute: current_position
description: ''
mode: restart
vacuum_clean_bedroom:
alias: 'Vacuum: Clean Bedroom'
sequence:
- action: vacuum.send_command
data:
entity_id: vacuum.roborock
command: app_segment_clean
params:
- 16
- 17
description: Run Vacuum in Bedroom and Wardrobe
vacuum_clean_corridor:
alias: 'Vacuum: Clean Corridor'
sequence:
- action: vacuum.send_command
data:
command: app_segment_clean
params:
segments:
- 18
- 23
target:
entity_id: vacuum.roborock
description: Run Vacuum in Corridor and Laundry
icon: mdi:hanger
vacuum_clean_kitchen:
alias: 'Vacuum: Clean Kitchen'
sequence:
- action: vacuum.send_command
data:
command: app_segment_clean
params:
segments:
- 19
target:
entity_id: vacuum.roborock
description: Run Vacuum in Kitchen
icon: mdi:countertop-outline
vacuum_clean_living_room:
alias: 'Vacuum: Clean Living Room'
sequence:
- action: vacuum.send_command
data:
command: app_segment_clean
params:
segments:
- 20
target:
entity_id: vacuum.roborock
description: Run Vacuum in Living Room
icon: mdi:sofa-outline
vacuum_clean_cabinet:
alias: 'Vacuum: Clean Cabinet'
sequence:
- action: vacuum.send_command
data:
command: app_segment_clean
params:
segments:
- 21
target:
entity_id: vacuum.roborock
description: Run Vacuum in Cabinet
icon: mdi:table-chair
vacuum_clean_bathroom:
alias: 'Vacuum: Clean Bathroom'
sequence:
- action: vacuum.send_command
data:
command: app_segment_clean
params:
segments:
- 22
repeat: 2
target:
entity_id: vacuum.roborock
description: Run Vacuum in Bathroom
icon: mdi:bathtub-outline
low_power_mode:
alias: Low Power Mode
sequence:
- if:
- condition: state
entity_id: binary_sensor.electricity
state: 'on'
then:
- action: switch.turn_on
target:
entity_id:
- switch.water_heater
data: {}
- action: switch.turn_on
target:
entity_id:
- switch.oven_outlet
data: {}
- action: switch.turn_on
target:
entity_id:
- switch.fridge_outlet
data: {}
else:
- action: switch.turn_off
metadata: {}
data: {}
target:
entity_id: switch.water_heater
- if:
- condition: numeric_state
entity_id: sensor.oven_power
above: 100
then:
- action: switch.turn_off
metadata: {}
data: {}
target:
entity_id:
- switch.oven_outlet
alias: Turn off Oven when it's heating
- action: switch.turn_off
metadata: {}
data: {}
target:
entity_id:
- switch.dishwasher_power
- switch.dryer
- switch.washer
- action: climate.turn_off
metadata: {}
data: {}
target:
entity_id:
- climate.living_room_ac
- climate.cabinet_ac
alias: Turn off ACs
- action: climate.turn_off
metadata: {}
data: {}
target:
entity_id:
- climate.corridor_heated_floor
- climate.kitchen_heated_floor
- climate.bathroom_heated_floor
- climate.bathroom_heated_wall
alias: Turn off heated floors
- action: fan.turn_off
metadata: {}
data: {}
target:
entity_id:
- fan.living_room_recuperator
- fan.bedroom_recuperator
alias: Turn off recuperators
description: Minimise electricity consumption for our home. Turn off powerful appliances.
Restore the previous state when Electricity is back.
icon: mdi:home-battery
fields: {}
away_mode:
alias: Away Mode
description: A flow for switching into Away mode
sequence:
- alias: Switch to Away Mode or restore from it
if:
- condition: state
entity_id: input_boolean.away
state: 'on'
then:
- alias: Notify about Away Mode activation
action: script.announcement
data:
speak: false
title: "Далеко від дому \U0001F3C3"
openings:
- Режим «Далеко від дому» увімкнено.
- Режим «Далеко від дому» автивовано.
- Активовано режим «Далеко від дому».
messages:
- Вмикається симуляція присутності.
- Готуємо дім до вашої відсутності.
- Щасливої дороги!
notify_data:
group: system
tag: away-mode
- alias: Turn off Water Heater
entity_id: switch.water_heater
action: switch.turn_off
- action: presence_simulation.start
metadata: {}
data: {}
else:
- alias: Notify about Away Mode deactivation
data:
speak: false
title: "Далеко від дому \U0001F3C3"
openings:
- Режим «Далеко від дому» вимкнено.
- Режим «Далеко від дому» деактивовано.
- Деактивовано режим «Далеко від дому».
messages:
- Вимикаємо симуляцію присутності.
- Готуємо дім до вашого прибуття.
- Вітаю з поверненням!
notify_data:
group: system
tag: away-mode
action: script.announcement
- alias: Suggest cleaning home before arrival
data:
speak: false
title: "Пилосос \U0001F9F9"
openings:
- Cхоже вас давно не було вдома.
- Ви були далеко від дому.
- Ви на підході додому!
messages:
- Прибрати вдома?
- Прибирати перед приїздом?
- Бажаєте прибрати перед прибуттям?
- Почати прибирання?
- Робот пропонує домашнє прибирання.
- Пилосос хоче прибирати квартиру.
- Робот давно не прибирав. Почати?
notify_data:
url: /lovelace/vacuum
group: vacuum
tag: vacuum-cleaning
actions:
- action: VACUUM_START
title: Почати прибирання
activationMode: background
authenticationRequired: true
action: script.announcement
- alias: Turn on Water Heater
entity_id: switch.water_heater
action: switch.turn_on
- action: presence_simulation.stop
metadata: {}
data: {}
- alias: Heat up Home during Heating Season
if:
- condition: numeric_state
entity_id: sensor.home_temperature
below: 21
then:
- alias: Set TRVs to boost
data:
entity_id:
- climate.living_room_heater
- climate.bedroom_heater
preset_mode: boost
action: climate.set_preset_mode
else:
- data:
preset_mode: manual
target:
entity_id:
- climate.bedroom_heater
- climate.living_room_heater
alias: Set TRV to manual
action: climate.set_preset_mode
enabled: false
- alias: Cool down Home during Summer
if:
- condition: numeric_state
entity_id: sensor.home_temperature
above: 26
then:
- alias: Set ACs to cool down
data:
temperature: 18
hvac_mode: cool
action: climate.set_temperature
target:
entity_id:
- climate.living_room_ac
- climate.cabinet_ac
- alias: Wait for home to cool down
wait_for_trigger:
platform: numeric_state
entity_id: sensor.home_temperature
below: 24
timeout:
hours: 1
- alias: Turn off ACs and set temperature to normal
data:
temperature: 23
hvac_mode: 'off'
action: climate.set_temperature
target:
entity_id:
- climate.living_room_ac
- climate.cabinet_ac
mode: single
icon: mdi:shield-home-outline
scene_all_light:
alias: 'Scene: All Lights'
sequence:
- action: input_boolean.turn_off
metadata: {}
data: {}
target:
entity_id:
- input_boolean.evening_lights
- input_boolean.night_lights
- input_boolean.sleeping_lights
- action: light.turn_on
data:
brightness_pct: 100
target:
entity_id:
- light.zigbee_lights
- action: light.turn_on
data:
brightness_pct: 100
target:
entity_id:
- all
description: Turn on all lights available in Home Assistant
icon: mdi:lightbulb-group
scene_light_out:
alias: 'Scene: Light Out'
sequence:
- action: input_boolean.turn_off
metadata: {}
data: {}
target:
entity_id:
- input_boolean.evening_lights
- input_boolean.night_lights
- input_boolean.sleeping_lights
- action: light.turn_off
data: {}
target:
entity_id: light.zigbee_lights
- action: light.turn_off
data: {}
target:
entity_id:
- all
description: Turn off all lights available in Home Assistant
icon: mdi:lightbulb-group-off
scene_evening_lights:
alias: 'Scene: Evening Lights'
sequence:
- action: input_boolean.turn_off
metadata: {}
data: {}
target:
entity_id:
- input_boolean.night_lights
- input_boolean.sleeping_lights
- action: scene.turn_on
metadata: {}
target:
entity_id: scene.living_room_evening_lights
- alias: Activate Bedroom lights
if:
- condition: or
conditions:
- condition: state
entity_id: binary_sensor.bedroom_motion_occupancy
state: 'on'
- condition: state
entity_id: light.bedroom_lights
state: 'on'
alias: When there is presence or lights are on
then:
- action: scene.turn_on
metadata: {}
target:
entity_id: scene.bedroom_evening_lights
- alias: Activate Cabinet lights, if there is presence
if:
- condition: or
conditions:
- condition: state
entity_id: binary_sensor.cabinet_motion_occupancy
state: 'on'
- condition: state
entity_id: light.cabinet_lights
state: 'on'
alias: When there is presence or lights are on
then:
- action: scene.turn_on
metadata: {}
target:
entity_id: scene.cabinet_evening_lights
description: Activate Evening Lights based on presence in each of the rooms.
icon: mdi:weather-sunset
scene_night_lights:
alias: 'Scene: Night Lights'
sequence:
- action: input_boolean.turn_off
metadata: {}
data: {}
target:
entity_id:
- input_boolean.evening_lights
- input_boolean.sleeping_lights
- action: scene.turn_on
metadata: {}
target:
entity_id: scene.living_room_night_lights
- alias: Activate Bedroom lights
if:
- alias: When there is presence or lights are on
condition: or
conditions:
- condition: state
entity_id: binary_sensor.bedroom_motion_occupancy
state: 'on'
- condition: state
entity_id: light.bedroom_lights
state: 'on'
then:
- action: scene.turn_on
metadata: {}
target:
entity_id: scene.bedroom_night_lights
- alias: Activate Cabinet lights, if there is presence
if:
- condition: or
conditions:
- condition: state
entity_id: binary_sensor.cabinet_motion_occupancy
state: 'on'
- condition: state
entity_id: light.cabinet_lights
state: 'on'
alias: When there is presence or lights are on
then:
- action: scene.turn_on
metadata: {}
target:
entity_id: scene.cabinet_night_lights
description: Activate Night Lights based on presence in each of the rooms.
icon: mdi:weather-sunset
scene_sleeping_lights:
alias: 'Scene: Sleeping Lights'
sequence:
- action: input_boolean.turn_off
metadata: {}
data: {}
target:
entity_id:
- input_boolean.evening_lights
- input_boolean.night_lights
- action: scene.turn_on
metadata: {}
target:
entity_id: scene.bedroom_sleeping_lights
- action: light.turn_off
metadata: {}
data: {}
target:
area_id:
- cabinet
- kitchen
- living_room
description: Activate Sleeping Lights and adjust lights in other rooms
icon: mdi:power-sleep