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:

3 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.

1 Like

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.

1 Like

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!

1 Like

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

Hello there SpeedySpikes. I love this blueprint. I am having a challenge. I have a Nest doorbell camera (unfortunately). Your blueprint calls for a binary sensor for the trigger. The Nest Doorbell button is not set up as a binary switch and I can’t figure out how to make it a binary switch. In fact, I don’t know what kind of entity it is. On the device details, it shows as ā€œChimeā€ (see screenshot) and i don’t think that is an offical recognized entity. Any ideas or work-arounds?

After many hours, i figured out how to enter to code that would change a nest doorbell to a binary switch that works in this blueprint.
Below is the template in case anyone needs it:

- binary_sensor:
    - name: Doorbell Courtyard Gate Binary Sensor Template
      unique_id: doorbell_courtyard_gate_binary_sensor_template
      icon: mdi:doorbell
      device_class: presence
      delay_off:
        seconds: 20
      state: >
        {{ is_state('event.doorbell_courtyard_gate_chime','on') }}`Preformatted text

I now have a new challenge if anyone can help.
I created (and re-created) a doorbell dashboard. Every path to camera dashboard I try does not work. When I click ā€œRun Actionsā€ for the automation, click the popup, it takes me to my default dashboard. I have tried entering these paths and nothing works:
dashboard-doorbell
/dashboard-doorbell
/doorbell
doorbell
dashboard_doorbell
/dashboard_doorbell

And below is the first page when i created the dashboard:

Anyone know what I am doing wrong?

Are you from Poland? Write to the Home-Assistant Facebook group, jamamzrobione, so that by displaying the snapshot on your tablet, I have the electric strike opening button there.

I am Polish nationality but I live in America. Why do you ask?
Also, apologies but I don’t understand the second part of your ststement.

Are you adding the url of the specific page inside the newly created dashboard? You have dashboards, and within dashboards you have different pages, by default when you create an entirely new dashboard, the default page will have the url, 0, so if you created a dashboard with the url dashboard-doorbell, you’re full URL to the dashboard main page would be /dashboard-doorbell/0 You can see the current URL by navigating to the dashboard page, and viewing the full url in the address bar.

I did not know about the zero for the new dashboard, thank you. I have tried every variation again and none of them worked. This is a rental house so I am not there therefore it is a remote url. I still tried every variation of that as well and nothing worked. Below is the url on that specific dashboard page
image

Any other ideas on what I could try?