Hi,
I’m trying to setup an automation to email (using stmp) an attachment which is an image that comes from Frigate api (hass integration). Not sure if this is possible or if there is a better way? I found this approach, but seems like an extra step and I don’t see how this would work for frigate? I would love it if I could just get this working… Here is my example automation (urls redacted):
alias: frigate cam person EMAIL
trigger:
- platform: mqtt
topic: frigate/events
condition:
- condition: template
value_template: "{{ trigger.payload_json['after']['label'] == 'person' }}"
action:
- delay:
seconds: 2
- service: notify.email
data:
target: [email protected]
title: >-
{{trigger.payload_json["after"]["camera"]}} camera
{{trigger.payload_json["after"]["label"]}} detected!
message: >
A {{trigger.payload_json["after"]["label"]}} was detected on
{{trigger.payload_json["after"]["camera"]}} camera.
Check out the details here...
snapshot...
https://my-public-ha.domain.com/api/frigate/frigate/notifications/{{trigger.payload_json["after"]["id"]}}/snapshot.jpg
data:
image:
- "https://my-public-ha.domain.com/api/frigate/frigate/notifications/{{trigger.payload_json['after']['id']}}/snapshot.jpg"
- delay:
seconds: 30
mode: single
I verified that this image url is available publicly…
https://my-public-ha.domain.com/api/frigate/frigate/notifications/event-url-hash/snapshot.jpg
I even tried just hard coding one url without variables in it, but that didn’t work either…
I also tried “attachment” which it says here should work but I dunno?