media_dirs:
local: /media
music: /media/int-sdb1/Music
Should look more like that
media_dirs:
local: /media
music: /media/int-sdb1/Music
Should look more like that
Tried with all default parameters.
The screenshot has been created and saved in [root]/media/snapshots/nameofthecamera/ folder.
I can see the file from the Terminal, not from File Explorer add-on which can’t go back from /config.
I can’t see/load the picture from Media in the left HA menu because that folder is not shown at all.
I still receive a “failed to load attachment” in the Companion App.
About my config in the configuration.yaml, I followed this suggestions.
I believe that there are different behaviours based on the type of HA installation you have, mine is HASSOS.
Hey guys, thank you for the great blueprint.
Everything is working fine except that I’m getting 2 notifications at the same time.
Companion app notification history shows that I’m getting 1 under “Websockets” and one under “FCM”
Any ideas?
ok, I’ll look into this this weekend
is it just with this blueprint or all HA notifications in general?
Just this blueprint, weird
You should be able to alter the path of the image to anything you choose, just make sure you have access to it, either via Home Assistant Cloud or DuckDNS, otherwise you may only get an image on local network.
If you can, save an image to you HA instance, go into services and use the notify service to send that image to your device, if it works, then it is my blueprint. If you have the same error, it is your instance. Lemme know your results Documentation. If your image is saved into /media
you need to alter the URL to /media/local
. Also, if ALL else fails, try using your /config/www
folder, replacing /www
with /local
.
Example, place a jpg into /config/www
, then in your bowser, navigate to <YOUR_HA_URL>/local/<FILENAME.JPG>
. Those files are hosted on your device but accessible without authentication on the internet. So not recommended to use store sensitive images there, which is why I use the /media
folder by default.
I did some tests with the notify service.
I succesfully sent an alert with a jpg attach with the following config:
configuration.yaml
homeassistant:
media_dirs:
local: /config/media
service: notify.mobile_app_dadox
data:
title: TEST
message: test message
data:
attachment:
content-type: jpeg
url: /media/local/snapshots/last_motion.jpg
push:
sound:
name: default
critical: 1
volume: 1
Then I put the same path (/media/local/snapshots/last_motion.jpg) to your blueprint, keeping all the other fields with the default parameter … but I got the “failed to load attachment” message
remove the /local
in the blueprint URL, the blueprint replaces /media
with /media/local
so it looks like the final URL it is going to load is /media/local/local/snapshots/last_motion.jpg
.
Here is the actual code
snapshot_access_file_path: '{{ snapshot_create_file_path | replace(''/media'',''/media/local'') }}'```
where snapshot_create_file_path
should be /media/snapshots/last_motion.jpg
so the final URL becomes /media/local/snapshots/last_motion.jpg
The blueprint’s default path is /media/snapshots/{{ states[camera].object_id }}/last_motion.jpg
.
Still not working.
This is now the blueprint url:
/media/snapshots/last_motion.jpg
and this is the message I get:
So I added this to configuration.yaml:
homeassistant:
allowlist_external_dirs:
- /config/media/snapshots
but I got the same error.
/media
is not in /config
but in root. I’m not sure why it cant get your image. What kind of HA install are you using?
try using /media/snapshots
or /config/www
(but remember to replace /config/www
with /local
in the notification) or any other folder that you have write access to.
shit, I will have to update the blueprint to support files in /www
natively though. But it looks like you cannot write to /media
at all which may be an underlying issue.
They would have to be in here either way I bet. (In order for something else to write to the folder)
Home Assistant Core Integration - Home Assistant.
Try
media_dirs:
media: "/media"
thanks for your help! Always appreciated
I’ve updated it to support the /config/www
, try using the file path as /config/www/snapshots/{{ states[camera].object_id }}/last_motion.jpg
and see if you can save the image there. This will expose the image to the internet though, but it seems like you have write issues.
Good morning community,
i am using this automation, but i have a problem with showing the right snapshot in my notification.
The automation saves the snapshot in /media/DoorbellCamera/last_motion.jpg and also saves in archive.
But it shows a really old snapshot in my iphone notification. I dont even know where it takes the snapshot from…
can someone help me?
alias: Snapshot bei Türklingel
description: ""
use_blueprint:
path: TheRealFalseReality/send_snapshot_conditional.yaml
input:
camera: camera.doorbell
sensor: binary_sensor.vto_doorbell
notify_device: 35262d0fc29ef7f90fcdfdee202748a8
is_ios: true
notification_title: Türklingel
file: /media/DoorbellCamera/last_motion.jpg
archive_file: >-
/media/DoorbellCamera/archive/motion_{{ now().strftime("%Y%m%d-%H%M%S")
}}.jpg
Thanks in advance
cheers Steve
are you using the latest update of the blueprint? I think I had the issue but fixed it.
Hi TheRealFalseReality,
yes, i deleted the blueprint and reloaded it and set it up new.
i think it is working now. I will test it a cpl of days.
Hello guys! Is there a way with this great blueprint to have more then 1 snapshot? I mean if movement is detected send snap from camera 1 and camera 2 instead of only 1 camera.