šŸ“ø Send camera snapshot notification on motion

not really, can you see the timestamp on the file name also being the previous one? Seems a bit off if the timestamp is not updated in the notification. (behavior without timestamp could be explained: caching of the image, so itā€™s just displaying old non expired cached one)

Hi, I used your code and adjusted it (badly) to support unifi protect doorbells.

Be cool if you could update the template so it support doorbell press as well as motion,

But im not expert of HASā€¦ but this works for meā€¦ but im sure blueprint could be improved.
GitHub Link

you can paste this into your import blueprint thing and it will create the blueprint in HAS

Jade

p.s I did the bare min to get this to work for doorbell and works mint! When you select the doorbell binary_sensor.doorbell_doorbell object. ( I suspect mines called that because I called my doorbell > doorbell)

I did a crap job of making it work. And it works mint.
Just used that blueprint and made some changes so it would work for doorbell.

Works mint.

1 Like

i manualy changed it already, to a state change, as my doorbell does a state change

I tried to google this but canā€™t seem to find anything specific, but could someone explain what the %s is doing in the last few lines of the code?

Looks like it is setting up the snapshot location for iOS or Android device, depending on the is_ios variable, but not understanding what the %s does/adds.

attachment:
  url: snapshot.jpg

and

image: snapshot.jpg

Hi
Based on Frenckā€™s doorbell and Vorionā€™s motion detection blueprint, i combined both and created this blueprint:
Open your Home Assistant instance and show the blueprint import dialog with a specific blueprint pre-filled.

Slightly odd one from meā€¦ For the last few weeks the automation has kept sending an old image through in the notificationā€¦ I have checked /config/www/tmp/ and a new image is generated correctly every time it runs, however the image sent through in the notification is a different imageā€¦?

Where does it pick this image up from?

The same happens on my system.

The blueprint looks great. I am having some issues. I get the following error ā€œUnable to find notify service for webhook IDā€ any idea on how to fix it?

Seems it uses /config/www/tmp as folder
But uses ā€˜local/tmpā€™ internally to access it

Hello.

super blueprint. will it be possible to make it so that the trigger is the switch on the doorbell instead? would like it so that my doorbell sends a picture to my cellphone when the doorbell is thickened ā€¦ :slight_smile:

1 Like

super ā€¦ thank you very much

i have to try but it looks like i can not set entity_id. I use unifi g4 doorbell ā€¦ :slight_smile:

My bad. :slight_smile: got it to workā€¦:slight_smile: thanx chefā€¦:slight_smile:

1 Like

Iā€™m new to using blueprints, so Iā€™m not exactly sure where to start troubleshooting. Iā€™m getting this error message in the HA logs.

homeassistant | 2021-08-04 15:14:25 ERROR (MainThread) [homeassistant.components.automation.send_a_camera_snapshot_when_motion_is_detected] Send a camera snapshot when motion is detected: Error rendering Send a camera snapshot when motion is detected delay template: offset should be format 'HH:MM', 'HH:MM:SS' or 'HH:MM:SS.F'

I did a little digging and it seems like there is a workaround by changing the ā€œoptionalā€ delay in the automation to something other than the default. I just bumped it up to 1s and it works fine now. Since the delay is labeled as optional in the automation I wouldnā€™t have expected to need to change it to make it work.

At any rate, a 0s or 1s delay makes no difference to me. Thanks for putting the blueprint together!

1 Like
 Hello and sorry if i'm off topic. I searched a lot before writting this message and i need halp with a blueprint. I tried myself to modify an existing blueprint like yours but it didn't work. What i need, is a blueprint to send camera snapshot based on door window sensor (binary). I think thtat your blueprint will do it if you just leave the choise to trigger on any binary sensor. Thank you so much for your work with this blueprint, is very usefull.

Did you manage to get around with this?

Yes, but in other way. I made my own automation:

alias: Intrusion Alert Send Inside Snapshot to Telegram
description: ''
trigger: []
condition: []
action:
  - repeat:
      until:
        - type: is_no_motion
          condition: device
          device_id: a2321254d4ce4c258fb56559f988deac
          entity_id: binary_sensor.motion_occupancy
          domain: binary_sensor
      sequence:
        - service: telegram_bot.send_photo
          data:
            disable_notification: true
            caption: Intrusion Alert!
            url: >-
              https://your.ha.com{{ states.camera.inside.attributes.entity_picture }}
        - delay:
            hours: 0
            minutes: 0
            seconds: 3
            milliseconds: 0
mode: single
variables:
  camera: camera.inside
  snapshot_url: '{{ states.camera.inside.attributes.entity_picture }}'

When creating it in editor put the url in last as it breaks the visual editor and afterwards you gotta edit in yaml. Your entity names/ids will be different but should give you the idea.

I got another automation that triggers on door opening, light switch pressing and motion sensors if I am away and that in turn triggers this one to send a photo to telegram every 3 seconds until motion is stopped.

Hi
Iā€™m trying to replicate your telegram bot automation but Iā€™m new to home assistant and Iā€™m not able to find what to replace on this

states.camera.inside.attributes.entity_picture

This is my automation code

- alias: Intrusion Alert to Telegram Cam Ingresso
  description: ''
  trigger: []
  condition: []
  action:
  - repeat:
      until:
        - type: is_no_motion
          condition: device
          device_id: Cam ingresso
          entity_id: binary_sensor.cam_ingresso_motion
          domain: binary_sensor
      sequence:
        - service: telegram_bot.send_photo
          data:
            disable_notification: true
            caption: Intrusion Alert!
            url: >-
             https://your.ha.com{{ states.camera.inside.attributes.entity_picture }}
        - delay:
            hours: 0
            minutes: 0
            seconds: 3
            milliseconds: 0
  mode: single
  variables:
    camera: camera.inside
    snapshot_url: '{{ states.camera.inside.attributes.entity_picture }}'