I have the problem to add an image to a mail notification
This is the YAML. I send a mail to my Gmail account on an IOS device. The mail is received, but without attachment. I checked, and the file is saved in the correct location. What I’m doing wrong?
alias: Nieuwe automatisering
description: “”
trigger:
platform: state
entity_id:
binary_sensor.ip_camera_field_detection
from: null
to: “on”
condition:
action:
alias: camera detectie
description: ""
trigger:
- platform: state
entity_id:
- binary_sensor.ip_camera_field_detection
from: null
to: 'on'
condition: []
action:
- service: camera.snapshot
data:
entity_id: camera.192_168_0_12
filename:
/media/snapshots/voordeur_{{ now ().year }}_{{ now ().month }}_{{ now
().day }}_{{ now ().hour }}_{{ now ().minute }}.jpg
- service: notify.xxxxxx_gmail_com
data:
title: camera detectie
message: camera detectie om {{now().strftime("%H:%M")}}
target: [email protected]
data:
image:
/media/local/snapshots/voordeur_{{ now ().year }}_{{ now ().month
}}_{{ now ().day }}_{{ now ().hour }}_{{ now ().minute }}.jpg
mode: single
You asked the same question in another topic. Did you follow the instructions in that topic’s Solution post? Specifically the instructions for adding the directory, containing your file, to allowlist_external_dirs in the homeassistant section of your configuration.yaml file?