Hello,
I’ve been using notifications for a while and I’m trying to send a camera image for the first time. I’ve followed multiple tutorials: Home Assistant Actionable Notifications on Android and iOS - Everything You Need to Know! - YouTube Home Intruder Actionable Notification in Home Assistant - YouTube and the Standard Attachments | Home Assistant Companion Docs for this and from what I can tell I’m doing everything correctly but I can’t receive the image on my Samsung Galaxy S9+.
Here’s my YAML:
service: notify.mobile_app_serge_s_galaxy_s9
data:
title: Intruder Alert
message: A person has been detected at the garage door
data:
attachment:
url: "https://mynabucasaurlnotyours.nabu.casa/local/surveillance/camera_garage.jpg"
content-type: jpeg
hide-thumbnail: false
I get the message every time but no image. I’ve quadruple validated that these images are exposed to the internet and I’ve triple checked my indentation against the videos/docs. I tried this with a jpeg, PNG, and video. All of them were validated to be exposed to the open internet. None of the attachments show on my Android.
There aren’t that many moving pieces to this. The snapshots are obviously being stored, they’re exposed, the messages are going through, I’m just not receiving attachments. I also tried manipulating this manually with images saved to the folder via samba share. Same results.
Is there an android setting I need to mess with somewhere? I AM able to get picture notifications with other apps like Ring so I know my phone can display it. I just can’t figure out what I’m missing.
Make sure to follow the example, you are using the old iOS format here.
I have re-read that page 3 times and I still don’t understand what to do. It offers several additional ways to do this in android but none of them work because they don’t align with the pages in home assistant.
It says the media source call for android is recommended. OK, when I use that, it doesn’t give me enough components to build the automation.
There’s several instructions for android about using the Icon_URL but that doesn’t fit anywhere. I have tried every example code on that page and then some.
Can you screenshot on that page which instructions I’m supposed to follow?
This service call does not display the image but sends me the notification. I can tell the image is publicly accessable.:
automation:
- alias: Notify Mobile app attachment
trigger:
...
action:
- service: notify.mobile_app_<your_device_id_here>
data:
message: "Something happened at home!"
data:
# an example of an absolute url
image: "https://github.com/home-assistant/assets/blob/9b782fe562cbd4e6139f9be17d8e7befafa5f945/logo/logo.png?raw=true"
# example of a relative url
image: "/media/local/image.png"
# the same works for video
video: "/media/local/video.mp4"
# and for audio
audio: "/media/local/audio.mp3"```
- service: notify.mobile_app_<your_device_id_here>
data:
message: "Something happened at home!"
data:
image: "https://mynabucasaurlnotyours.nabu.casa/local/surveillance/camera_garage.jpg"
I got it to work by dissecting another example
service: notify.mobile_app_serge_s_galaxy_s9
data:
message: "Something happened at home!"
data:
image: "https:/mynabucaseaurlnotyour.ui.nabu.casa/local/surveillance/camera_garage.jpg"
The example on the page you linked and showed is the example to follow. It simply showed you more options.
That’s what I thought too. I slowly inserted the options back in with the title and message and now I have all the components. I don’t understand why taking the thumbnail option out helped but it certainly has worked. Thanks.
when you follow the docs pay close attention to the iOS and Android icon as those indicate which example to follow. Notice how that section mentions its iOS specific
?
https://companion.home-assistant.io/docs/notifications/notification-attachments#configuration
I didn’t notice it until this morning for sure😀
1 Like