Doorbell Notification with Camera Snapshot

It took me a long time to find a proper doorbell notification that has the camera snapshot added to it. I found another post of a blueprint that was specific to esphome. I took that and modified it so it should allow selection of any binary sensor to trigger the notification. This allowed me to use my Unifi G4 Doorbell.

Open your Home Assistant instance and show the blueprint import dialog with a specific blueprint pre-filled.

This does need configuration per mobile device since iOS and Android structure pictures in notifications differently. If someone figures out how to make a list of devices to add and segregates them by device type, I’ll be happy to update my blueprint.

Here’s a direct link to my blueprint yaml:

2 Likes

nice scheme, if I may ask, add an option which, together with sending a photo as a notification, gives the option to choose, for example, open the door or do not open the door and after selecting, open the door to release, trigger the electric lock or any other entity.

Prześlij opinię

[

Tłumacz Google

[image]
Tłumacz Google
](https://translate.google.pl/)

It does have the option to open a dashboard when tapped. I have chosen a dashboard that has the door locks and camera feed for easy access. I recommend this instead of tapping the notification to unlock the door to prevent miss-taps.

ok, I understand but can I ask for this option? it is also convenient and if possible safe, setting e.g. time for reaction or confirmation of execution :slight_smile: you are very welcome and best regards

I can understand wanting the functionality. I’m not sure how to implement it yet. If you or someone else wants to figure out how to add that in the code, I’ll make that update.

In this script you can see the options I mentioned :slight_smile:

Really cool feature!
I’d love to use this, but unfortunately it doesn’t work correctly with the google nest doorbell. The trigger works, the notification is sent, but it does not contain a picture. manually checking the picture on HA shows me a blick picture (which is the same I get for my doorbell camer preview). In generell the doorbell camer works, it just takes a bit to load the picture.

I have to correct myself. I do see the thumbnail in the push notification now - but it is still black. I read on various pages that the nest doorbell (battery) does neither support screenshots nor thumbnails. So not caused by your code, but by the camera itself :frowning: That sucks… your blueprint is very nice indeed!

Hi This sounds very nice.

I tried to use this but I get an error. Apologies if I’ve missed something as I’m pretty new to automations in HA.

Yet if I call the service using developer tools it works fine:

The ‘doorbell’ folder in www exists and does contain the snapshots.

Automation:

mode: single
max_exceeded: silent
variables:
  notify_device: [redacted]
  camera: camera.front_door_bell_high
  blocker_entity: null
  no_motion_wait: 30
  store_location: doorbell
trigger_variables:
  vehicle_sensor: null
  pet_sensor: null
triggers:
  - platform: state
    entity_id: binary_sensor.front_door_bell_person_detected
    from: 'off'
    to: 'on'
    id: person
  - platform: template
    value_template: '{{ is_state ( vehicle_sensor , ''on'' ) }}'
    id: vehicle
  - platform: template
    value_template: '{{ is_state ( pet_sensor , ''on'' ) }}'
    id: pet
conditions:
  - condition: template
    value_template: '{{ (blocker_entity == none) or (states[blocker_entity].state == ''off'') }}'
actions:
  - data:
      filename: >-
        /config/www/{{store_location}}/{{ trigger.to_state.last_changed |
        as_timestamp | timestamp_custom("%Y-%m-%d_%H-%M-%S") }}.jpg
    target:
      entity_id: camera.front_door_bell_high
    action: camera.snapshot
  - data:
      title: Camera Detection
      message: '{{ state_attr(camera, ''friendly_name'') }} has detected a {{trigger.id}}'
      data:
        image: >-
          /local/{{store_location}}/{{ trigger.to_state.last_changed |
          as_timestamp | timestamp_custom("%Y-%m-%d_%H-%M-%S") }}.jpg
        channel: Motion
        importance: high
        ttl: 0
        priority: high
        notification_icon: mdi:cctv
    action: >-
      notify.mobile_app_{{ device_attr(notify_device, 'name').lower()
      |regex_replace(find=' ', replace='_', ignorecase=False) }}
  - condition: template
    value_template: '{{ no_motion_wait != none }}'
  - delay:
      seconds: '{{ no_motion_wait | int }}'
id: '1745810258398'
alias: Front Door Bell Camera Detection Notification
description: ''

Config:

id: '1745810258398'
alias: Front Door Bell Camera Detection Notification
description: ''
use_blueprint:
  path: apollo1220/camera_detection_notification.yaml
  input:
    notify_device: [redacted]
    camera: camera.front_door_bell_high
    person_sensor: binary_sensor.front_door_bell_person_detected
    no_motion_wait: 30