AI-Powered Doorbell Notifications: A Fun and Functional Solution

Hi everyone,

I wanted to share a fun project I’ve been working on to enhance my front door security and notifications using AI. It’s been a blast to set this up, and I think it could be really useful for others looking to add a bit of personality and functionality to their smart home setup.

What It Does

This automation uses AI to analyze motion detected at my front door, takes multiple snapshots, sends instant notifications, and even provides a playful commentary about what’s happening. It’s like having a little camera assistant that keeps me informed in a fun way!

Requirements

Before diving in, here’s what you’ll need:

  • A camera that supports snapshots (e.g., Reolink, Tapo, UniFi Protect, Doorbird)
  • A binary sensor for person or motion detection
  • The AI Task integration in Home Assistant
  • A notification service (e.g., mobile app notifications)
  • Optional: TTS speakers for voice announcements

Setup Steps

  1. Copy the YAML Code: Paste the automation code into your Home Assistant automations.
  2. Adjust Entity IDs: Replace placeholders with your actual camera, sensor, and notification service IDs.
  3. Check Snapshot Paths: Ensure the folders /media/snapshots/ and /config/www/snapshots/ exist.
  4. Test It Out: Walk in front of your camera or trigger the motion sensor to see it in action!

Features

  • Instant Alerts: Immediate notifications with snapshots and deep links to the camera dashboard.
  • AI Commentary: A fun, reality-TV style update after analyzing the scene.
  • TTS Announcements: The AI commentary is spoken on your smart speakers.
  • Cooldown: A 40-second cooldown to prevent spam.

The Automation Code

yaml
alias: Front Door AI Vision (Reality-TV Style)
mode: single
max_exceeded: silent

triggers:

  • platform: state
    entity_id: binary_sensor.front_door_person_detection
    to: “on”

variables:
snapshot_dir: /media/snapshots
snapshot_www: /config/www/snapshots
camera_entity: camera.front_door_camera
notify_target: notify.mobile_app_my_phone
speaker_target: media_player.living_room_speaker
ai_entity: ai_task.openai_ai_task

actions:

  • parallel:

    Grab multiple snapshots

    • sequence:
      • service: camera.snapshot
        data:
        entity_id: “{{ camera_entity }}”
        filename: “{{ snapshot_dir }}/frontdoor_{{ now().timestamp() }}.jpg”
      • delay: “00:00:02”
      • service: camera.snapshot
        data:
        entity_id: “{{ camera_entity }}”
        filename: “{{ snapshot_dir }}/frontdoor_{{ now().timestamp() }}_2.jpg”
      • delay: “00:00:02”
      • service: camera.snapshot
        data:
        entity_id: “{{ camera_entity }}”
        filename: “{{ snapshot_dir }}/frontdoor_{{ now().timestamp() }}_3.jpg”
      • service: camera.snapshot
        data:
        entity_id: “{{ camera_entity }}”
        filename: “{{ snapshot_www }}/frontdoor_latest.jpg”

    Send immediate notification

    • sequence:
      • service: notify.mobile_app_my_phone
        data:
        title: “Front Door”
        message: “Person detected at the front door.”
        image: “/local/snapshots/frontdoor_latest.jpg”
        url: “/lovelace/cameras”

    AI analysis + commentary

    • sequence:

      • service: ai_task.generate_data
        response_variable: result
        data:
        entity_id: “{{ ai_entity }}”
        task_name: Front door camera analysis
        instructions: >
        You are a live reality-TV commentator narrating the front porch. Be playful and dramatic, but stay factual:
        - Say if the person is arriving, leaving, pausing, or turning (if clear).
        - Mention a vehicle ONLY if clearly interacting with it (opening, entering, exiting).
        - If direction/action is unclear, say “unclear” instead of guessing.
        - Output exactly 1–2 short sentences, never a paragraph.
        - Example: “And there he goes—quick pause, turn right—no car cameo tonight.”
        structure:
        analysis: selector:
        text: {}
        attachments: “{{ ai_attachments }}”
    • variables:
      final_text: >
      {{ result.data.analysis | default(result.response_text) | default(result.response) | default(‘No visible activity detected.’) | replace(‘*’,‘’) | trim }}

      • service: notify.mobile_app_my_phone
        data:
        title: “Front Door AI”
        message: “{{ final_text }}”
      • service: tts.speak
        target:
        entity_id: “{{ speaker_target }}”
        data:
        cache: false
        message: “{{ final_text }}”

Why I Love This Setup

  • Immediate Alerts: I get notified the moment someone is detected, with a snapshot and direct link to the camera.
  • AI-Driven Fun: The commentary adds a personal touch, making it feel like a mini-security show.
  • Hands-Off Operation: Once set up, it runs seamlessly without any manual intervention.

If you’ve been looking for a way to add some personality to your smart home security, I highly recommend giving this a try! Let me know if you have any questions or if you come up with any cool variations.

Cheers,
[Your Name]