📸 Send camera snapshot notification on motion

This is super awesome… thank you man!

It would be incredibly awesome if you add actionable buttons to the notification.

Really appreciate such work man :heart:

3 Likes

Hey, i replace the code but still no image in the notification, i can see the picture on the www folfer though, any advice

Hey there, I got the notification but not the image, I try replacing the code that someone said and nothing, I can check the snapshot in the www folder
Thanks for any advice !

Logger: homeassistant.components.automation.new_automation_12
Source: core.py:1399
Integration: Automation (documentation, issues)
First occurred: 12:45:38 AM (3 occurrences)
Last logged: 12:46:32 AM

While executing automation automation.new_automation_12

Traceback (most recent call last): File “/usr/src/homeassistant/homeassistant/components/automation/init.py”, line 404, in async_trigger await self.action_script.async_run( File “/usr/src/homeassistant/homeassistant/helpers/script.py”, line 1026, in async_run await asyncio.shield(run.async_run()) File “/usr/src/homeassistant/homeassistant/helpers/script.py”, line 242, in async_run await self._async_step(log_exceptions=False) File “/usr/src/homeassistant/homeassistant/helpers/script.py”, line 250, in _async_step await getattr( File “/usr/src/homeassistant/homeassistant/helpers/script.py”, line 457, in _async_call_service_step await service_task File “/usr/src/homeassistant/homeassistant/core.py”, line 1399, in async_call processed_data = handler.schema(service_data) File “/usr/local/lib/python3.8/site-packages/voluptuous/schema_builder.py”, line 272, in call return self._compiled([], data) File “/usr/local/lib/python3.8/site-packages/voluptuous/schema_builder.py”, line 594, in validate_dict return base_validate(path, iteritems(data), out) File “/usr/local/lib/python3.8/site-packages/voluptuous/schema_builder.py”, line 432, in validate_mapping raise er.MultipleInvalid(errors) voluptuous.error.MultipleInvalid: required key not provided @ data[‘filename’]

How can I extend the blueprint to include a state condition like input_boolean.nobody_home or Alarm Away enabled etc…

1 Like

I found some inspiration here: https://github.com/frenck/home-assistant-config/tree/master/config/blueprints/automation

Would you mind sharing how you get the image stored in /media to show up in the notification? I have been searching for hours and I manage to store the file in /media but just can’t get it to show up in the notification.

Hi all,

I’m new to home assistant but am playing around a lot lately. Would it be possible to modify this blueprint so it does not send snapshots on movement but on ‘ding’. I know with Ring devices there is a binary sensor called binary_sensor.devicename_ding but I can’t figure out how to use this in this blueprint in stead of using the motion sensor.

All help appreciated. Regards, Ted

How to add a different image to each capture rather than replace it. so snapshot1.jpg then snapshot2.jpg etc…. to be able to keep all the captures. Thanks to you.

and I don’t have a preview, this is my notify on my Apple Watch:
IMG_0331 2

And on my iPhone:

Just want to say Thank you! and It Worked!

Hey there, My problem is that with first of running that blueprint the snapshot was taken and every time when motion is detected I still receive that first snapshot.
I use IOS with companion app.
Does anyone of you guys had that problem? Is it refreshing problem?
Thanks for the helpful advice!

Thank you vorion for this great blueprint. I get the snapshot on my Android and iOS with the change from TimVa:

  data: '{% set android_data = {"image": "%s"} | format(snapshot_access_file_path)
  %} {% set ios_data = {"push": {"sound": {"critical": "1", "name": "default", "volume": "0.1"}}, "attachment": {"url": "%s", "content_type": "JPEG"}} | format(snapshot_access_file_path)
  %} {{ ios_data if is_ios else android_data }}'

It’s very useful! Thank you for sharing!

No one curious about an option which does not send snapshot on motion but on ‘ding’? I don’t want snapshots with myself on it for 90% of the time :slight_smile:

Hi, there. I have the same problem. How was your solution? Can you help me with that?
Thx.

I tested this blueprint / automation on my Home-assistant core 2021-3-2.
Notifications on my mobile phone works but without the picture of my hikvision camera.
In de log i saw an error: the automation could not create /config/www/tmp/snapshot_voortuin.jpg

I restored the HA virtual machine so i could try again to import this blueprint on a clean HA system but still the same. What am i missing why is the picture not showing and/or why is this directory not created?

Hi!
Many Thanks!
Everything works perfectly in my home WiFi. I get a photo within a few seconds.

However, if I am not connected to my home network, I only get a notification without a snapshot.

What can this be?

With the blink camera it doesn’t seems to work.

The error of the log file:
offset should be format ‘HH:MM’, ‘HH:MM:SS’ or ‘HH:MM:SS.F’

That question has been asked and answered many times — also on this topic. Have you searched the forum for this?

Is your HA instance accessible outside of your home network?

1 Like

Yesterday i searched all day on google en here on the board. My mobile phone is connected to my local wifi network. I don’t need access from the internet for local traffic. Maybe i should tell that my wifi mobile phones are on a other subnet then my HA system. If HA is trying to contact my mobile and would be blocked i should see errors in my firewall (pfSense) log.

In HA log i see messages that /config/www/tmp/snapshot_voortuin.jpg not created. Were and what should create this /config/www/tmp ?

You need to create the directory manually first.

Whatever your network setup, your mobile device must be able to resolve the URL to the image. You can test it by going to http(s)://<your_ha_instance>:<the_port>/local/snapshot_voortuin.jpg e.g. http://homeassistant.local:8123/local/snapshot_voortuin.jpg.