Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Save aficiomaquinas/95768c72c39813d53e4d0feb7d8f138c to your computer and use it in GitHub Desktop.
Save aficiomaquinas/95768c72c39813d53e4d0feb7d8f138c to your computer and use it in GitHub Desktop.
Home Assistant Blueprint for Frigate Motion Notifications
blueprint:
name: Frigate Motion Detection Notification
description: Send Telegram notifications when motion is detected in a specific Frigate camera zone
domain: automation
source_url: https://gist.github.com/example/frigate-motion-blueprint
input:
camera:
name: Camera
description: The Frigate camera to monitor
selector:
text:
zone:
name: Zone
description: The zone to monitor for motion
selector:
text:
telegram_chat_id:
name: Telegram Chat ID
description: The Telegram chat ID to send notifications to
selector:
text:
trigger:
platform: mqtt
topic: frigate/events
value_template: >
{% set payload = value_json %}
{% if payload.before.motion.enabled == false and
payload.after.motion.enabled == true %}
true
{% else %}
false
{% endif %}
condition:
- condition: template
value_template: >
{% set event = trigger.payload_json %}
{{ event.after.camera == camera and
event.after.zone == zone }}
action:
- service: telegram_bot.send_photo
data:
target: "{{ telegram_chat_id }}"
caption: >
Motion detected in {{ trigger.payload_json.after.zone | replace("_", " ") | title }}
camera: {{ trigger.payload_json.after.camera | replace("_", " ") | title }}
url: "{{ trigger.payload_json.after.snapshot }}"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment