I’ve added frigate to my home
and the next step is to add some smart notifications.
I’ve created simple automation to alert when a person is passing:
alias: 'Camera: Telegram notification for persons'
description: ''
trigger:
- platform: mqtt
topic: frigate/events
payload: person
value_template: '{{ "person" if value_json["after"]["camera"] == "front_balcony" }}'
condition: []
action:
- service: notify.telegram_me
data_template:
message: A {{trigger.payload_json["after"]["label"]}} been spotted.
mode: parallel
max: 5
So that work OK (it does flood me with many messages but this I will try to solve later)
My next step was to add a snapshot to my telegram message,
I’ve all the snapshots from frigate going into the local media directory of HA so they are accessible from the internet (not great, and this I also need to think on how to secure).
But this didn’t worked at all
alias: 'Camera: Telegram notification for persons (Duplicate) (Duplicate)'
description: ''
trigger:
- platform: mqtt
topic: frigate/events
payload: person
value_template: '{{ "person" if value_json["after"]["camera"] == "front_balcony" }}'
condition: []
action:
- service: notify.telegram_me
data_template: >
message: A {{trigger.payload_json["after"]["label"]}} been spotted.
photo:
- url: https://some_domain/local/clips/{{trigger.payload_json["after"]["camera"]}}-{{trigger.payload_json["after"]["id"]}}.jpg
mode: parallel
max: 10
I have also tried to just send the components that compose my URL as a debugging step but that failed too, as it seems that my syntax is wrong as HA add >_
or just >
to my automation:
alias: 'Camera: Telegram notification for persons (Duplicate) (Duplicate)'
description: ''
trigger:
- platform: mqtt
topic: frigate/events
payload: person
value_template: '{{ "person" if value_json["after"]["camera"] == "front_balcony" }}'
condition: []
action:
- service: notify.telegram_me
data_template: >
message: >_
A {{trigger.payload_json["after"]["label"]}} been spotted,
{{trigger.payload_json["after"]["camera"]}},
{{trigger.payload_json["after"]["id"]}}
mode: parallel
max: 10