/
notify_devices.yaml
1255 lines (1251 loc) · 60.6 KB
/
notify_devices.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
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
blueprint:
name: Notify Mobile App Devices
description: |-
**Struggling to make use of the notification options of the [Home Assistant Companion App](https://companion.home-assistant.io/) on your mobile device?**
**Then this script can help you in the right direction.**
***
For more instructions or questions take a look in the [Home Assistant Community forum topic](https://community.home-assistant.io/t/notify-mobile-companion-app-devices/512487)
Ever gone through all of the options of the [Companion app](https://companion.home-assistant.io/docs/notifications/notifications-basic)?, then you may have lost your self 🤔 in all of the options you can pick you might be dazzled 😵 what you can do with it, let alone reapply it in another automation 😕.
## Features of this script ##
* Use an UI to select options instead of reading the documentation 😵💫🥴🤔🥲🥱😫😝
* Able to send notifications to one or more specific device(s) or all devices
* Send notifications based on the device(s) state:
* Home
* Away
* Both (Home and Away)
* Send notifications to Android and iOS devices (!). The script then filters the input to what is supported per platform. Thus Android features are not send to iOS devices and visa versa.
* Send notifications with actionable actions. The script then filters the actions per platform. Thus Android actions are not send to iOS devices and visa versa.
* Support notifications with camera images/live feed for camera devices, also for [Google Nest camera devices](https://www.home-assistant.io/integrations/nest/) (!).
***
### Background ###
*I noticed over the last year or so that I made more and more use of the notifications via the Home Assistant Companion App on the various mobile devices, and I loved it so much that I applied it for many automations. During that journey I was struggling with adding and fixing the code in various automations (there are +/- 40 automations where I was using it) so maintaining all of it was a nightmare. And so it began, I made one script that has all the logic in it to notify all or specific devices, which have the app installed, and let the automation call the script.
And so during that journey I also wanted to use the selectors to have a UI to guide the process with all sorts of options.*
***
## Examples ##
***
### Example 1 ###
Send a persistent notification, that the user can’t remove.
```
service: script.notify_devices
data:
notify_home_or_away: Both
data_notification_icon: mdi:human-greeting-variant
notify_title: Example 1
notify_message: Send a persistent notification, that the user can't remove
data_group: Example
data_tag: Use this tag when you need to remove it
data_importance: high
data_sticky: true
data_persistent: true
```
### Example 2 ###
Send a clean_persistent notification, so the notification is removed.
```
service: script.notify_devices
data:
notify_home_or_away: Both
data_tag: Use this tag when you need to remove it
data_importance: high
notify_message: clear_notification
```
### Example 3 ###
Send a notification with camera image file. The data_camera can accept various
options, but the results are different for Android or iOS.
More information:
* https://companion.home-assistant.io/docs/notifications/notification-attachments
* https://www.home-assistant.io/integrations/nest/
Examples:
* data_camera: camera.name
* data_camera: /api/nest/event_media/{\{trigger.event.data.device_id}}/{\{trigger.event.data.nest_event_id}}/thumbnail
* data_camera: /api/nest/event_media/{\{trigger.event.data.device_id}}/{\{trigger.event.data.nest_event_id}}
* data_camera: /media/local/video.mp4
* data_camera: https://example.com/video.mp4
* data_camera: /media/local/photo.jpg
* data_camera: https://example.com/image.jpg
* data_camera: /media/local/audio.mp3
* data_camera: https://example.com/audio.mp3
```
service: script.notify_devices
data:
notify_home_or_away: Both
data_notification_icon: mdi:cctv
notify_title: Camera
notify_message: Send a camera picture notification
data_group: Camera
data_importance: high
data_sticky: true
data_camera: camera.name
```
Sends a Nest camera image file
```
service: script.notify_devices
data:
notify_home_or_away: Both
data_notification_icon: mdi:cctv
notify_title: Camera
notify_message: Send a Nest camera picture notification
data_group: Camera
data_importance: high
data_sticky: true
data_camera: >-
{{'/api/nest/event_media/{{'~'trigger.event.data.device_id'~'}}/{{'~'trigger.event.data.nest_event_id'~'}}/thumbnail'}}
```
### Example 4 ###
Actionable notifications are a unique type of notification as they allow the user to add buttons to the notification which can then send an event to Home Assistant once clicked. This event can then be used in an automation allowing you to perform a wide variety of actions. These notifications can be sent to either iOS or Android.
Some useful examples of actionable notifications:
* A notification is sent whenever motion is detected in your home while you're away or asleep. A "Sound Alarm" action button is displayed alongside the notification, that when tapped, will sound your burglar alarm.
* Someone rings your front doorbell. You receive a notification with a live camera stream of the visitor outside along with action buttons to lock or unlock your front door.
* Receive a notification whenever your garage door opens with action buttons to open or close the garage.
Click [here](https://companion.home-assistant.io/docs/notifications/actionable-notifications#building-actionable-notifications) for the documentation
**This script filters the actions per device. This means you can send information to Android and iOS device simultaneously 🙂 .**
```
service: script.notify_devices
data:
notify_home_or_away: Both
data_notification_icon: mdi:gesture-tap-button
notify_title: Actionable Notifications
notify_message: Send a notification with actions to Android and iOS device
data_group: Notifications
data_importance: high
data_actions:
- action: ALARM
# This is visible on both devices
title: Sound Alarm
- action: SILENCE
# This is visible on both devices, but the icons are only shown on iOS devices
title: Silence Alarm
icon: sfsymbols:bell.slash
- action: URI
# This is visible on both devices
title: Open Url
uri: https://google.com
- action: "URI"
# This is only visible on Android devices
title: "Open an Android app"
# Name of package for application you would like to open
uri: "app://com.twitter.android"
- action: "OPEN"
# This is only visible on iOS devices
title: "Open iOS URL"
uri: "https://google.com"
- action: "CALL"
# This is only visible on iOS devices
title: "Call - iOS only"
uri: "tel:2125551212"
```
domain: script
homeassistant:
min_version: 2022.1.0
source_url: https://github.com/Grumblezz/Home-Assistant-Notify-Mobile-Companion-App-Devices/blob/main/notify_devices.yaml
mode: parallel
max: 10
icon: mdi:cellphone-message
fields:
notify_devices:
name: Device to notify
description: Device needs to run the official Home Assistant app to receive notifications. If not specified, then all devices are used.
required: false
selector:
device:
multiple: true
integration: mobile_app
notify_home_or_away:
name: Notify those that are Home or Away?
required: true
example: Both
selector:
select:
multiple: false
mode: dropdown
options:
- Home
- Away
- Both
data_notification_icon:
name: Android Only - Notification icon (Optional)
required: false
description: Changing the default notification status bar icon
example: mdi:motion-outline
selector:
icon: null
notify_title:
name: Notification title (Optional)
description: Notification title, required when used with TTS
example: Frontdoor
required: false
selector:
template: null
data_subtitle:
name: Notification Subtitle / subject (Optional)
description: Subtitles and subjects are secondary headings
required: false
example: Subtitle goes here
selector:
text:
multiline: false
type: text
notify_message:
name: Notification message
required: true
description: Notification message
example: There is somebody at the door!
selector:
select:
options:
- TTS
- remove_channel
- clear_notification
- There is somebody at the door!
- There is somebody in the garden!
custom_value: true
multiple: false
data_group:
name: Notification grouping (Optional)
description: Combine notification together visually.
required: false
example: Motion
selector:
select:
options:
- Alarm
- Example
- Motion
custom_value: true
multiple: false
data_channel:
name: Notification channel (Optional)
description: Notification channel
required: false
example: Motion
selector:
select:
options:
- Motion Detected
- default
- Importance
- Cover
- Alarm
- Birthday
- Door
- Person Detected
- Doorbell Ring
- Updates
- Vacuum
- Fan
custom_value: true
multiple: false
data_tag:
name: Notification tag (Optional)
description: Notification tag
required: false
example: backyard-motion-detected
selector:
select:
options:
- backyard-motion-detected
- alarm
- doorbell
- updates
- motion
- cover
- fan
custom_value: true
multiple: false
data_importance:
name: Important notification
description: Notifications will appear immediately in most cases. However, in some cases (such as phone being stationary or when screen has been turned off for prolonged period of time) and this is to override that default behavior
required: false
example: high
selector:
select:
options:
- high
data_device_ring:
name: Device Ring (Optional)
description: Make the device ring even if on vibrate/silent ringer mode. Max will Only work for TTS messages
required: false
example: "On"
selector:
select:
options:
- "On"
- Max
multiple: false
data_visibility:
name: Android Only - Lock Screen Visibility (Optional)
required: false
description: How much of a notification is visible on the lock screen
example: public
selector:
select:
options:
- public
- private
- secret
custom_value: false
multiple: false
data_sticky:
name: Android Only - Keep notification? (Optional)
description: Keep the notification from being dismissed when the user selects it
example: true
required: false
selector:
boolean: null
data_persistent:
name: Android Only - Persistent notification? (Optional)
description: Persistent notifications are notifications that cannot be dismissed by swiping away. It requires the Notification tag to be set. If not set it will set it to persistent.
example: true
required: false
selector:
boolean: null
data_timeout:
name: Android Only - Timeout message in seconds (Optional)
description: How many seconds a notification will be shown on a users device before being removed/dismissed automatically.
required: false
example: 120
selector:
number:
min: 0
max: 600
step: 10
mode: slider
data_chronometer:
name: Android Only - The timestamp of the notification (Optional)
example: '"{{now()+timedelta(minutes=1)}}"'
description: Shows a timestamp. Notification will not disappear when the timer reaches 0. Instead, it will continue decrementing into negative values.
required: false
selector:
datetime: null
data_chronometer_enable:
name: Android Only - (when combined with data_chronometer) Enable the Notifications timer with a count up/down timer (Optional)
description: Show a count up/down timer. Notification will not disappear when the timer reaches 0. Instead, it will continue decrementing into negative values.
example: true
required: false
selector:
boolean: null
data_notification_color:
name: Android Only - Color of the notification icon (Optional)
required: false
description: In Android you can set the color of the notification icon
example: "[255,0,0]"
selector:
color_rgb: null
data_critical:
name: iOS Only - Critical notification? (Optional)
description: Critical alerts always appear at the top of your lock screen above all other notifications, and play a sound even if Do Not Disturb is enabled or the iPhone is muted.
example: true
required: false
selector:
boolean: null
data_ios_sound:
name: iOS Only - Sounds? (Optional)
description: Adding a custom sound to a notification allows you to easily identify the notification without even looking at your device. You must use the full filename (including extension) in the payload. If "iOS Only - Sound Volume Level" is not defined, then it will set the default sound level to 50%
example: US-EN-Morgan-Freeman-Roommate-Is-Arriving.wav
required: false
selector:
select:
options:
- default
- 3rdParty_DirectionDown_Haptic.caf
- 3rdParty_DirectionUp_Haptic.caf
- 3rdParty_Failure_Haptic.caf
- 3rdParty_Retry_Haptic.caf
- 3rdParty_Start_Haptic.caf
- 3rdParty_Stop_Haptic.caf
- 3rdParty_Success_Haptic.caf
- access_scan_complete.caf
- AccessSanComplete_Haptic
- acknowledgment_received.caf
- acknowledgment_sent.caf
- alarm.caf
- Alarm_Haptic.caf
- Alarm_Nightstand_Haptic.caf
- Alert_3rdParty_Haptic.caf
- Alert_3rdParty_Salient_Haptic.caf
- Alert_ActivityFriendsGoalAttained_Haptic.caf
- Alert_ActivityGoalAttained_Haptic.caf
- Alert_ActivityGoalAttained_Salient_Haptic.caf
- Alert_ActivityGoalBehind_Haptic.caf
- Alert_ActivityGoalBehind_Salient_Haptic.caf
- Alert_ActivityGoalClose_Haptic.caf
- Alert_BatteryLow_10p_Haptic.caf
- Alert_BatteryLow_5p_Haptic.caf
- Alert_BatteryLow_5p_Salient_Haptic.caf
- Alert_Calendar_Haptic.caf
- Alert_Calendar_Salient_Haptic.caf
- Alert_Health_Haptic.caf
- Alert_Mail_Haptic.caf
- Alert_Mail_Salient_Haptic.caf
- Alert_MapsDirectionsInApp_Haptic.caf
- Alert_Messages_1_Haptic.caf
- Alert_Messages_1_Salient_Haptic.caf
- Alert_Messages_2_Haptic.caf
- Alert_Messages_3_Haptic.caf
- Alert_PassbookBalance_Haptic.caf
- Alert_PassbookGeofence_Haptic.caf
- Alert_PassbookGeofence_Salient_Haptic.caf
- Alert_PhotostreamActivity_Haptic.caf
- Alert_ReminderDue_Haptic.caf
- Alert_ReminderDue_Salient_Haptic.caf
- Alert_SpartanConnected_LowLatency_Haptic.caf
- Alert_SpartanConnecting_Haptic.caf
- Alert_SpartanConnecting_LowLatency_Haptic.caf
- Alert_SpartanDisconnected_LowLatency_Haptic.caf
- Alert_Voicemail_Haptic.caf
- Alert_Voicemail_Salient_Haptic.caf
- Alert_WalkieTalkie_Haptic.caf
- Anticipate.caf
- AutoUnlock_Haptic.caf
- BatteryMagsafe_Haptic.caf
- Beat_Haptic.caf
- begin_record.caf
- Bloom.caf
- BuddyMigrationStart_Haptic.caf
- BuddyPairingFailure_Haptic.caf
- BuddyPairingRemoteConnection_Haptic.caf
- BuddyPairingRemoteTap_Haptic.caf
- BuddyPairingSuccess_Haptic.caf
- busy_tone_ansi.caf
- busy_tone_cept.caf
- call_waiting_tone_ansi.caf
- call_waiting_tone_cept.caf
- Calypso.caf
- camera_shutter_burst.caf
- camera_shutter_burst_begin.caf
- camera_shutter_burst_end.caf
- camera_timer_countdown.caf
- camera_timer_final_second.caf
- CameraCountdownImminent_Haptic.caf
- CameraCountdownTick_Haptic.caf
- CameraShutter_Haptic.caf
- Choo_Choo.caf
- connect_power.caf
- ct-busy.caf
- ct-call-waiting.caf
- ct-congestion.caf
- ct-error.caf
- ct-keytone2.caf
- ct-path-ack.caf
- Descent.caf
- Detent_Haptic.caf
- DoNotDisturb_Haptic.caf
- dtmf-0.caf
- dtmf-1.caf
- dtmf-2.caf
- dtmf-3.caf
- dtmf-4.caf
- dtmf-5.caf
- dtmf-6.caf
- dtmf-7.caf
- dtmf-8.caf
- dtmf-9.caf
- dtmf-pound.caf
- dtmf-star.caf
- end_call_tone_cept.caf
- end_record.caf
- engage_power.caf
- engage_power_short.caf
- ET_BeginNotification_Haptic.caf
- ET_BeginNotification_Salient_Haptic.caf
- ET_RemoteTap_Receive_Haptic.caf
- ET_RemoteTap_Send_Haptic.caf
- Fanfare.caf
- focus_change_app_icon.caf
- focus_change_keyboard.caf
- focus_change_large.caf
- focus_change_small.caf
- go_to_sleep_alert.caf
- GoToSleep_Haptic.caf
- HealthNotificaiton.caf
- HourlyChime_Haptic.caf
- HummingbirdCompletion_Haptic.caf
- HummingbirdNotification_Haptic.caf
- jbl_ambiguous.caf
- jbl_begin.caf
- jbl_cancel.caf
- jbl_confirm.caf
- jbl_no_match.caf
- key_press_click.caf
- key_press_delete.caf
- key_press_modifier.caf
- keyboard_press_clear.caf
- keyboard_press_delete.caf
- keyboard_press_normal.caf
- Ladder.caf
- lock.caf
- long_low_short_high.caf
- low_power.caf
- mail-sent.caf
- MessagesIncoming_Haptic.caf
- MessagesOutgoing_Haptic.caf
- middle_9_short_double_low.caf
- Minuet.caf
- multiway_invitation.caf
- MultiwayInvitation.caf
- MultiwayJoin.caf
- MultiwayLeave.caf
- navigation_pop.caf
- navigation_push.caf
- NavigationGenericManeuver_Haptic.caf
- NavigationGenericManeuver_Salient_Haptic.caf
- NavigationLeftTurn_Haptic.caf
- NavigationLeftTurn_Salient_Haptic.caf
- NavigationRightTurn_Haptic.caf
- NavigationRightTurn_Salient_Haptic.caf
- new-mail.caf
- News_Flash.caf
- nfc_scan_complete.caf
- Noir.caf
- Notification_Haptic.caf
- Notification_Salient_Haptic.caf
- OnOffPasscodeFailure_Haptic.caf
- OnOffPasscodeUnlock_Haptic.caf
- OnOffPasscodeUnlockCampanion_Haptic.caf
- OrbExit_Haptic.caf
- OrbLayers_Haptic.caf
- payment_failure.caf
- payment_success.caf
- PhoneAnswer_Haptic.caf
- PhoneHangUp_Haptic.caf
- PhoneHold_Haptic.caf
- photoShutter.caf
- PhotosZoomDetent_Haptic.caf
- Preview_AudioAndHaptic.caf
- QB_Dictation_Haptic.caf
- QB_Dictation_Off_Haptic.caf
- ReceivedMessage.caf
- RemoteCameraShutterBurstBegin_Haptic.caf
- RemoteCameraShutterBurstEnd_Haptic.caf
- ringback_tone_ansi.caf
- ringback_tone_aus.caf
- ringback_tone_cept.caf
- ringback_tone_hk.caf
- ringback_tone_uk.caf
- RingerChanged.caf
- Ringtone_2_Ducked_Haptic-sashimi.caf
- Ringtone_2_Haptic-sashimi.caf
- Ringtone_UK_Haptic.caf
- Ringtone_US_Haptic.caf
- RingtoneDucked_UK_Haptic.caf
- RingtoneDucked_US_Haptic.caf
- SalientNotification_Haptic.caf
- SedentaryTimer_Haptic.caf
- SedentaryTimer_Salient_Haptic.caf
- SentMessage.caf
- shake.caf
- Sherwood_Forest.caf
- short_double_high.caf
- short_double_low.caf
- short_low_high.caf
- SIMToolkitCallDropped.caf
- SIMToolkitGeneralBeep.caf
- SIMToolkitNegativeACK.caf
- SIMToolkitPositiveACK.caf
- SIMToolkitSMS.caf
- SiriAutoSend_Haptic.caf
- SiriStart_Haptic.caf
- SiriStopFailure_Haptic.caf
- SiriStopSuccess_Haptic.caf
- sms-received1.caf
- sms-received1.caf
- sms-received2.caf
- sms-received3.caf
- sms-received4.caf
- sms-received5.caf
- sms-received6.caf
- SOSEmergencyContactTextPrompt_Haptic.caf
- SOSFallDetection_Haptic-Newton.caf
- Spell.caf
- Stockholm_Haptic.caf
- StockholmActive_Haptic.caf
- StockholmActiveSingleCycle_Haptic.caf
- StockholmFailure_Haptic.caf
- StopwatchLap_Haptic.caf
- StopwatchReset_Haptic.caf
- StopwatchStart_Haptic.caf
- StopwatchStop_Haptic.caf
- Suspense.caf
- Swish.caf
- SwTest1_Haptic.caf
- SystemStartup_Haptic.caf
- Telegraph.caf
- Timer_Haptic.caf
- TimerCancel_Haptic.caf
- TimerPause_Haptic.caf
- TimerStart_Haptic.caf
- TimerWheelHoursDetent_Haptic.caf
- TimerWheelMinutesDetent_Haptic.caf
- Tink.caf
- Tiptoes.caf
- Tock.caf
- tweet_sent.caf
- Typewriters.caf
- UISwipe_Haptic.caf
- UISwitch_Off_Haptic.caf
- UISwitch_On_Haptic.caf
- Update.caf
- ussd.caf
- vc~ended.caf
- vc~invitation-accepted.caf
- vc~ringing.caf
- vc~ringing_watch.caf
- VoiceOver_Click_Haptic.caf
- WalkieTalkieActiveEnd_Haptic.caf
- WalkieTalkieActiveStart_Haptic.caf
- WalkieTalkieReceiveEnd_Haptic.caf
- WalkieTalkieReceiveStart_Haptic.caf
- warsaw.caf
- Warsaw_Haptic.caf
- wheels_of_time.caf
- WorkoutComplete_Haptic.caf
- WorkoutCompleteAutoDetect.caf
- WorkoutCountdown_Haptic.caf
- WorkoutPaceAbove.caf
- WorkoutPaceBelow.caf
- WorkoutPaused_Haptic.caf
- WorkoutPressStart_Haptic.caf
- WorkoutResumed_Haptic.caf
- WorkoutResumedAutoDetect.caf
- WorkoutSaved_Haptic.caf
- WorkoutSelect_Haptic.caf
- WorkoutStartAutoDetect.caf
- US-EN-Alexa-Back-Door-Opened.wav
- US-EN-Alexa-Back-Door-Unlocked.wav
- US-EN-Alexa-Basement-Door-Opened.wav
- US-EN-Alexa-Basement-Door-Unlocked.wav
- US-EN-Alexa-Boyfriend-Is-Arriving.wav
- US-EN-Alexa-Daughter-Is-Arriving.wav
- US-EN-Alexa-Front-Door-Opened.wav
- US-EN-Alexa-Front-Door-Unlocked.wav
- US-EN-Alexa-Garage-Door-Opened.wav
- US-EN-Alexa-Girlfriend-Is-Arriving.wav
- US-EN-Alexa-Good-Morning.wav
- US-EN-Alexa-Good-Night.wav
- US-EN-Alexa-Husband-Is-Arriving.wav
- US-EN-Alexa-Mail-Has-Arrived.wav
- US-EN-Alexa-Motion-At-Back-Door.wav
- US-EN-Alexa-Motion-At-Front-Door.wav
- US-EN-Alexa-Motion-Detected-Generic.wav
- US-EN-Alexa-Motion-In-Back-Yard.wav
- US-EN-Alexa-Motion-In-Basement.wav
- US-EN-Alexa-Motion-In-Front-Yard.wav
- US-EN-Alexa-Motion-In-Garage.wav
- US-EN-Alexa-Patio-Door-Opened.wav
- US-EN-Alexa-Patio-Door-Unlocked.wav
- US-EN-Alexa-Smoke-Detected-Generic.wav
- US-EN-Alexa-Smoke-Detected-In-Basement.wav
- US-EN-Alexa-Smoke-Detected-In-Garage.wav
- US-EN-Alexa-Smoke-Detected-In-Kitchen.wav
- US-EN-Alexa-Son-Is-Arriving.wav
- US-EN-Alexa-Water-Detected-Generic.wav
- US-EN-Alexa-Water-Detected-In-Basement.wav
- US-EN-Alexa-Water-Detected-In-Garage.wav
- US-EN-Alexa-Water-Detected-In-Kitchen.wav
- US-EN-Alexa-Welcome-Home.wav
- US-EN-Alexa-Wife-Is-Arriving.wav
- US-EN-Daisy-Back-Door-Motion.wav
- US-EN-Daisy-Back-Door-Open.wav
- US-EN-Daisy-Front-Door-Motion.wav
- US-EN-Daisy-Front-Door-Open.wav
- US-EN-Daisy-Front-Window-Open.wav
- US-EN-Daisy-Garage-Door-Open.wav
- US-EN-Daisy-Guest-Bath-Leak.wav
- US-EN-Daisy-Kitchen-Sink-Leak.wav
- US-EN-Daisy-Kitchen-Window-Open.wav
- US-EN-Daisy-Laundry-Room-Leak.wav
- US-EN-Daisy-Master-Bath-Leak.wav
- US-EN-Daisy-Master-Bedroom-Window-Open.wav
- US-EN-Daisy-Office-Window-Open.wav
- US-EN-Daisy-Refrigerator-Leak.wav
- US-EN-Daisy-Water-Heater-Leak.wav
- US-EN-Morgan-Freeman-Back-Door-Closed.wav
- US-EN-Morgan-Freeman-Back-Door-Locked.wav
- US-EN-Morgan-Freeman-Back-Door-Opened.wav
- US-EN-Morgan-Freeman-Back-Door-Unlocked.wav
- US-EN-Morgan-Freeman-Basement-Door-Closed.wav
- US-EN-Morgan-Freeman-Basement-Door-Locked.wav
- US-EN-Morgan-Freeman-Basement-Door-Opened.wav
- US-EN-Morgan-Freeman-Basement-Door-Unlocked.wav
- US-EN-Morgan-Freeman-Boss-Is-Arriving.wav
- US-EN-Morgan-Freeman-Boyfriend-Is-Arriving.wav
- US-EN-Morgan-Freeman-Cleaning-Supplies-Closet-Opened.wav
- US-EN-Morgan-Freeman-Coworker-Is-Arriving.wav
- US-EN-Morgan-Freeman-Daughter-Is-Arriving.wav
- US-EN-Morgan-Freeman-Friend-Is-Arriving.wav
- US-EN-Morgan-Freeman-Front-Door-Closed.wav
- US-EN-Morgan-Freeman-Front-Door-Locked.wav
- US-EN-Morgan-Freeman-Front-Door-Opened.wav
- US-EN-Morgan-Freeman-Front-Door-Unlocked.wav
- US-EN-Morgan-Freeman-Garage-Door-Closed.wav
- US-EN-Morgan-Freeman-Garage-Door-Opened.wav
- US-EN-Morgan-Freeman-Girlfriend-Is-Arriving.wav
- US-EN-Morgan-Freeman-Good-Morning.wav
- US-EN-Morgan-Freeman-Good-Night.wav
- US-EN-Morgan-Freeman-Liquor-Cabinet-Opened.wav
- US-EN-Morgan-Freeman-Motion-Detected.wav
- US-EN-Morgan-Freeman-Motion-In-Basement.wav
- US-EN-Morgan-Freeman-Motion-In-Bedroom.wav
- US-EN-Morgan-Freeman-Motion-In-Game-Room.wav
- US-EN-Morgan-Freeman-Motion-In-Garage.wav
- US-EN-Morgan-Freeman-Motion-In-Kitchen.wav
- US-EN-Morgan-Freeman-Motion-In-Living-Room.wav
- US-EN-Morgan-Freeman-Motion-In-Theater.wav
- US-EN-Morgan-Freeman-Motion-In-Wine-Cellar.wav
- US-EN-Morgan-Freeman-Patio-Door-Closed.wav
- US-EN-Morgan-Freeman-Patio-Door-Locked.wav
- US-EN-Morgan-Freeman-Patio-Door-Opened.wav
- US-EN-Morgan-Freeman-Patio-Door-Unlocked.wav
- US-EN-Morgan-Freeman-Roommate-Is-Arriving.wav
- US-EN-Morgan-Freeman-Searching-For-Car-Keys.wav
- US-EN-Morgan-Freeman-Setting-The-Mood.wav
- US-EN-Morgan-Freeman-Smartthings-Detected-A-Flood.wav
- US-EN-Morgan-Freeman-Smartthings-Detected-Carbon-Monoxide.wav
- US-EN-Morgan-Freeman-Smartthings-Detected-Smoke.wav
- US-EN-Morgan-Freeman-Smoke-Detected-In-Basement.wav
- US-EN-Morgan-Freeman-Smoke-Detected-In-Garage.wav
- US-EN-Morgan-Freeman-Smoke-Detected-In-Kitchen.wav
- US-EN-Morgan-Freeman-Someone-Is-Arriving.wav
- US-EN-Morgan-Freeman-Son-Is-Arriving.wav
- US-EN-Morgan-Freeman-Starting-Movie-Mode.wav
- US-EN-Morgan-Freeman-Starting-Party-Mode.wav
- US-EN-Morgan-Freeman-Starting-Romance-Mode.wav
- US-EN-Morgan-Freeman-Turning-Off-All-The-Lights.wav
- US-EN-Morgan-Freeman-Turning-Off-The-Air-Conditioner.wav
- US-EN-Morgan-Freeman-Turning-Off-The-Bar-Lights.wav
- US-EN-Morgan-Freeman-Turning-Off-The-Chandelier.wav
- US-EN-Morgan-Freeman-Turning-Off-The-Family-Room-Lights.wav
- US-EN-Morgan-Freeman-Turning-Off-The-Hallway-Lights.wav
- US-EN-Morgan-Freeman-Turning-Off-The-Kitchen-Light.wav
- US-EN-Morgan-Freeman-Turning-Off-The-Light.wav
- US-EN-Morgan-Freeman-Turning-Off-The-Lights.wav
- US-EN-Morgan-Freeman-Turning-Off-The-Mood-Lights.wav
- US-EN-Morgan-Freeman-Turning-Off-The-TV.wav
- US-EN-Morgan-Freeman-Turning-On-The-Air-Conditioner.wav
- US-EN-Morgan-Freeman-Turning-On-The-Bar-Lights.wav
- US-EN-Morgan-Freeman-Turning-On-The-Chandelier.wav
- US-EN-Morgan-Freeman-Turning-On-The-Family-Room-Lights.wav
- US-EN-Morgan-Freeman-Turning-On-The-Hallway-Lights.wav
- US-EN-Morgan-Freeman-Turning-On-The-Kitchen-Light.wav
- US-EN-Morgan-Freeman-Turning-On-The-Light.wav
- US-EN-Morgan-Freeman-Turning-On-The-Lights.wav
- US-EN-Morgan-Freeman-Turning-On-The-Mood-Lights.wav
- US-EN-Morgan-Freeman-Turning-On-The-TV.wav
- US-EN-Morgan-Freeman-Vacate-The-Premises.wav
- US-EN-Morgan-Freeman-Water-Detected-In-Basement.wav
- US-EN-Morgan-Freeman-Water-Detected-In-Garage.wav
- US-EN-Morgan-Freeman-Water-Detected-In-Kitchen.wav
- US-EN-Morgan-Freeman-Welcome-Home.wav
- US-EN-Morgan-Freeman-Wife-Is-Arriving.wav
custom_value: true
multiple: false
data_ios_sound_volumelevel:
name: iOS Only - Sound Volume Level (Optional)
description: The volume level of notification, were 1 equal to 100% volume. It requires iOS only - Sounds to be defined.
required: false
example: 0.5
selector:
number:
min: 0
max: 1
mode: slider
step: 0.05
data_ios_badge:
name: iOS Only - Badge (Optional)
required: false
description: Set the app icon badge in the payload. It will make the app icon badge show the number
example: 5
selector:
number:
min: 0
max: 20
step: 1
mode: slider
data_ios_interruption_level:
name: iOS Only - Interruption Level (Optional)
required: false
description: Set the interruption level of a notification
example: active
selector:
select:
options:
- passive
- active
- time-sensitive
- critical
custom_value: false
multiple: false
data_ios_presentation_options:
name: iOS Only - Presentation Options (Optional)
required: false
description: By default, if the app is open (in the foreground) when a notification arrives, it will display the same as when the app is not active (in the background), with a visual alert showing notification contents, a badge update (if one was sent in the notification) and the sound of your choice.
example: "[alert,badge]"
selector:
select:
options:
- alert
- badge
- sound
custom_value: false
multiple: true
data_camera:
name: Camera (Optional)
description: The camera which creates the snapshot
required: false
selector:
entity:
domain: camera
data_clickaction:
name: Entity ID to navigate to (Optional)
description: The Entity to navigate to when clicking on the notification
required: false
selector:
entity: null
data_clickaction_url:
name: URL to navigate to (Optional)
description: The URL to navigate to when clicking on the notification (custom values allowed)
required: false
example: /lovelace/
selector:
select:
options:
- /lovelace/
- Enter an custom value
- "app://com.twitter.android"
- "settings://notification_history"
- "intent://scan/#Intent;scheme=zxing;package=com.google.zxing.client.android;end"
- "deep-link://example://link/to/content"
custom_value: true
multiple: false
data_actions:
name: Custom Actions (Optional)
example: |-
- action: "ALARM" # The key you are sending for the event
title: "Sound Alarm" # The button title
- action: "URI" # Must be set to URI if you plan to use a URI
title: "Open Url"
uri: "https://google.com" # URL to open when action is selected, can also be a lovelace view/dashboard
description: See https://companion.home-assistant.io/docs/notifications/actionable-notifications#building-actionable-notifications
required: false
selector:
object: null
sequence:
- variables:
all_devices: >-
{% if notify_devices is defined %}
{# If the user uses the field "notify_devices" then use that/those device(s) #}
{{ notify_devices }}
{% else %}
{# If the user does not use the field "notify_devices" then find the device_tracker(s) that use the integration mobile_app #}
{% set ns_devices=namespace( device_id=[] ) %}
{% for e in (integration_entities("mobile_app")|select("search","device_tracker")|list) %}
{% set ns_devices.device_id=ns_devices.device_id+[device_id(e)] %}
{% endfor %}
{{ ns_devices.device_id }}
{% endif %}
notify_devices_home: >-
{# filter "all_devices" whether those that have the state "home" #}
{% set ns_devices=namespace( device_id=[] ) %}
{% for device_id in all_devices %}
{% if states((device_entities(device_id)|select("search","device_tracker")|list)[0]) == "home" %}
{% set ns_devices.device_id=ns_devices.device_id + [device_id] %}
{% endif %}
{% endfor %}
{{ ns_devices.device_id }}
notify_devices_away: >-
{# filter "all_devices" whether those that do not have the state "home" #}
{% set ns_devices=namespace( device_id=[]) %}
{% for device_id in all_devices %}
{% if states((device_entities(device_id)|select("search","device_tracker")|list)[0]) != "home" %}
{% set ns_devices.device_id=ns_devices.device_id + [device_id] %}
{% endif %}
{% endfor %}
{{ ns_devices.device_id }}
notify_devices: >-
{% if notify_home_or_away is not defined or notify_home_or_away not in ["Home","Away","Both"] %}
{% set notify_home_or_away="Both" %}
{% endif %}
{# Finally, let the value "notify_home_or_away" control which list should used #}
{% if notify_home_or_away == "Home" %}{{ notify_devices_home }}{% endif %}
{% if notify_home_or_away == "Away" %}{{ notify_devices_away }}{% endif %}
{% if notify_home_or_away == "Both" %}{{ all_devices }}{% endif %}
- repeat:
for_each: "{{notify_devices}}"
sequence:
- variables:
entity_id: >-
{{((device_entities(repeat.item)|select("search","device_tracker")|list)[0])}}
manufacturer: '{{device_attr(repeat.item,"manufacturer")}}'
service: notify.mobile_app_{{entity_id|replace("device_tracker.","")}}
device_name: '{{device_attr(repeat.item,"name")}}'
do_not_disturb: >-
{# ============== #}
{# IN DEVELOPMENT #}
{# ============== #}
{# Usefull for a condition to skip the notification #}
{# It requires the following entities of the device to be enabled: #}
{# -------------- #}
{# Apple #}
{# -------------- #}
{# * binary_sensor.<device>_focus = off/on #}
{# -------------- #}
{# Android #}
{# -------------- #}
{# * sensor.<device>_ringer_mode = normal/vibrate #}
{# * sensor.<device>_do_not_disturb_sensor = off/priority_only #}
{# * sensor.<device>_audio_mode = normal/in_call #}
{# * binary_sensor.<device>_music_active = off/on #}
{# ============== #}
{% set entities=device_entities(repeat.item) %}
{% set ns=namespace(results=[]) %}
{# build a list of true and false statements #}
{% if manufacturer == "Apple" %}
{# -------------- #}
{# Apple #}
{# -------------- #}
{# check if the entity_id binary_sensor.<device>_focus is enabled #}
{% if(entities|select("search","_focus")|list|count==1) %}
{# binary_sensor.<device>_focus = off/on #}
{% set setfocus=states((entities|select("search","_focus")|list)[0]) %}
{% set ns.results=ns.results+[(focus=="on")] %}
{% endif %}
{% else %}
{# -------------- #}
{# Android #}
{# -------------- #}
{# check if the entity_id sensor.<device>_ringer_mode is enabled #}
{% if (entities|select("search","_ringer_mode")|list|count==1) %}
{% set ringer_mode=states((entities|select("search","_ringer_mode")|list)[0]) %}
{% set ns.results=ns.results+[(ringer_mode!="normal")] %}
{% endif%}
{# check if the entity_id sensor.<device>_do_not_disturb_sensor is enabled #}
{% if (entities|select("search","_do_not_disturb_sensor")|list|count==1) %}
{% set do_not_disturb_sensor=states((entities|select("search","_do_not_disturb_sensor")|list)[0]) %}
{% set ns.results=ns.results+[(do_not_disturb_sensor!="off")] %}
{% endif%}
{# check if the entity_id sensor.<device>_audio_mode is enabled #}
{% if (entities|select("search","_audio_mode")|list|count==1) %}
{% set audio_mode=states((entities|select("search","_audio_mode")|list)[0]) %}
{% set ns.results=ns.results+[(audio_mode!="normal")] %}
{% endif %}
{# check if the entity_id binary_sensor.<device>_music_active is enabled #}
{% if (entities|select("search","_music_active")|list|count==1) %}
{% set music_active=states((entities|select("search","_music_active")|list)[0]) %}
{% set ns.results=ns.results+[(music_active=="on")] %}
{% endif %}
{% endif %}
{# from the list of true and false statements only check the true statements #}
{# if there are true statements then it results in true otherwise false #}
{{ns.results|select("equalto",True)|list|count>0}}
- variables:
servicedata: >-
- variables:
servicedata: >-
{# object which stores all options -#}
{%- set ns=namespace(servicedata=[],data=[],push=[],sound=[],actions=[],hex_color="#") -%}
{#- https://companion.home-assistant.io/docs/notifications/notifications-basic/#notification-channels -#}
{%- if data_channel is defined -%}
{%- set ns.data=ns.data+[("channel",data_channel)] -%}
{%- endif -%}
{#- https://companion.home-assistant.io/docs/notifications/notifications-basic/#text-to-speech-notifications -#}
{%- if notify_title is defined and (notify_message|upper)=="TTS" -%}
{%- set ns.data=ns.data+[("tts_text",notify_title)] -%}
{%- endif -%}
{#- By default Text To Speech notifications use the music stream so they will bypass the ringer mode on the device as long as the device's volume is not set to 0. You have the option of using media_stream: alarm_stream to have your notification spoken regardless of music volume. -#}
{%- if data_device_ring is defined and (data_device_ring|lower) in ["on","max"] -%}
{%- set data_importance="high" -%}
{#- https://companion.home-assistant.io/docs/notifications/critical-notifications#android-text-to-speech-alarm-stream -#}
{%- if (data_device_ring|lower)=="on" and (notify_message|upper)=="TTS" -%}
{%- set ns.data=ns.data+[("media_stream","alarm_stream")] -%}
{%- endif -%}
{%- if (data_device_ring|lower)=="on" and (notify_message|upper)!="TTS" -%}
{%- set ns.data=ns.data+[("channel","alarm_stream")] -%}
{%- endif -%}
{#- https://companion.home-assistant.io/docs/notifications/critical-notifications#android-text-to-speech-alarm-stream-max-volume -#}
{%- if (data_device_ring|lower)=="max" and (notify_message|upper)=="TTS" -%}
{%- set ns.data=ns.data+[("media_stream","alarm_stream_max")] -%}
{%- set data_importance="max" -%}
{%- endif -%}
{%- endif -%}
{#- https://companion.home-assistant.io/docs/notifications/notifications-basic#notification-icon -#}
{#- making sure that the value contains mdi: , otherwise skipping -#}
{%- if manufacturer!="Apple" and data_notification_icon is defined and ([data_notification_icon]|select("search","mdi:")|list)|count==1 -%}
{%- set ns.data=ns.data+[("notification_icon",data_notification_icon)] -%}
{%- endif -%}
{#- https://companion.home-assistant.io/docs/notifications/notifications-basic#grouping -#}
{%- if data_group is defined -%}
{%- set ns.data=ns.data+[("group",data_group)] -%}
{%- endif -%}
{#- https://companion.home-assistant.io/docs/notifications/notifications-basic#replacing -#}
{%- if data_tag is defined -%}
{%- set ns.data=ns.data+[("tag",data_tag)] -%}
{%- endif -%}
{%- if manufacturer!="Apple" and data_persistent is defined -%}
{#- https://companion.home-assistant.io/docs/notifications/notifications-basic#persistent-notification -#}
{#- making sure that an boolean is specified, otherwise skipping -#}
{%- if data_persistent is boolean -%}
{%- set data_persistent=bool(data_persistent,false) -%}
{%- set ns.data=ns.data+[("persistent",data_persistent)] -%}
{%- endif -%}
{#- Clearing persistant notifications require you to define a tag (value does not matter). If the user forgets to set the tag then the default value will be: "persistent" -#}
{%- if bool(data_persistent,false)==true and data_tag is not defined -%}
{%- set ns.data=ns.data+[("tag","persistent")] -%}
{%- endif -%}
{%- endif -%}
{%- if data_tag is defined and data_tag=="persistent" and (notify_message|lower)!="clear_notification" -%}
{%- set ns.data=ns.data+[("persistent",true)] -%}
{%- endif -%}
{#- https://companion.home-assistant.io/docs/notifications/notifications-basic/#subtitle--subject -#}
{%- if data_subtitle is defined -%}
{%- if manufacturer=="Apple" -%}
{#- Apple uses "subtitle" -#}