Camera - Send & Save snapshot to mobile device when motion is detected with Conditions. Now with Custom Triggers!

oh no, I don’t have a delay there…

TheRealFalseReality - First, excellent! I don’t want to troubleshoot without first telling you thanks for your contributions and all your support here. Like many, I’m on iOS, and getting the 404 errors. I see the files in the media folder, and I can set up a custom notification to send those files to myself, but I’m struggling to get the BP to send without the 404 error.

version = 2024.8.1

I’ve taken the dynamic camera name out for now.
In configuration.yaml I have:

homeassistant:
allowlist_external_dirs:

  • ‘/config/www/pics’
  • ‘/config/media/snapshots/camera_fluent’
    media_dirs:
    local: /config/media

camera:

  • platform: local_file
    file_path: /media/snapshots/camera_fluent/last_motion.jpg # match your ‘File Path’ location from the Blueprint
    name: Camera Last Motion

last_motion.jpg is in my media in HA. /snapshots/camera_fluent/last_motion.jpg

I have another test notification that is sending the picture just file with this dor the data field of the notify service.

attachment:
content-type: jpeg
url: /media/local/snapshots/camera_fluent/last_motion.jpg
push:
sound:
name: default
critical: 1
volume: 1

I’m willing to send you an old iOS device for testing at this point if you can help. I really want to use this to replace all my ring devices.

Any help is appreciated!

Ah ok, good troubleshoot. So it looks like your test notification is fine and not the blueprint. I’ll have to take a closer look. I don’t mind doing a little extra testing if I had a iOS device, I will leave that up to you however.

Shoot me an email at [email protected] and I’ll get you a device.

I went through all the documentation again like you mentioned again on the media folder. While I had the alert working, I couldn’t get another card to display an image, kept getting the same 404 error on images. Turns out the whole thing was my issue to begin with, and the blueprint works perfect out of the box if you have your media folder correctly mapped.

In my case, I am running a docker container on my synology.
I have /config mapped to /volume1/docker/HA/config

I had to add another folder mapping and map /media to /volume1/docker/HA/media and move my existing media.

Updated docker composer file:

version: ‘3’
services:
homeassistant:
container_name: homeassistant
image: “homeassistant/home-assistant:stable”
volumes:
- /volume1/docker/HA/config:/config
- /volume1/docker/HA/media:/media
restart: unless-stopped
privileged: true
network_mode: host

After doing that, restarting the container, and redeploying the default blueprint, everything was perfect. Dynamic naming etc, Snapshots, etc. Thanks for your offer to help TheRealFalseReality, appreciate this!!!

Ah ok! It’s always the file path…
Ah yes, I assumed most people will just put the path without the /local part so I coded up to add that in the blueprint.

were you using the Custom Triggers automation or the first Binary Sensor one? I had a bug with the triggers one that I am hoping I fixed.

I guess it is the Binary Sensor one. Its called Camera - Send & Save Camera snapshot when if a binary sensor's state turns 'off' to 'on', with Conditions

1 Like

hmm, then something on your end. Check your HA install type, this is HASSOS, and I see on other install, like Docker or VM, will need additional configuration in your .yaml file.

But don’t you think it would make sense to add a delay between creating the snapshot and sending it? Or does the program wait until the snapshot has been created? Because there are many possible reasons why it takes longer to create a snapshot: high resolution, heavy network traffic, utilization of Home Assistant.

It doesn’t not work at all, but only sometimes not. That’s why I assume that the snapshot has not yet been created at the moment it is supposed to be sent.

1 Like

I’ll add the delay tonight and see if that fixes it!

Added in 2.2.8, try it out

Thanks a lot! Added it and will try it out on the weekend.

1 Like

Im pretty new to HA and just started using this blueprint. Works perfectly with my reolink doorbell. I only get notifications whilst im on my home network but outside of it nothing comes through. I have cloud setup with nabu case.

Can any one tell me how i setup HA up receive the notifications outside on my lan?

Thanks

I am not sure, it’s been a while since I used HA Cloud, you may need to alter you configuration file to allow for external access to media directories. Check out this info and see if this helps:

It looks like you’re right and it’s not due to a delay. I have the same behavior with the delay enabled, sometimes I see a picture in the notification and sometimes not. I also noticed that the delay also delays the archive snapshot, which is not the purpose of the thing.

when you don’t get the image, are you away from you local network?

Right, as long as I am recognized in the network, no pictures should be sent. That’s why your blueprint only comes into play when I’m outside the network. But as I said, sometimes I get a picture and sometimes not.

Seems a bit of a recurring question, but I don’t get a snapshot in my notification.
I see it being stored on my drive but no picture in the notification.
What am i missing?
I’m using docker so I have following volume:

  • /var/data/homeassistant/media:/media
    In HA configuration I have:
    media_dirs:
    media: /media

In the automation I didn’t change anything for test purposes:
/media/snapshots/{{ states[camera].object_id }}/last_motion.jpg
When I look the screenshot and directory gets created so that seems ok but I can’t seem to see why it fails to send the picture?

Thanks in advance.

nvm, i’ve put last motion in www and it works.
don’t understand why this is not allowing it to use such directory.

1 Like