I created this automation to send me a notification (via telegram) when my camera detects a person and takes a snapshot. It works intermittently for some reason. The snapshot is always being taken, b/c i can go see it via FTP, but the Telegram notification sometimes just doesn’t show up at all. not delayed, never happens. I get the notification ~50% of the time it seems. Any ideas what I’ve done wrong?
alias: automation.Driveway_Notification
description: ""
trigger:
- platform: state
entity_id:
- binary_sensor.driveway_person
from: "off"
to: "on"
condition:
- condition: time
after: "07:00:00"
before: "23:59:00"
weekday:
- sun
- mon
- tue
- wed
- thu
- fri
- sat
action:
- delay:
hours: 0
minutes: 0
seconds: 1
milliseconds: 0
enabled: true
- service: camera.snapshot
data:
filename: >-
/config/www/driveway/{{ trigger.to_state.last_changed | as_timestamp |
timestamp_custom("%Y-%m-%d_%H-%M-%S") }}.jpg
target:
device_id: a276761dbbf7afc4e07650ff9b3da0e9
- service: notify.telegram_main
data:
Title: ""
message: Person in Driveway (⊙_☉)
data:
photo:
- file: >-
/config/www/driveway/{{ trigger.to_state.last_changed |
as_timestamp | timestamp_custom("%Y-%m-%d_%H-%M-%S") }}.jpg
mode: single