forked from SkyTechNerds/faceid
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathha-automation-example.yaml
More file actions
36 lines (35 loc) · 1.46 KB
/
Copy pathha-automation-example.yaml
File metadata and controls
36 lines (35 loc) · 1.46 KB
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
# Example: phone notification when a family member is recognized.
#
# One faceid/event message is published per (Frigate event, person), so this
# will not spam you with repeats of the same sighting. mode: queued makes sure
# two people recognized at the same time both produce a notification; the
# per-person notification tag replaces a still-visible message instead of
# stacking. faceid/event is published without the MQTT retain flag, so a
# Home Assistant restart cannot re-fire these triggers on a stale message.
- alias: 'FaceID: family member recognized'
id: faceid_family_recognized
mode: queued
triggers:
- trigger: mqtt
topic: faceid/event
value_template: '{{ value_json.person }}'
payload: Alice
- trigger: mqtt
topic: faceid/event
value_template: '{{ value_json.person }}'
payload: Bob
variables:
camera_name: >-
{{ {'front_door': 'front door', 'garden': 'garden'}
.get(trigger.payload_json.camera, trigger.payload_json.camera) }}
actions:
- action: notify.mobile_app_your_phone
data:
title: '{{ trigger.payload_json.person }} is here'
message: >-
{{ trigger.payload_json.person }} recognized at the {{ camera_name }}
({{ ((trigger.payload_json.score | default(0)) * 100) | round(0) | int }} %).
data:
channel: FaceID
tag: faceid-{{ trigger.payload_json.person | lower }}
image: '/api/frigate/notifications/{{ trigger.payload_json.event_id }}/snapshot.jpg'