Hi. Can anyone share how to reference an image using the media_source
integration , via the clickAction parameter in a notification?
Attaching images from /media to a notification works just fine. But with, for example:
"image": "/media/local/amazon_order_2021-08-03_XXXX.jpg",
"clickAction": "/media/local/amazon_order_2021-08-03_XXXX.jpg"
While the attached image shows up, tapping the notification leads to a 401: Unauth response (in the Companion app)
Any errors in the HA logs? did you by chance revoke any access tokens? Are you certain the path you are selecting is correct and valid? You can use a browser to ensure the proper location. Are you able to navigate to the path?
No errors, no change to tokens, and I believe the path is accurate because browsing to /media/local/amazon_order_2021-08-03_XXXX.jpg returns 401: Unauthorized, while browsing to /media/local/notarealfile.jpg returns 404: Not Found.
I’m having the issue with the Android companion app. Did you figure out anyway around this?
Negative. I suspect that this sort of use case is not currently supported.
if you guys want this to be supported, I recommend creating a feature request on github
This thread was preceded by #1672
1 Like
albatorsk
(Per Larsson)
May 5, 2023, 8:17am
9
Two years later, and I’m seeing the same issue still.
Has anyone found a suitable workaround? Otherwise, I will add a subfolder to www and store a copy of the image there for this purpose alone.
jgarcia
(Jaime)
May 15, 2023, 10:26am
10
I am having the same issue too.
bt04
October 6, 2023, 12:34am
12
I found this issue after opening a similar/duplicate issue while attempting to use media_source
URI.
I’m trying to attach a video to a notification and have home assistant play the video when I tap on the notification. I was able to attach the video using from a media_source using these instructions
I cannot get the video to play using a clickAction URL
service: notify.mobile_app_pixel_6
data:
message: Front Door Recorded @4:50 PM
data:
video: /media/cctv/2023-10-03/16.49.41-16.50.03[M][0@0][0].mp4
clickAction: media-source://media_source/cctv/2023-10-03/16.49.41-16.50.03[M][0@…
Neither the URI or /media
shortcut work for clickAction
.