Advertisement
Guest User

HA Frigate notfications 0.16b4

a guest
Jul 17th, 2025
6
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 4.86 KB | None | 0 0
  1. ```
  2. alias: 'Frigate: Notify on person in porch'
  3. description: ''
  4. triggers:
  5. - topic: frigate/events
  6. id: frigate-event
  7. payload: Driveway-camera
  8. value_template: '{{ value_json[''after''][''camera''] }}'
  9. variables:
  10. after_zones: '{{ trigger.payload_json[''after''][''entered_zones''] }}'
  11. before_zones: '{{ trigger.payload_json[''before''][''entered_zones''] }}'
  12. camera: '{{ trigger.payload_json[''after''][''camera''] }}'
  13. id: '{{ trigger.payload_json[''after''][''id''] }}'
  14. label: '{{ trigger.payload_json[''after''][''label''] }}'
  15. score: '{{ trigger.payload_json[''after''][''score''] }}'
  16. time_clip_start: '{{ trigger.payload_json[''after''][''start_time''] - 10.0 }}'
  17. trigger: mqtt
  18. conditions:
  19. - condition: template
  20. value_template: '{{ before_zones == [''driveway''] }}'
  21. alias: Is object newly detected and was in the driveway prior before?
  22. enabled: false
  23. - condition: template
  24. value_template: '{{ ["porch"] | select("in", after_zones) | list | length > 0 }}'
  25. alias: Has object moved into porch area?
  26. enabled: true
  27. - condition: template
  28. value_template: '{{ trigger.payload_json["after"]["label"] == "person" }}'
  29. alias: Is object classified as person?
  30. enabled: true
  31. actions:
  32. - choose:
  33. - conditions:
  34. - condition: trigger
  35. id: frigate-event
  36. sequence:
  37. - data:
  38. id: '{{ id }}'
  39. title: Tudor Way
  40. message: >-
  41. Somebody was detected in the {{ after_zones[0] | replace("-", "
  42. ") | lower }}
  43. notifTag: '{{ id }}'
  44. notifIcon: 'mdi:doorbell-video'
  45. group: 'frigate-notification-{{ camera }}'
  46. importance: max
  47. image: >-
  48. https://ha.redacted.com/api/frigate/notifications/{{ id
  49. }}/snapshot.jpg
  50. clickAction: ''
  51. alias: Send notification to phone
  52. action: script.1707650069804
  53. - repeat:
  54. until:
  55. - condition: template
  56. value_template: '{{ wait.trigger.payload_json["type"] == "end" }}'
  57. alias: Frigate recorded event ended
  58. sequence:
  59. - wait_for_trigger:
  60. - topic: frigate/events
  61. payload: '{{ trigger.payload_json["after"]["id"] }}'
  62. value_template: '{{ value_json["after"]["id"] }}'
  63. trigger: mqtt
  64. continue_on_timeout: false
  65. timeout: '00:02:00'
  66. - condition: template
  67. value_template: '{{ wait.trigger.payload_json[''type''] == ''end'' }}'
  68. - data:
  69. id: '{{ id }}'
  70. title: Tudor Way
  71. message: >-
  72. {% if (wait.trigger.payload_json["after"]["sub_label"] !=
  73. None) -%} {{
  74. (wait.trigger.payload_json["after"]["sub_label"][0]) |
  75. title }} {%- else -%} An unrecognised {{
  76. (wait.trigger.payload_json["after"]["label"]) |
  77. replace("_", " ") | lower }} {%- endif %} was seen in the
  78. {{ after_zones[0] | replace("_", " ") | lower }}
  79. notifTag: '{{ id }}'
  80. notifIcon: 'mdi:doorbell-video'
  81. group: >-
  82. frigate-notification-{{
  83. trigger.payload_json["after"]["camera"] }}
  84. importance: default
  85. image: >-
  86. https://ha.redacted.com/api/frigate/notifications/{{ id
  87. }}/snapshot.jpg
  88. video: >-
  89. https://ha.redacted.com/api/frigate/notifications/{{ id
  90. }}/clip.mp4
  91. clickAction: >-
  92. https://ha.redacted.com/api/frigate/notifications/{{ id
  93. }}/master.m3u8
  94. action: script.1707650069804
  95. default: []
  96. mode: parallel
  97. max: 10
  98. trace:
  99. stored_traces: 25
  100. ```
  101.  
  102. And then my notification script:
  103. ```
  104. alias: send_dynamic
  105. sequence:
  106. - data:
  107. message: "{{ message }}"
  108. title: "{{ title }}"
  109. data:
  110. url: "{{ video }}"
  111. tag: "{{ notifTag }}"
  112. group: "{{ group }}"
  113. attachment:
  114. url: >-
  115. {% if (importance == "default" and video != null) -%} {{ video }}
  116. {%- else -%} {{ image }} {%- endif %}
  117. push:
  118. interruption-level: >-
  119. {% if importance == "max" -%} time-sensitive {%- else -%}
  120. time-sensitive {%- endif %}
  121. action: notify.mobile_app_jasjeets_iphone
  122. mode: parallel
  123. icon: mdi:bell-ring-outline
  124. max: 10
  125. trace:
  126. stored_traces: 25
  127. ```
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement