I’m trying to use Frigate to make some automation and am currently doing the following:
If Frigate adds a file in the snapshots folder, telegram sends me a picture of that. The trigger revolves around “’{{ trigger.event.data.path }}’” which makes the automation super easy. However, as I add cameras, I want to divide my notifications into separate messages for each camera.
But my current way of approaching this isn’t working. I’ve looked through YAML syntax documentation and I can’t seem to find how to have my automation check if the ‘{{ trigger.event.data.path }}’ includes a word. I tried using brackets and dot notation, neither worked.
Basically, with Frigate saving snapshots, I want folder watcher to look in a folder, and if the trigger is set AND the file name includes “porch” to send a message with the picture. Then I would add a second automation with basically the same code and replace porch with driveway.
Is there a better way to approach this? I’m considering using MQTT as the data portion. So if a new snapshot gets added, send a messaage with the filepath picture + MQTT data.
Anyway, here’s my current setup:
alias: Frigate Driveway Screenshot > Telegram notification + Picture
description: When frigate saves a new screenshot, telegram will send that picture.
trigger:
- platform: event
event_type: folder_watcher
event_data:
event_type: created
condition:[ ]
action:
- service: telegram_bot.send_photo
data:
file: '{{ trigger.event.data.path }}'
caption: Camera Motion
mode: single