Last active
June 23, 2024 20:58
-
-
Save girs1982/9dc07ca50f0c0882f2f4d3e33231be29 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
blueprint: | |
name: Frigate - Telegram Notification mqtt By Gansta | |
description: Create automations to receive Snapshots and Clips from Frigate | |
domain: automation | |
input: | |
camera: | |
name: Frigate Camera | |
description: The name of the camera as defined in your frigate configuration (/conf.yml). | |
target_chat: | |
name: Target | |
description: "The chat_id to be used by the Telegram bot." | |
notification: | |
name: Notification | |
description: 'Select "true" to disable notification, leave "false" to receive notification.' | |
selector: | |
select: | |
options: | |
- "true" | |
- "false" | |
default: "false" | |
base_url: | |
name: (Optional) Base URL | |
description: The external URL for your Home Assistant instance. | |
default: "" | |
source_url: https://gist.github.com/NdR91/5486a1e55101e062c48545395b7dd9a3 | |
mode: single | |
max_exceeded: silent | |
trigger: | |
platform: mqtt | |
topic: /knop/frigate/{{ camera }}/person/snapshot | |
variables: | |
id: "{{ trigger.id }}" | |
camera_name: "{{ camera | replace('_', ' ') | title }}" | |
target_chat: !input target_chat | |
notification: !input notification | |
base_url: !input base_url | |
action: | |
- service: mqtt.publish | |
data: | |
topic: "frigate/notify/{{ id }}/save_snapshot" | |
payload: "{{ trigger.payload }}" | |
- wait_for_trigger: | |
- platform: mqtt | |
topic: "frigate/notify/{{ id }}/snapshot_saved" | |
- service: telegram_bot.send_photo | |
data: | |
target: "{{ target_chat }}" | |
disable_notification: "{{ notification }}" | |
caption: "Person Detected. Camera: {{ camera_name }}" | |
file: "{{ base_url }}/api/frigate/notifications/{{ id }}/snapshot.jpg" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment