Hello,
I’ve been experiencing an issue with Telegram notifications since last week. I’m not sure why, but the “official” automation used to send notifications on Telegram (as described on the Frigate website) is no longer working.
When I check the logs, I can see that the automation fails with the following error:
“UndefinedError: ‘dict object’ has no attribute ‘payload_json’”.
I can confirm that:
- Alerts on Frigate and Frigate works fine ;
- MQTT server works ;
- Telegram bot works ;
- I am using “frigate/events” and I can see this topic on mqtt ;
Any idea on whats going on ?
Many thanks for your help.
Here is the automation:
alias: '[Notify] - Send picture to telegram'
description: Send picture to telegram
trigger:
- platform: mqtt
topic: frigate/events
condition:
- condition: template
value_template: '{{ trigger.payload_json["type"] == "end" }}'
- condition: template
value_template: '{{ trigger.payload_json["after"]["entered_zones"].count("right") > 0 }}'
- condition: state
entity_id: input_boolean.stop_camera_notification
state: 'off'
action:
- delay:
hours: 0
minutes: 0
seconds: 1
- service: telegram_bot.send_photo
data_template:
message: Détection caméra on right
data:
photo:
- url: >-
http://myhaip:8123/api/frigate/notifications/{{trigger.payload_json["after"]["id"]}}/snapshot.jpg
caption: >-
"Message"
- service: homeassistant.turn_on
entity_id: input_boolean.helper_detection_cam
- delay: "00:00:02"
- service: homeassistant.turn_off
entity_id: input_boolean.helper_detection_cam
mode: single
initial_state: true