Home Assistant Doorbell Notifications: Show the Snapshot and Open a Camera View

A Home Assistant doorbell alert can show the captured image and open a camera view when you tap it. This guide shows how to take a snapshot, attach it to a phone notification, and add a dashboard view for the camera.

Before you start

  • Add your camera to Home Assistant.
  • Install the Home Assistant Companion app on your phone.
  • Allow notifications in the app and on your phone.
  • Find your person-detection entity, camera entity, and phone notification service.

Replace the example entity IDs below with your own. Find them under Settings > Devices & services > Entities. Your phone service starts with notify.mobile_app_.

Add a doorbell view

Create a dashboard view for the camera. Open your dashboard, select Edit dashboard, then add a view. Set its title to Doorbell and its path to doorbell.

Add a Picture entity card. Select your camera entity and set its camera view to Auto. Save the dashboard. For the default dashboard, this view opens at /lovelace/doorbell.

If you use another dashboard, copy the full view URL from your browser. Use that path in both notification link fields.

Capture and send the image

Add a state trigger for your person-detection entity. Then add a snapshot action before the notification action. This order lets Home Assistant save the image before it sends the alert.

alias: Doorbell person snapshot notification
triggers:
  - trigger: state
    entity_id: binary_sensor.front_door_person
    to: "on"
actions:
  - variables:
      event_id: "{{ now().strftime('%Y%m%d-%H%M%S-%f') }}"
  - action: camera.snapshot
    target:
      entity_id: camera.front_door
    data:
      filename: "/media/doorbell_{{ event_id }}.jpg"
  - action: notify.mobile_app_your_phone
    data:
      title: "Person at front door"
      message: "Tap to open the doorbell camera."
      data:
        image: "/media/local/doorbell_{{ event_id }}.jpg"
        attachment:
          url: "/media/local/doorbell_{{ event_id }}.jpg"
          content-type: jpeg
        url: "/lovelace/doorbell"
        clickAction: "/lovelace/doorbell"

The timestamp gives each snapshot a unique filename. The notification uses that same file, so it shows the frame from this event. The image field adds the image; attachment sets its type for iOS.

The url field opens the view on iOS. The clickAction field opens it on Android. Keep both fields if your household uses both phone types.

The example saves files under Home Assistant’s /media directory. The Companion app can retrieve these files through Home Assistant’s authenticated media source. If your setup uses /config/www, the matching notification path starts with /local/. Check access controls before you use that path for camera images.

Test each step

  1. Open Settings > Developer tools > Actions.
  2. Run camera.snapshot with your camera entity and a filename such as /media/test-doorbell.jpg.
  3. Send a test notification with image: /media/local/test-doorbell.jpg and both view-link fields.
  4. Confirm the phone shows the image. Expand the notification to view it at full size.
  5. Tap the notification and confirm Home Assistant opens the Doorbell view.

If the phone shows no image, check that the file exists and the phone can reach Home Assistant. Also check the Companion app’s connection settings and notification permissions.

Protect camera images

Camera snapshots can show people, visitors, and parts of your home. Do not put them on a public website or an unauthenticated file server. Use authenticated Home Assistant access, and limit file retention to what you need.

Sources

Leave a Reply

Your email address will not be published. Required fields are marked *