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

I am using iPhone. The BP does save the image in the directory. I do see the saved image. However, I do not get the thumbnail at all. How can I get this BP to work on iOS? Do I need to modify it the script?

How did you manage to get iPhone thumbnails to show in notification? I tried so many things, and couldn’t make it work.

It looks like here https:///local/tmp/snapshot_computer_room_camera.jpg, there is a typo, an extra ‘/’ try: https://local/tmp/snapshot_computer_room_camera.jpg
The snapshot should be save in /media/snapshots/{{ states[camera].object_id }}/last_motion.jpg' and the notification will display that image. That being said, since it is hosted in the /media directory, the url needs to be altered, which is what my initial issue with this was. Anything in that directory needs to add /media/local to the url to display the image. The blueprint adds that automatically for the notification to work. But, as an example, is an image was save in /media/snapshots/computer_room_camera/last_motion.jpg, the url would acually be /media/local/snapshots/computer_room_camera/last_motion.jpg. That may be your issue. But, I cannot test this in iOS, as I do not have a device. Ask if someone who does have iOS if it works or not.
And you have haven’t already, update the blueprint.

I think I am seeing the similar issue. For my iOS iPhone, it shows the box to play video instead of showing a snapshot thumbnail in the notification. Is there any workaround?

The other BP from vorion works flawlessly with thumbnails for iOS devices, can you please see which line in that code can make iOS thumbnails work?

Thanks for your reply. Did you mean “URL to Navigate”? Please see my 2 photos.


I see, try setting file path to default in the /media, the latest version moved to that directory

make sure the video option is blank. Try the default file path.

Hi, I changed the default path to /media. Now, I got different error: 404. Can you please check my settings in the photos too? The last photo is my configuration.yaml. Do I have everything set correctly?




f

I’ll look into here shortly, got work later but I can look later this evening. It seems like it’s grabbing the image now, but doesn’t have permission to access it… I’m an not sure why but will look

double check for me that the file exists and you can load I via Home Assistant in the Media tab

Yes, I can. Please see my photo

Try to re-import your BP, and I got invalid BP error:

update your HA, I’m using the new Collapsible sections introduced in the newest HA.

Ok, you got the image, I’m unsure why the notification can’t attach the image. What you could do is try to send a notification with an image using the service and see if it’s the blueprint or something on your end.

Go to Developer Tools → Services and select the notify service for your device. Try the example below (change your notify device and image url to match yours), and see if the image sends. If no image, double-check the url, remember /media is /media/local

service: notify.mobile_app_pixel_8
data:
  message: test
  data:
    image: /media/local/snapshots/downstairs_camera/last_motion.jpg

Use the minimum HA version to prevent that…
About the blueprint schema - Home Assistant.

1 Like

Thanks, done!

1 Like

Hi!
Do you have the paid variant of Home Assistant?
If so, you find in the settings > Home Assistant Cloud > Remoteaccess the Link to your Homeassistant Server.

I guess this is necessary to access the snapshot.

This my Yaml:

alias: Klingelnotification mit Bild
description: ""
use_blueprint:
  path: TheRealFalseReality/send_snapshot_conditional.yaml
  input:
    condition: []
    conditionSave: []
    camera: camera.haupttor_snapshots
    notify_device: my_iphone_entity
    is_ios: true
    sensor: binary_sensor.klingel_binary_sensor
    data_clickaction_url: >-
      [here you have to put in the path from the Remoteacess]/local/Rrring/Door/last_motion.jpg
    file: " /config/www/Rrring/Door/last_motion.jpg"
    archive_file: " /config/www/Rrring/Door/archive/motion_{{ now().strftime(\"%Y%m%d-%H%M%S\") }}.jpg"
    notification_title: 🔔 Es klingelt oben!

Hmm, you need the remote access url path if using Home Assistant Cloud? I am using DuckDNS so I may have never encountered that issue before.

Hi,

can someone give detailed instructions to configure the media folder to save snapshots please?
I have HASSOS. These are my steps:

  • manually created a “media” folder in the same folder where configuration.yaml is (with File Editor)
  • added the following to the configuration.yaml:
homeassistant:
  media_dirs:
    local: /config/media
  • restarted HA
  • used the following in the File Path field of the Blueprint:
    /media/local/last_screenshot.jpg

… but I can’t see any file in that folder, and I get the “failed to load attachment” in the Companion App.
What’s wrong?

it saves in /media which is not actually in the /config directory. The /media/local is only for the notification for the blueprint and not the actual directory. Got to “Media” in HA, use the sidebar, → “My media” → and see if last_screenshot.jpg is there. If you use a File Explorer add-on, /media will be in the root directory of HA.
Try using the blueprint with all the defaults and see if it works. It seems like the directory is misconfigured. It was a lot to understand when I first setup the blueprint, I really had to read the documentation in order for the media to load, but the defaults should work and you may not need to do the media_dirs at all.

1 Like