-
Notifications
You must be signed in to change notification settings - Fork 86
/
Stable.yaml
1444 lines (1426 loc) · 73.1 KB
/
Stable.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: Frigate Notifications (0.12.0.4e)
author: SgtBatten
homeassistant:
min_version: 2024.6.0
description: |
## Frigate Notifications
This blueprint will send a notification to your device when a Frigate event for the selected camera is fired. The notification will initially include the thumbnail of the detection, but include an actionable notification allowing you to view the clip and snapshot.
With this blueprint, you may send the notification to multiple devices by leaving "Device" blank and instead use a [notification group][1].
### Software Version Requirements
- Minimum Home Assistant Version: 2022.2
- Minimum Frigate Version: 0.11.0
- Minimum Frigate Integration Version: 3.0.0
- **Note:** "Enable the unauthenticated notification event proxy" must be ticked during setup
- An MQTT broker connected to Home Assistant and Frigate.
- Minimum iOS Version: 15.0
### Required entities:
- Frigate Camera Name
- Mobile Device (Running HA Companion App)
### Features:
- Easily select the camera entity or mobile device using a drop-down menu.
- Send notifications to an Android or iOS mobile device or a TV.
- or a group containing any combination of the above.
- for TV Alerts, you need to install and configure https://www.home-assistant.io/integrations/nfandroidtv/
- Configure the title and message of the notification.
- Dynamically handle things like object type, zones, and face detection from doubletake.
- Automatically handle some common errors like case matching and bad URLs etc.
- Optionally send the notification as a critical alert. (Critical)
- Optionally limit playing audio for secondary notification updates, and on iOS, customise the sound. (Alert Once)
- Choose whether or not to update the notification with new thumbnails as they become available.
- Customise the notification colour and icon.
- Optionally send a live view to iOS.
- Configure custom notification channels on Android.
- Specify which [zones][2] to be notified about. (Zone Filter)
- Choose between enforcing all required zones simultaneously or any one zone.
- Specify what type of [objects][3] to be notified about. (Object Filter)
- Disable notifications if a presence entity or group is "home". (Presence Filter)
- Limit notifications based on the state of another entity. (State Filter)
- Limit notifications to certain hours of the day. (Time Filter)
- Configure a cooldown for the camera to reduce the number of notifications when back-to-back events occur.
- Silence future notifications for a defined amount of time through actionable notifications. This is helpful in situations where you know you will be triggering detections for an extended period of time. i.e. kids playing outside.
- Set a loitering timer to notify you of stationary objects that remain for a set time.
- Configure what happens when you tap the notification. (Tap Action)
- Configure 3 action buttons to open almost anything. (defaults are: View Clip, View Snapshot, and Silence New Notifications)
- Configure the size, transparency, position, and duration of TV notifications.
- Debug option to help with troubleshooting.
- Support for multiple Frigate instances by specifying the ClientID and MQTT topic.
- Optional delay to the initial notification to see if it resolves the no attached image issue.
- Live view on iOS.
- Android option: Sticky as per https://community.home-assistant.io/t/frigate-mobile-app-notifications/311091/1043
- Add 5s delay to the final notification update to ensure Frigate has time to save snapshot edits (crop, bounding box, etc.) if "update thumbnail" is enabled.
- Add Video (gif) option to Android which will be sent 5 seconds after the event ends.
- Subtitle support.
- Video for iOS sent 5 seconds after the event ends.
- Set custom entity for iOS live view.
- Set Icons for Action Buttons on iOS.
- Strip trailing underscores and numbers from the camera name. (This will break automation for anyone whose Frigate cam ends in _x.)
- Android Auto option.
- Custom Filter.
- Customise group on mobile devices.
- Bounding box and crop options for attachment.
- Set notification volume on iOS
- Integrates with Double Take to replace object labels with names if a face is matched.
[1]: https://companion.home-assistant.io/docs/notifications/notifications-basic#sending-notifications-to-multiple-devices
[2]: https://blakeblackshear.github.io/frigate/configuration/cameras#zones
[3]: https://blakeblackshear.github.io/frigate/configuration/objects
## Support
Go to https://github.com/SgtBatten/HA_blueprints to report bugs, request new features, or get support with your configuration.
domain: automation
source_url: https://github.com/SgtBatten/HA_blueprints/blob/main/Frigate_Camera_Notifications/Stable.yaml
input:
camera:
name: Frigate Camera
description: |
Select the camera entity that will trigger notifications.
If you do not see cameras listed in the drop-down, check you have the Frigate integration installed.
Note: The automation relies on the Frigate camera name matching the entity id in Home Assistant. It will automatically strip "_x" from the end of the entity id where x is a number If your camera name in frigate ends in _x you need to manually edit the yaml of this automation to add it twice e.g camera.front_1_1.
selector:
entity:
integration: frigate
domain: camera
device_class: camera
notify_device:
name: Mobile Device
description: Select a device that runs the official Home Assistant app to receive notifications. If you wish to notify a group of devices and/or Android/Fire TV use the field below to override this selection. This will be ignored in that case but is still required.
default: false
selector:
device:
integration: mobile_app
notify_group:
name: Notification Group or Android/Fire TV (Optional)
description: |
The name of the group or individual TV to send notifications to.
If set, this will override the individual devices above.
Note: If the group contains both mobile devices and TVs, the TV will not display the snapshot unless "TV notifications" is set to true. However, this will stop Android phones from receiving thumbnails.
default: ""
base_url:
name: Base URL (Optional)
description: |
The external URL for your Home Assistant instance.
Recommended for iOS and required for Android/Fire TV.
Must include the scheme i.e http:// or https://
Examples: http://192.168.1.25:8123 https://homeassistant.mydomain.com
default: ""
mqtt_topic:
name: MQTT Topic (Advanced)
description: The MQTT topic Frigate sends messages in.
default: frigate/events
client_id:
name: Client ID (Optional-Advanced)
description: Used to support multiple instances of Frigate. Leave blank if you don't know what to do.
default: ""
notification_customisations:
name: |
# Notification Customisations
description: These are Notification Customisation Options
icon: mdi:bell
collapsed: true
input:
title:
name: Notification Title (Optional)
description: The title of the notification.
default: ""
message:
name: Notification Message
description: |
The message of the notification.
You can use variables such as {{camera_name}} and {{label}}
e.g., A {{ label }} {{ 'is loitering' if loitering else 'was detected' }} on the {{ camera_name }} camera.
default: A {{ label }} {{ 'is loitering' if loitering else 'was detected' }} on the {{ camera_name }} camera.
selector:
select:
options:
- label: "Default: e.g., A Person was detected on the Side camera."
value: "A {{ label }} {{ 'is loitering' if loitering else 'was detected' }} on the {{ camera_name }} camera."
- label: "Short: e.g., Person detected - Side"
value: "{{ label }} detected - {{ camera_name }}"
- label: "Short with a timestamp HH:MM"
value: "{{ label }} detected - {{ camera_name }} at {{event['after']['start_time']|timestamp_custom('%H:%M')}}"
- label: "Long: e.g., A Person was detected on the Side camera in the driveway."
value: "A {{ label }} {{ 'is loitering' if loitering else 'was detected' }} on the {{ camera_name }} camera{% if enteredzones %} in the {{ enteredzones | join(', ') | replace('_',' ') }}{% endif %}."
- label: "Long with a timestamp HH:MM"
value: "A {{ label }} {{ 'is loitering' if loitering else 'was detected' }} on the {{ camera_name }} camera{% if enteredzones %} in the {{ enteredzones | join(', ') | replace('_',' ') }}{% endif %} at {{event['after']['start_time']|timestamp_custom('%H:%M')}}."
custom_value: true
update_sub_label:
name: Update Sub Label (Advanced)
description: |
Update the title and/or message with the matched face name and trigger a notification update.
Requires face detection to be configured (Advanced). Requires Title and/or Message to contain 'A Person' or 'A {{ label }}'
default: true
selector:
boolean:
subtitle:
name: Subtitle
description: A secondary heading you can use in your notifications.
default: ""
critical:
name: Critical Notification (Optional)
description: |
Send as a critical notification to the mobile device. This will ignore silent/vibrate modes.
You can choose to limit critical notifications to certain times using a template (some examples are provided but you can enter your own as long as it outputs true or false)
default: "false"
selector:
select:
options:
- "false"
- "true"
- "{{'false' if now().hour in [8,9,10,11,12,13,14,15,16,17,18] else 'true'}}"
- "{{'true' if is_state('sun.sun', 'above_horizon') else 'false' }}"
- "{{ event['after']['top_score'] |float(0) > 0.8 }}"
custom_value: true
alert_once:
name: Alert Once (Optional)
description: Only the first notification for each event will play a sound. Updates, including new thumbnails, will be silent. iOS users who use Critical Notifications above will still hear default critical sounds for updates.
default: false
selector:
boolean:
attachment:
name: Attachment
description: |
Choose which image to attach to the notification.
Note: TVs will always get sent the snapshot if TV is true
default: thumbnail.jpg
selector:
select:
options:
- label: Thumbnail
value: thumbnail.jpg
- label: Snapshot
value: snapshot.jpg
- label: Snapshot with bounding box
value: snapshot.jpg?bbox=1
- label: Snapshot cropped
value: snapshot.jpg?crop=1
- label: Snapshot cropped with bounding box
value: snapshot.jpg?bbox=1&crop=1
mode: dropdown
update_thumbnail:
name: Update Image (Optional)
description: Update the notification if a new "better" image is available.
default: false
selector:
boolean:
video:
name: Video (Optional)
description: You can optionally attach the clip to the notification which will replace the thumbnail/snapshot above, if available.
default: ""
selector:
select:
options:
- label: None
value: ""
- label: Clip
value: "{{base_url}}/api/frigate{{client_id}}/notifications/{{id}}/{{camera}}/clip.mp4"
color:
name: Notification Color - Android/TV only (Optional)
description: Set the color of the notification on your Android mobile device or TV.
default: "#03a9f4"
selector:
select:
options:
- label: Primary (Steelblue)
value: "#03a9f4"
- label: Red
value: "#f44336"
- label: Pink
value: "#e91e63"
- label: Purple
value: "#926bc7"
- label: Deep Purple
value: "#6e41ab"
- label: Indigo
value: "#3f51b5"
- label: Blue
value: "#2196f3"
- label: Light Blue
value: "#03a9f4"
- label: Cyan
value: "#00bcd4"
- label: Teal
value: "#009688"
- label: Green
value: "#4caf50"
- label: Light Green
value: "#8bc34a"
- label: Lime
value: "#cddc39"
- label: Yellow
value: "#ffeb3b"
- label: Amber
value: "#ffc107"
- label: Orange
value: "#ff9800"
- label: Deep Orange
value: "#ff5722"
- label: Brown
value: "#795548"
- label: Light Grey
value: "#bdbdbd"
- label: Grey
value: "#9e9e9e"
- label: Dark Grey
value: "#606060"
- label: Blue Grey
value: "#607d8b"
- label: Black
value: "#000000"
- label: White
value: "#ffffff"
icon:
name: Notification Icon (Optional)
description: Change the icon that displays on the notification. You can enter a single icon or create a template like the example given in the dropdown. You must include 'mdi:' in the icon name.
default: mdi:homeassistant
selector:
select:
options:
- mdi:homeassistant
- mdi:cctv
- "mdi:{{'account-outline' if label == 'Person' else 'dog' if label == 'Dog' else 'cat' if label == 'Cat' else 'car' if label == 'Car' else 'home-assistant'}}"
custom_value: true
group:
name: Group
description: The group name that will determine if notifications are grouped on your mobile device. If you want notifications grouped by camera, ensure it contains {{camera}}
default: "{{camera}}-frigate-notification{{'-loitering' if loitering}}"
sound:
name: Notification Sound - iOS only (Optional)
description: You can specify a sound file on your device that will play for the notifications. You will need to import the sound file into Home Assistant.
default: default
selector:
select:
options:
- default
- none
custom_value: true
volume:
name: Volume Sound - iOS only (Optional)
description: You can specify a sound level between 0 and 100
default: 100
selector:
number:
max: 100
min: 0
unit_of_measurement: "%"
step: 1
mode: slider
ios_live_view:
name: Live View Entity - iOS only (Optional)
description: Attach a live view from the selected entity to the notification for iOS devices.
default: ""
selector:
entity:
domain: camera
android_auto:
name: Android Auto
description: Show the notification on Android Auto if the receiving device is connected.
default: false
selector:
boolean:
sticky:
name: Sticky - Android only (Optional)
description: |
When enabled, the notification will stay active on the device after tapping it and remain there until cleared.
default: false
selector:
boolean:
channel:
name: Notification Channel - Android only (Optional)
description: Create a new channel for notifications to allow custom notification sounds, vibration patterns, and override of Do Not Disturb mode. Configured directly on the device.
default: ""
filters:
name: |
# Filters
description: These are Filter Options
icon: mdi:filter
collapsed: true
input:
zone_filter:
name: Zone Filter on/off (Optional)
description: Enable to only notify if an object has entered a zone listed below.
default: false
selector:
boolean:
zones:
name: Required Zones (Optional - Enabled Above)
description: |
Enter the name of one zone at a time. It must be lowercase and include underscores as per your Frigate config.
By default any zone is acceptable. If you desire ALL listed zones to be entered before getting a notification, enable the multi toggle below.
default: []
selector:
select:
options:
- examples
- porch
- front_door
- side
- garden
multiple: true
custom_value: true
zone_multi:
name: Multi-Zone (Optional)
description: Require all zones specified above to be entered, instead of any listed zone. Zone Filter must be enabled also.
default: false
selector:
boolean:
labels:
name: Object Filter (Optional)
description: |
Specify objects you wish to be notified about. Enter or select one object at a time.
default: ""
selector:
select:
options:
- person
- dog
- cat
- car
- package
- bird
multiple: true
custom_value: true
presence_filter:
name: Presence Filter (Optional)
description: Only notify if ALL of the selected presence entities are not "home".
default: ""
selector:
entity:
filter:
domain:
- device_tracker
- person
- group
multiple: true
state_filter:
name: State Filter on/off (Optional)
description: Enable the two State Filter settings below. Only notify if the selected entity is in the specified states.
default: false
selector:
boolean:
state_entity:
name: State Filter Entity (Optional)
description: Only notify if the selected entity is in the below state. You must enable "State Filter" above to use this.
default: ""
selector:
entity:
state_filter_states:
name: State Filter States (Optional)
description: Enter the states that the above entity must be in, one at a time.
default: []
selector:
select:
options: []
multiple: true
custom_value: true
disable_times:
name: Time Filter (Optional)
description: Prevent notifications from being sent during the specified hours
default: []
selector:
select:
multiple: true
options:
- label: 00:00 - 00:59
value: "0"
- label: 01:00 - 01:59
value: "1"
- label: 02:00 - 02:59
value: "2"
- label: 03:00 - 03:59
value: "3"
- label: 04:00 - 04:59
value: "4"
- label: 05:00 - 05:59
value: "5"
- label: 06:00 - 06:59
value: "6"
- label: 07:00 - 07:59
value: "7"
- label: 08:00 - 08:59
value: "8"
- label: 09:00 - 09:59
value: "9"
- label: 10:00 - 10:59
value: "10"
- label: 11:00 - 11:59
value: "11"
- label: 12:00 - 12:59
value: "12"
- label: 13:00 - 13:59
value: "13"
- label: 14:00 - 14:59
value: "14"
- label: 15:00 - 15:59
value: "15"
- label: 16:00 - 16:59
value: "16"
- label: 17:00 - 17:59
value: "17"
- label: 18:00 - 18:59
value: "18"
- label: 19:00 - 19:59
value: "19"
- label: 20:00 - 20:59
value: "20"
- label: 21:00 - 21:59
value: "21"
- label: 22:00 - 22:59
value: "22"
- label: 23:00 - 23:59
value: "23"
cooldown:
name: Cooldown (Optional)
description: Delay before sending another notification for this camera after the last event.
default: 30
selector:
number:
max: 86400
min: 0
unit_of_measurement: seconds
custom_filter:
name: Custom Filter (Optional - Advanced)
description: A filter that must result in true or false but can be templated as necessary. You will need to ensure it is enclosed with appropriate \"quotes\" and \{\{brackets\}\}.
default: true
silence_timer:
name: Silence New Object Notifications (Optional)
description: |
How long to silence notifications for this camera when requested as part of the actionable notification.
Note: This only applies to new objects. Existing tracked objects will not be affected.
default: 30
selector:
number:
max: 3600
min: 0
unit_of_measurement: minutes
loiter_timer:
name: Loitering Notifications (Optional)
description: >
Sends new loitering notification if a stationary object is detected for longer
than the specified time. 0 is off and will not send notifications.
default: 0
selector:
number:
max: 3600
min: 0
unit_of_measurement: seconds
initial_delay:
name: Delay initial notification (Optional)
description: |
How long to delay the first notification for each event.
Use this if you DO NOT use "update image" and are experiencing notifications without attached images. Start with small numbers.
default: 0
selector:
number:
max: 15
min: 0
unit_of_measurement: seconds
actions:
name: |
# Action Buttons and URLS
description: These are Action Buttons and URL Options
icon: mdi:gesture-double-tap
collapsed: true
input:
tap_action:
name: Tap Action URL
description:
The URL to open when tapping on the notification. Some presets are provided, you can also set your own by typing in the box.
These options define the text and URLs associated with the three action buttons at the bottom of the notification.
default: "{{base_url}}/api/frigate{{client_id}}/notifications/{{id}}/{{camera}}/clip.mp4"
selector:
select:
options:
- label: View Clip
value: "{{base_url}}/api/frigate{{client_id}}/notifications/{{id}}/{{camera}}/clip.mp4"
- label: View Snapshot
value: "{{base_url}}/api/frigate{{client_id}}/notifications/{{id}}/snapshot.jpg"
- label: View Stream
value: "{{base_url}}/api/camera_proxy_stream/camera.{{trigger.payload_json['after']['camera'] | lower | replace('-','_')}}?token={{state_attr( 'camera.' ~ camera, 'access_token')}}"
- label: Open Home Assistant (web)
value: "{{base_url}}/lovelace"
- label: Open Home Assistant (app)
value: /lovelace
- label: Open Frigate
value: /ccab4aaf_frigate/dashboard
- label: Open Frigate (Full Access)
value: /ccab4aaf_frigate-fa/dashboard
- label: Open Frigate (proxy)
value: /ccab4aaf_frigate-proxy/dashboard
- label: Open Reolink App (Android)
value: app://com.mcu.reolink
- label: Custom Action (Manual Trigger)
value: custom-{{ camera }}
custom_value: true
button_1:
name: Action Button 1 Text
description: 'The text used on the first Action button at the bottom of the notification. Set the URL below. (Default is "View Clip")'
default: "View Clip"
url_1:
name: Action Button 1 URL
description: Customise what happens when you press the first Action Button. Select from one of the preconfigured options or enter your own custom URL.
default: "{{base_url}}/api/frigate{{client_id}}/notifications/{{id}}/{{camera}}/clip.mp4"
selector:
select:
options:
- label: View Clip
value: "{{base_url}}/api/frigate{{client_id}}/notifications/{{id}}/{{camera}}/clip.mp4"
- label: View Snapshot
value: "{{base_url}}/api/frigate{{client_id}}/notifications/{{id}}/snapshot.jpg"
- label: View Stream
value: "{{base_url}}/api/camera_proxy_stream/camera.{{trigger.payload_json['after']['camera'] | lower | replace('-','_')}}?token={{state_attr( 'camera.' ~ camera, 'access_token')}}"
- label: Open Home Assistant (web)
value: "{{base_url}}/lovelace"
- label: Open Home Assistant (app)
value: /lovelace
- label: Open Frigate
value: /ccab4aaf_frigate/dashboard
- label: Open Frigate (Full Access)
value: /ccab4aaf_frigate-fa/dashboard
- label: Open Frigate (proxy)
value: /ccab4aaf_frigate-proxy/dashboard
- label: Open Reolink App (Android)
value: app://com.mcu.reolink
- label: Custom Action (Manual Trigger)
value: custom-{{ camera }}
custom_value: true
icon_1:
name: Action Button 1 icon - iOS Only
description: Customise the Icon on the first Action Button. Only the iOS SFSymbols library is supported, not mdi:icons. e.g., sfsymbols:bell
default: ""
button_2:
name: Action Button 2 Text
description: "The text used on the second Action button at the bottom of the notification. Set the URL below."
default: "View Snapshot"
url_2:
name: Action Button 2 URL
description: Customise what happens when you press the second Action Button. Select from one of the preconfigured options or enter your own custom URL.
default: "{{base_url}}/api/frigate{{client_id}}/notifications/{{id}}/snapshot.jpg"
selector:
select:
options:
- label: View Clip
value: "{{base_url}}/api/frigate{{client_id}}/notifications/{{id}}/{{camera}}/clip.mp4"
- label: View Snapshot
value: "{{base_url}}/api/frigate{{client_id}}/notifications/{{id}}/snapshot.jpg"
- label: View Stream
value: "{{base_url}}/api/camera_proxy_stream/camera.{{trigger.payload_json['after']['camera'] | lower | replace('-','_')}}?token={{state_attr( 'camera.' ~ camera, 'access_token')}}"
- label: Open Home Assistant (web)
value: "{{base_url}}/lovelace"
- label: Open Home Assistant (app)
value: /lovelace
- label: Open Frigate
value: /ccab4aaf_frigate/dashboard
- label: Open Frigate (Full Access)
value: /ccab4aaf_frigate-fa/dashboard
- label: Open Frigate (proxy)
value: /ccab4aaf_frigate-proxy/dashboard
- label: Open Reolink App (Android)
value: app://com.mcu.reolink
- label: Custom Action (Manual Trigger)
value: custom-{{ camera }}
custom_value: true
icon_2:
name: Action Button 2 icon - iOS Only
description: Customise the Icon on the second Action Button. Only the iOS SFSymbols library is supported, not mdi:icons. e.g., sfsymbols:bell
default: ""
button_3:
name: Action Button 3 Text
description: "The text used on the third Action button at the bottom of the notification. Set the URL below."
default: "Silence New Notifications"
url_3:
name: Action Button 3 URL
description: Customise what happens when you press the third Action Button. Select from one of the preconfigured options or enter your own custom URL.
default: silence-{{ camera }}
selector:
select:
options:
- label: Silence New Notifications
value: silence-{{ camera }}
- label: View Clip
value: "{{base_url}}/api/frigate{{client_id}}/notifications/{{id}}/{{camera}}/clip.mp4"
- label: View Snapshot
value: "{{base_url}}/api/frigate{{client_id}}/notifications/{{id}}/snapshot.jpg"
- label: View Stream
value: "{{base_url}}/api/camera_proxy_stream/camera.{{trigger.payload_json['after']['camera'] | lower | replace('-','_')}}?token={{state_attr( 'camera.' ~ camera, 'access_token')}}"
- label: Open Home Assistant (web)
value: "{{base_url}}/lovelace"
- label: Open Home Assistant (app)
value: /lovelace
- label: Open Frigate
value: /ccab4aaf_frigate/dashboard
- label: Open Frigate (Full Access)
value: /ccab4aaf_frigate-fa/dashboard
- label: Open Frigate (proxy)
value: /ccab4aaf_frigate-proxy/dashboard
- label: Open Reolink App (Android)
value: app://com.mcu.reolink
- label: Custom Action (Manual Trigger)
value: custom-{{ camera }}
custom_value: true
icon_3:
name: Action Button 3 icon - iOS Only
description: Customise the Icon on the third Action Button. Only the iOS SFSymbols library is supported, not mdi:icons. e.g., sfsymbols:bell
default: ""
custom_action_manual:
name: Custom Action (Manual Trigger)
description: Customisable action that you can trigger with the Custom Action buttons in the notification. Select Custom Action on any Action Button above.
selector:
action: {}
default: []
custom_action_auto:
name: Custom Action (Auto Trigger)
description: Customisable action that will trigger on the initial notification (subject to all other notification conditions).
selector:
action: {}
default: []
custom_action_auto_multi:
name: Custom Action (Auto Trigger in Loop)
description: Customisable action that will trigger on all subsequent notifications (subject to all other notification conditions). If you want it to also trigger on the initial notification, you must enter it in both input fields.
selector:
action: {}
default: []
tv_notifications:
name: |
# TV Notifications
description: These are TV Notification Options
icon: mdi:television
collapsed: true
input:
tv:
name: TV Notification (Optional)
description: Set to true if you are notifying an Android/Fire TV
Can also be used to prioritise snapshots on the TV over Android mobile apps when notifying a mixed device group.
Base URL must be set
The below settings are for TV notifications only
default: false
selector:
boolean:
tv_position:
name: TV Notification Position (Optional)
description: Set the position of the notification on your TV
default: center
selector:
select:
mode: dropdown
options:
- bottom-right
- bottom-left
- top-right
- top-left
- center
tv_size:
name: TV Notification Size (Optional)
description: Set the size of the notification on your TV.
default: large
selector:
select:
mode: dropdown
options:
- small
- medium
- large
- max
tv_duration:
name: TV Notification Duration (Optional)
description: The duration (in seconds) that the notification will display on your TV.
default: 10
selector:
number:
max: 300
min: 0
unit_of_measurement: seconds
tv_transparency:
name: TV notification Transparency (Optional)
description: Set the transparency of the notification on your TV.
default: 0%
selector:
select:
mode: dropdown
options:
- 0%
- 25%
- 50%
- 75%
- 100%
tv_interrupt:
name: TV Notification Interrupt (Optional)
description: "If set to true the notification is interactive and can be dismissed or selected to display more details. Depending on the running app (e.g., Netflix), this may stop playback."
default: false
selector:
boolean:
debug:
name: |
# DEBUG
description: These are DEBUG Options
icon: mdi:bug
collapsed: true
input:
debug:
name: Debug
description: |
# DEBUG
Enable to send debug messages to the home assistant logbook.
default: false
selector:
boolean:
mode: parallel
trigger_variables:
input_camera: !input camera
camera: "{{ input_camera | regex_replace('^camera\\.|_\\d+$', '') }}"
mqtt_topic: !input mqtt_topic
trigger:
- platform: mqtt
topic: "{{mqtt_topic}}"
payload: "{{ camera }}/new"
value_template: "{{ value_json['after']['camera'] | lower | replace('-','_') }}/{{ value_json['type']}}"
id: frigate-event
- platform: event
event_type: mobile_app_notification_action
event_data:
action: "silence-{{ camera }}"
id: silence
- platform: event
event_type: mobile_app_notification_action
event_data:
action: "custom-{{ camera }}"
id: custom
variables:
input_camera: !input camera
camera: "{{ input_camera | regex_replace('^camera\\.', '') }}"
camera_name: "{{ camera | replace('_', ' ') | title }}"
input_base_url: !input base_url
base_url: "{{ input_base_url.rstrip('/')}}"
update_sub_label: !input update_sub_label
input_client_id: !input client_id
client_id: "{{input_client_id if not input_client_id else '/' + input_client_id if '/' not in input_client_id else input_client_id }}"
attachment: !input attachment
alert_once: !input alert_once
update_thumbnail: !input update_thumbnail
ios_live_view: !input ios_live_view
android_auto: !input android_auto
notify_group: !input notify_group
notify_group_target: "{{ notify_group | lower | regex_replace('^notify\\.', '') | replace(' ','_') }}"
zone_only: !input zone_filter
input_zones: !input zones
zones: "{{ input_zones }}"
zone_multi: !input zone_multi
input_labels: !input labels
labels: "{{ input_labels | list | lower }}"
presence_entity: !input presence_filter
disable_times: !input disable_times
cooldown: !input cooldown
loitering: false
loiter_timer: !input loiter_timer
initial_delay: !input initial_delay
fps: "{{ states('sensor.' + camera + '_camera_fps')|int(5) }}"
state_only: !input state_filter
input_entity: !input state_entity
input_states: !input state_filter_states
states_filter: "{{ input_states | list | lower }}"
color: !input color
sound: !input sound
input_volume: !input volume
volume: "{{ (1 * input_volume|int(100))/100 }}"
sticky: !input sticky
tv: !input tv
tv_position: !input tv_position
tv_size: !input tv_size
tv_duration: !input tv_duration
tv_transparency: !input tv_transparency
tv_interrupt: !input tv_interrupt
debug: !input debug
action:
- choose:
- alias: "Silence New Object Notifications"
conditions:
- condition: trigger
id: silence
sequence:
- service: automation.turn_off
target:
entity_id: "{{ this.entity_id }}"
data:
stop_actions: false
- delay:
minutes: !input silence_timer
- service: automation.turn_on
target:
entity_id: "{{ this.entity_id }}"
- alias: "Custom Action Manual"
conditions:
- condition: trigger
id: custom
sequence: !input "custom_action_manual"
- alias: "Frigate Event"
conditions:
- condition: trigger
id: "frigate-event"
- "{{ is_state(this.entity_id, 'on') }}"
- "{{ not this.attributes.last_triggered or (now() - this.attributes.last_triggered).seconds > cooldown }}"
- "{{ not disable_times|length or not now().hour in disable_times|map('int')|list }}"
sequence:
- variables:
event: "{{ trigger.payload_json }}"
id: "{{ trigger.payload_json['after']['id'] }}"
object: "{{ trigger.payload_json['after']['label'] }}"
label: "{{ object | title }}"
# Dynamic Variables per event
initial_home: "{{presence_entity |reject('in', '') |select('is_state', 'home') |list |length != 0 }}"
enteredzones: "{{ trigger.payload_json['after']['entered_zones']}}"
zone_multi_filter: "{{zone_only and zone_multi and enteredzones|length and zones and zones |reject('in', enteredzones) |list |length == 0 }}"
loitering: false
# Customisation of text
title: !input title
message: !input message
subtitle: !input subtitle
tap_action: !input tap_action
button_1: !input button_1
button_2: !input button_2
button_3: !input button_3
url_1: !input url_1
url_2: !input url_2
url_3: !input url_3
icon_1: !input icon_1
icon_2: !input icon_2
icon_3: !input icon_3
# other things that can be templated and might need info from the event
critical_input: !input critical
critical: "{{ true if critical_input == 'true' else true if critical_input == True else false }}"
custom_filter: !input custom_filter
icon: !input icon
group: !input group
channel: !input channel
video: !input video
custom_action_auto: !input custom_action_auto
- alias: "Debug: write to Log"
choose:
- conditions:
- "{{debug}}"
sequence:
- service: logbook.log
data_template:
name: Frigate Notification
message: |
DEBUG:
Info:
fps: {{fps}},
frigate event id: {{id}}{{', Frigate client ID: ' + client_id if client_id else ''}},
object (formatted): {{object}} ({{label}}),
Config:
camera(formatted): {{camera}}({{camera_name}}),
Base URL: {{base_url}},
critical: {{critical}},
alert once: {{alert_once}},
Update Thumbnails: {{update_thumbnail}},
Video: {{video}},
Target: {{'group (input/formatted): ' + notify_group + '/' + notify_group_target + ', ' if notify_group else 'Mobile Device'}}
cooldown: {{cooldown}}s,
loiter timer: {{loiter_timer}}s,
initial delay: {{initial_delay}}s,
color: {{color}},
sound: {{sound}},
android_auto: {{android_auto}},
Group: {{group}},
Channel: {{channel}},
Sticky: {{sticky}},
Title: {{title}},
Message: {{message}},
Subtitle: {{subtitle}},
tap_action: {{tap_action}},
button 1 Text/URL/Icon: {{iif(button_1, button_1, 'unset')}} ({{url_1}}) {{icon_1}},
button 2 Text/URL/Icon: {{button_2}} ({{url_2}}) {{icon_2}},
button 3 Text/URL/Icon: {{button_3}} ({{url_3}}) {{icon_3}},
icon: {{icon}}
tv: {{ tv }},
tv_position: {{tv_position}},
tv_size: {{tv_size}},
tv_duration: {{tv_duration}},
tv_transparency: {{tv_transparency}},
tv_interrupt: {{tv_interrupt}},
Filters:
Zones:
zone filter toggle on: {{zone_only}},
Multi-Zone toggle on: {{zone_multi}},
Required zones: {{input_zones}},
Entered Zones: {{enteredzones}},
Zone Filter TEST: {{'PASS (Multi)' if zone_multi_filter else 'PASS' if ( not zone_only or not zone_multi and zones|select('in', enteredzones)|list|length ) else 'FAIL (Multi)' if zone_multi else 'FAIL' }},
Required objects TEST:
Input: {{input_labels}},
TEST: {{'PASS' if not labels|length or object in labels else 'FAIL'}}
presence entity (not home):
Entity: {{presence_entity}}
TEST: {{'PASS' if not initial_home else 'FAIL'}},
disabled times: {{disable_times}},
State Filter:
state filter toggle on: {{state_only}},
state filter entity: {{input_entity}},
required states: {{input_states}},
State Filter TEST: {{'PASS' if not state_only or states(input_entity)|lower in states_filter else 'FAIL' }},
Custom Filter: {{custom_filter}}
- alias: "Notifications enabled for object label"
condition: template
value_template: "{{ not labels|length or object in labels }}"
- alias: "Delay for image"
choose:
- conditions:
- "{{initial_delay > 0}}"
sequence:
- delay:
seconds: "{{initial_delay}}"
- alias: "Custom Action Auto"
choose:
- conditions:
- "{{ custom_action_auto |length > 0 }}"
- "{{ not zone_only or (not zone_multi and zones|select('in', enteredzones)|list|length > 0) or (zone_multi and enteredzones|length > 0 and zones |reject('in', enteredzones) |list |length == 0) }}"
- "{{ not initial_home }}"
- "{{ not state_only or states(input_entity)|lower in states_filter }}"
sequence: !input "custom_action_auto"
- alias: "Notify on new object"
choose:
- conditions:
- "{{ not zone_only or (not zone_multi and zones|select('in', enteredzones)|list|length > 0) or (zone_multi and enteredzones|length > 0 and zones |reject('in', enteredzones) |list |length == 0) }}"
- "{{ not initial_home }}"
- "{{ not state_only or states(input_entity)|lower in states_filter }}"