I’m sorry to be that newbie. Have been struggling with this for two days straight. Have read the forums and tried every syntax combination I’ve come across to no avail. Just looking for the configuration syntax to attach a photo to a notification. I can confirm the photo is where I think it is, and I can access it.
What kind of notification?
What kind of photo?
Where is the photo?
Here is the structure I use for a photo link (from BlurIris send as a path via MQTT) on share using Telegram and Signal.
/media/camalerts/Alerts/{{states("sensor.mqtt_12345_blueiris_front_lower_cam_image_path")
and here a webcam snapshot to IOS when motion is detected at the front door:
alias: Front Doorcam Send a doorcam snapshot on movement AceIndy
description: ""
trigger:
- platform: state
entity_id:
- binary_sensor.frontdoormotion_sensor
from: "off"
to: "on"
for:
hours: 0
minutes: 0
seconds: 0
condition: []
action:
- service: camera.snapshot
entity_id: camera.doorcam
data:
filename: "{{ snapshot_create_file_path }}"
- service: notify.mobile_app_aceindy_iphone
data:
title: "{{ notification_title }}"
message: "{{ notification_message }}"
data:
attachment:
content-type: jpeg
url: /local/tmp/snapshot_doorcam.jpg
push:
sound:
name: default
critical: 1
volume: 1
variables:
binary_sensor: binary_sensor.frontdoormotion_sensor
binary_sensor_name: "{{ states[binary_sensor].name }}"
notification_title: Movement detected
notification_message: "{{ binary_sensor_name }} was activated!"
snapshot_create_file_path: /config/www/tmp/snapshot_{{ states[camera].object_id }}.jpg
snapshot_access_file_path: "{{ snapshot_create_file_path | replace('/config/www','/local') }}"
Honestly after 4000 variations of attachment, image, push, internal dirs, external dirs this worked. Thank you!
Hi @davidwas, since the problem you had is solved, please take the time to mark the answer as solution, you do that by selecting the three dots under the post:
Then select the check box:
Don’t forget too while you’re down there to click the heart to like the post, as a way of saying thank you.
Note: if you reveal what the problem was and how it got solved, it might help others with this problem
too.
Tip: if you had added “Mobile Apps” & the platform as category, your topic would live in a more suited section.
you’re welcome
My experience with snapshots is not ideal. I had some notifications that worked and then stopped, or images were cached.
I got advice here in forum to just use api as follows:
service: notify.phone_notification
data:
title: <b>You've got mail!</b>
message: Check your mailbox
data:
image: /api/camera_proxy/camera.mail_high
notification_icon: mdi:mailbox-up-outline
How do you retrieve the api of camera and does it also work for video?
Just in case someone else stumbles across this thread: I tried everything, and nothing seemed to work. I would receive a preview of the photo, but when I clicked on the notification, it opened the app (iOS, in this case) without showing the photo or other (i.e. map) attachment. Then I realized you had to press and hold the notification (D’oh) to see the attachment.
if someone finds this and has problems geting it to work, here is my working automations yaml script: