The new media source is pretty cool. I’ve modified a few of my automations to write images, stream.records to that folder.
So here is what I am trying to do.
Automation to capture stream record. I got that working and writes to /media
I can view the recorded .mp4 in my HA app on my iOS device - working
I’d like to send a notification that when clicked on, goes to and plays that .mp4.
I’m happy if the notification is for the iOS app, could be an actionable notification. But basically my main thing is I dont want to have to
get notified
open HA
click on media browser
click on mp4
Anyone have any similiar automations/notifictions?
Not a big deal, but the attachment does play without sound, but if I play the same file via media browser it does have sound. But I’m super happy with this, allows me to go back and watch the video again easily
Thanks for your reply!
I tried it but with no luck and no error message. Really strange since the image is written to the /media folder but can’t be seen in the notification. Do you see anything obvious I’m doing wrong?
Edit:
This solved my issues, it had to use /media/local/ when sending the notification to access the image.
Is your iOS notification with attachment still working? I do have the same setup as yours, but I can’t get the attachment (image) to load on notification. The notification works, but the image won’t load, instead I get an image that says something like “Failed to load attachment, response status code was unacceptable: 404”.
I’m not sure if this is a bug on the companion app. By the way, where do you have this
allowlist_external_dirs:
- '/media'
is it in your configuration.yaml? Is it necessary?
For example:
You have created the following on disk: ‘/media/local/image.jpg’ and when you access the url through the web server you need to tell the media plugin which “source” to access, in this case it’s the local source which points to ( url: “/media/local” -> disk: “/media” ) so you end up with url: “/media/local/local/image.jpg”. So if you were to create on disk: “/media/snapshot/image.jpg” -> url: “/media/local/snapshot/image.jpg”
Hello
I am trying to open local recorded files from camera by clicking on notification,
I can see the preview of file, but when trying to click on it, it will bring me on HA home page
here is the code
I am using folder watcher for monitoring
service: notify.mobile_app_sm_g998u1
data:
title: New image captured!
message: /media{{ trigger.event.data.folder }}/{{ trigger.event.data.file }}
data:
color: red
ttl: 0
priority: high
image: /media{{ trigger.event.data.folder }}/{{ trigger.event.data.file }}
clickAction: /media{{ trigger.event.data.folder }}/{{ trigger.event.data.file }}