-
Notifications
You must be signed in to change notification settings - Fork 96
/
scripts.yaml
583 lines (529 loc) · 21 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
570
571
572
573
574
575
576
577
578
579
580
581
582
583
####ALARM ####
####TEST SCRIPTS####
####GLOBAL SCRIPTS####
####TRIGGERED LIGHTS
####NOTIFICATIONS AND ALERTS####
####################################################
# #
# Let's Encrypt Renewal #
# #
####################################################
letsencrypt_renewal:
alias: "Let's Encrypt Renewal"
sequence:
- service: hassio.addon_restart
data:
addon: core_letsencrypt
- service: notify.hassnico_bot
data:
message: >
"Let's Encrypt CA was Renewed with Script"
####################################################
# #
# OWNTRACKS #
# #
####################################################
owntracks_update:
alias: Owntracks Update
sequence:
- service: mqtt.publish
data:
topic: "owntracks/Nico/Nico/cmd"
payload_template: '{"_type":"cmd","action":"reportLocation"}'
- service: mqtt.publish
data:
topic: "owntracks/mamma/mamma/cmd"
payload_template: '{"_type":"cmd","action":"reportLocation"}'
####################################################
# #
# Telegram #
# #
####################################################
nico_gps_notify_telegram:
alias: Script for Notify Nico's Location on Telegram
sequence:
- service: telegram_bot.send_location
data:
caption: 'Nico location'
target:
- !secret telegram_clientid
- !secret telegram_clientid2
latitude: '{{ states.device_tracker.nico_nico.attributes.latitude|float }}'
longitude: '{{ states.device_tracker.nico_nico.attributes.longitude|float }}'
disable_notification: true
mamma_gps_notify_telegram:
alias: Script for Notify Mom's Location on Telegram
sequence:
- service: telegram_bot.send_location
data:
caption: 'Mom location'
target:
- !secret telegram_clientid
- !secret telegram_clientid2
latitude: '{{ states.device_tracker.mamma_mamma.attributes.latitude|float }}'
longitude: '{{ states.device_tracker.mamma_mamma.attributes.longitude|float }}'
disable_notification: true
####################################################
# #
# Alexa #
# #
####################################################
alexascripthastart:
sequence:
- service: media_player.volume_set
data:
entity_id: media_player.nicolo_s_bose_home_speaker_500
volume_level: 0.2
- delay: 00:00:02
- service: notify.alexa_media
data:
target:
- media_player.nicolo_s_bose_home_speaker_500
data:
type: tts
message: >
{{ [
"Home Assistant è nuovamente disponibile",
"Home Assistant è operativo",
"Home assistant is back bitches",
"Home assistant è avviato",
] | random }}
alexascriptvoipcall:
sequence:
- service: media_player.volume_set
data:
entity_id: media_player.echo_dot_di_nicolo
volume_level: 0.5
- delay: 00:00:02
- service: notify.alexa_media
data:
target: media_player.echo_dot_di_nicolo
data:
type: tts
message: "Prova di Nico"
- service: hassio.addon_stdin
data_template:
addon: 89275b70_dss_voip
input: {"call_sip_uri":"sip:[email protected]","message_tts":"Telefonata VoIP di Prova da Nico"}
alexascriptmariatiamo:
sequence:
- service: media_player.volume_set
data:
entity_id: media_player.nicolo_s_bose_home_speaker_500
volume_level: 0.2
#- delay: 00:00:01
- service: notify.alexa_media
data:
target:
- media_player.nicolo_s_bose_home_speaker_500
data:
type: tts
message: "Maria ti amo"
alexascriptvoiptest:
sequence:
- service: hassio.addon_stdin
data_template:
addon: 89275b70_dss_voip
input: {"call_sip_uri":"sip:[email protected]","message_tts":"Telefonata VoIP di Prova da Nico"}
alexascriptbirthday:
sequence:
- service: notify.alexa_media
data:
target:
- media_player.nicolo_s_bose_home_speaker_500
data:
type: tts
message: >
{{- [
"Celebrate your birthday today. Celebrate being Happy every day.",
"Well, you are another year older and you haven't changed a bit. That's great because you are perfect just the way you are. Happy Birthday.",
"You are special and I hope that you float through the day with a big smile on your face. Happy Birthday!",
"Happy Birthday!!! I hope this is the begining of your greatest, most wonderful year ever!",
"Wishing you a day that is as special in every way as you are. Happy Birthday.",
"You have to get older, but you don't have to grow up!",
"Set the world on fire with your dreams and use the flame to light a birthday candle. HAPPY BIRTHDAY!",
"Thinking of you on your birthday, and wishing you all the best! I hope it is as fantastic as you are, you deserve the best and nothing less.",
"I hope that you have the greatest birthday ever from the moment you open your eyes in the morning until they close late at night.",
"Hope your birthday is totally cool, really funtastic, wonderful, exciting, majorly awesome, rocking and HAPPY. Happy Birthday wishes.",
"Be your own light. Find your own way. It should be easy with all those candles.",
"Your birthday should be a national holiday. I need a day off. Happy Birthday.",
"You are a gift to the world. How is that for a reverse birthday wish. Happy Birthday.",
"I hope that today is the beginning of a great year for you. Happy Birthday.",
"Happy Birthday !! Have a wonderful happy, healthy birthday and many more to come.",
"I hope you have a beautiful day and get at least half of what you want! Happy Birthday!",
"Happy Birthday. Just one more year and you will be perfect. Yes, I did say that last year.",
"You have a birthday twinkle in your eye so have fun and know we love you fairy, fairy much. Happy Birthday.",
"Live today like it is a special gift, because it is the best birthday gift. Happy Birthday.",
"May your heart naturally beat with the happiness and laughter that you give others. Happy Birthday.",
"Happy Birthday. Hope it's one of the best ever!!!!... a lovely birthday for a lovely person!",
"Wishing you health, love, wealth, happiness and just everything your heart desires. Happy Birthday.",
"Happy Birthday to a friend who means more to me than chocolate.",
"Things I like about you: humor, looks, everything. Happy Birthday.",
"Watch out world. You are old enough to know what to do and how to do it. Happy Birthday.",
"When I paint my masterpiece, I am pretty sure there will be a spot for you. Happy Birthday.",
"Happy Birthday. I hope that you will have a truly marvelous and joyous day with family and friends.",
"Enjoy your birthday and every day to the fullest. A Happy Birthday is just part of a Happy Life.",
"No matter how hard you try to fit in, you were born to stand out. Now celebrate that fact.",
"Hope your day is simply terrific! Happy Birthday.",
"I wish you a wonderfulBirthday!! I hope you have an amazing day and lots of fun! Enjoy this day, you deserve it!",
"Time waits for no one but that doesn't matter if you don't wait for it! Happy Birthday.",
"Today is not the end of another year, but the start of a new one. Happy Birthday.",
"Being young is a privilege. Being attractive a genetic gift. Being cool, that is all you. Happy Birthday.",
"Wishing you love and happiness on your birthday. Happy Birthday",
"You aren't getting older, you are getting better. Happy Birthday.",
"May your day be beautiful and may your heart be happy and may you celebrate birthdays for many years to come.",
"I wish you happiness, health and so many good things in your life. Happy Birthday!",
"Work hard. Play hard. Eat lots of cake. That's a good motto for your birthday and for life.",
"I wish you happiness, health and so many good things in your life. Happy Birthday!",
"What should we celebrate first: your accomplishments or your birthday?",
"Out of the 19,178,082 people having a birthday today, you rank solidly in my top 10 list.",
"Happy Birthday to a lovely & vibrant individual!",
"You remind me of you at your age. Young and good looking! Happy Birthday!",
"I wish you the best birthday ever! I hope you get lots of kisses and hugs. Happy Birthday!",
"Hope you have wonderful birthday filled with fun, excitement and joy. Happy Birthday.",
"I hope your BIG BRIGHT STAR keeps on shining. HAPPY BIRTHDAY !",
"Happy Birthday. Hope it's one of the best ever!!! A lovely birthday for a lovely person!",
"Happy moments. Happy thoughts. Happy Dreams. Happy feelings. Happy Birthday.",
"Happy Birthday to you!, Happy Birthday to you!, Happy Birthday to you!"
] | random -}}
alexamediapause2:
sequence:
- data:
entity_id: media_player.salotto
service: media_player.media_pause
alexaradiofreccia:
sequence:
- service: media_player.volume_set
data:
entity_id: media_player.nicolo_s_bose_home_speaker_500
volume_level: 0.2
- delay: 00:00:02
- data:
entity_id: media_player.nicolo_s_bose_home_speaker_500
media_content_id: "Radiofreccia"
media_content_type: "TUNEIN"
service: media_player.play_media
alexalazio:
sequence:
- service: media_player.volume_set
data:
entity_id: media_player.nicolo_s_bose_home_speaker_500
volume_level: 0.2
- delay: 00:00:02
- data:
entity_id: media_player.nicolo_s_bose_home_speaker_500
media_content_id: "Lazio Style Radio"
media_content_type: "TUNEIN"
service: media_player.play_media
alexaglobo:
sequence:
- service: media_player.volume_set
data:
entity_id: media_player.nicolo_s_bose_home_speaker_500
volume_level: 0.2
- delay: 00:00:02
- data:
entity_id: media_player.nicolo_s_bose_home_speaker_500
media_content_id: "Radio Globo"
media_content_type: "TUNEIN"
service: media_player.play_media
alexartl1025:
sequence:
- service: media_player.volume_set
data:
entity_id: media_player.nicolo_s_bose_home_speaker_500
volume_level: 0.2
- delay: 00:00:02
- data:
entity_id: media_player.nicolo_s_bose_home_speaker_500
media_content_id: "RTL 102.5"
media_content_type: "TUNEIN"
service: media_player.play_media
alexa105:
sequence:
- service: media_player.volume_set
data:
entity_id: media_player.nicolo_s_bose_home_speaker_500
volume_level: 0.2
- delay: 00:00:02
- data:
entity_id: media_player.nicolo_s_bose_home_speaker_500
media_content_id: "Radio 105"
media_content_type: "TUNEIN"
service: media_player.play_media
alexards:
sequence:
- service: media_player.volume_set
data:
entity_id: media_player.nicolo_s_bose_home_speaker_500
volume_level: 0.2
- delay: 00:00:02
- data:
entity_id: media_player.nicolo_s_bose_home_speaker_500
media_content_id: "RDS Radio"
media_content_type: "TUNEIN"
service: media_player.play_media
alexam2o:
sequence:
- service: media_player.volume_set
data:
entity_id: media_player.nicolo_s_bose_home_speaker_500
volume_level: 0.2
- delay: 00:00:02
- data:
entity_id: media_player.nicolo_s_bose_home_speaker_500
media_content_id: "m2o"
media_content_type: "TUNEIN"
service: media_player.play_media
alexaflash:
sequence:
- service: media_player.volume_set
data:
entity_id: media_player.nicolo_s_bose_home_speaker_500
volume_level: 0.2
- delay: 00:00:02
- data:
entity_id: media_player.nicolo_s_bose_home_speaker_500
media_content_id: Alexa.FlashBriefing.Play
media_content_type: sequence
service: media_player.play_media
alexaimathome:
sequence:
- service: media_player.volume_set
data:
entity_id: media_player.nicolo_s_bose_home_speaker_500
volume_level: 0.2
- delay: 00:00:02
- data:
entity_id: media_player.nicolo_s_bose_home_speaker_500
media_content_id: Alexa.ImHome.Play
media_content_type: sequence
service: media_player.play_media
alexafun:
sequence:
- service: media_player.volume_set
data:
entity_id: media_player.nicolo_s_bose_home_speaker_500
volume_level: 0.2
- delay: 00:00:02
- data:
entity_id: media_player.nicolo_s_bose_home_speaker_500
media_content_id: Alexa.FunFact.Play
media_content_type: sequence
service: media_player.play_media
alexastory:
sequence:
- service: media_player.volume_set
data:
entity_id: media_player.nicolo_s_bose_home_speaker_500
volume_level: 0.2
- delay: 00:00:02
- data:
entity_id: media_player.nicolo_s_bose_home_speaker_500
media_content_id: Alexa.TellStory.Play
media_content_type: sequence
service: media_player.play_media
alexasing:
sequence:
- service: media_player.volume_set
data:
entity_id: media_player.nicolo_s_bose_home_speaker_500
volume_level: 0.2
- delay: 00:00:02
- data:
entity_id: media_player.nicolo_s_bose_home_speaker_500
media_content_id: Alexa.SingASong.Play
media_content_type: sequence
service: media_player.play_media
alexanight:
sequence:
- service: media_player.volume_set
data:
entity_id: media_player.nicolo_s_bose_home_speaker_500
volume_level: 0.2
- delay: 00:00:02
- data:
entity_id: media_player.nicolo_s_bose_home_speaker_500
media_content_id: Alexa.GoodNight.Play
media_content_type: sequence
service: media_player.play_media
alexamorning:
sequence:
- service: media_player.volume_set
data:
entity_id: media_player.nicolo_s_bose_home_speaker_500
volume_level: 0.2
- delay: 00:00:02
- data:
entity_id: media_player.nicolo_s_bose_home_speaker_500
media_content_id: Alexa.GoodMorning.Play
media_content_type: sequence
service: media_player.play_media
alexatraffic:
sequence:
- service: media_player.volume_set
data:
entity_id: media_player.nicolo_s_bose_home_speaker_500
volume_level: 0.2
- delay: 00:00:02
- data:
entity_id: media_player.nicolo_s_bose_home_speaker_500
media_content_id: Alexa.Traffic.Play
media_content_type: sequence
service: media_player.play_media
alexatraffic2:
sequence:
#- service: media_player.volume_set
#data:
#entity_id: media_player.this_device
#volume_level: 0.2
#- delay: 00:00:02
- data:
entity_id: media_player.this_device
media_content_id: Alexa.Traffic.Play
media_content_type: sequence
service: media_player.play_media
alexaweather:
sequence:
- service: media_player.volume_set
data:
entity_id: media_player.nicolo_s_bose_home_speaker_500
volume_level: 0.2
- delay: 00:00:02
- data:
entity_id: media_player.nicolo_s_bose_home_speaker_500
media_content_id: Alexa.Weather.Play
media_content_type: sequence
service: media_player.play_media
braviascript:
sequence:
- service: media_player.volume_set
data_template:
entity_id: media_player.tv_casetta_kd_55xf9005
volume_level: 1
- delay: 00:00:01
- service: notify.alexa_media
data_template:
message: 'Ding-dong. Someone is at the door.'
target: media_player.tv_casetta_kd_55xf9005
data:
type: tts
alexa_set_volume:
sequence:
- service: media_player.volume_set
data_template:
entity_id: '{{ states.sensor.last_alexa.state }}'
volume_level: >
{% if is_state("sensor.last_alexa", "media_player.echo_dot_di_nicolo") %}
0.5
{% else %}
0.3
{% endif %}
alexa_tts:
sequence:
- service: script.turn_on
entity_id: script.alexa_set_volume
- delay: '00:00:01'
- service: media_player.alexa_tts
data_template:
entity_id: '{{ states.sensor.last_alexa.state }}'
message: "Test da Nico"
####################################################
# #
# Greetings #
# #
####################################################
jarvis_greeting:
alias: Jarvis Greeting
sequence:
- service: media_player.volume_set
data:
entity_id: media_player.nicolos_bose_home_speaker_500
volume_level: 0.3
- delay: 00:00:01
- service: notify.alexa_media
data_template:
entity_id: media_player.nicolos_bose_home_speaker_500
message: >
{% if now().strftime("%H")|int < 12 %}
Buongiorno da Jarvis
{% elif now().strftime("%H")|int < 18 %}
Buon Pomeriggio da Jarvis
{% else %}
Buonasera da Jarvis
{% endif %}
Il tempo è {{states.sensor.owm_condition.state}} e la temperatura è di {{states.sensor.owm_temperature.state}} Centigradi a Roma. Ti auguro una buona giornata.
#- service: media_player.turn_off
#entity_id: media_player.nicolos_bose_home_speaker_500
####################################################
# #
# CAMERA #
# #
####################################################
camera_snapshot:
alias: Camera Snapshot
sequence:
- service: telegram_bot.send_photo
data:
caption: 'Camera Snapshot'
target:
- !secret telegram_clientid
# - !secret telegram_clientid2
url: !secret ss_camera_snapshot
####################################################
# #
# HA Service #
# #
####################################################
restart_ha:
alias: Restart HomeAssistant
sequence:
- alias: Restart HA
service: homeassistant.restart
reload_automations:
alias: Reload Automations
sequence:
- alias: Reload-Automations
service: automation.reload
####################################################
# #
# Shelly #
# #
####################################################
####################################################
# #
# Camera presets #
# #
####################################################
ss_preset_home:
alias: Home
sequence:
- service: rest_command.ss_preset_home
### return to home preset after 30 seconds ###
- delay:
seconds: 30
- service: rest_command.ss_preset_home
ss_preset_living:
alias: Living
sequence:
- service: rest_command.ss_preset_living
### return to home preset after 30 seconds ###
- delay:
seconds: 30
- service: rest_command.ss_preset_home
ss_preset_bedroom:
alias: Bedroom
sequence:
- service: rest_command.ss_preset_bedroom
### return to home preset after 30 seconds ###
- delay:
seconds: 30
- service: rest_command.ss_preset_home
ss_preset_rack:
alias: Rack
sequence:
- service: rest_command.ss_preset_rack
### return to home preset after 30 seconds ###
- delay:
seconds: 30
- service: rest_command.ss_preset_home