Front Door AI Vision Automation (with Snapshots + Fun Commentary)
Hi everyone,
Tonight is first time to try to post here and my first one may have gone to the wrong place.
I built an automation that takes multiple snapshots when someone is detected at the front door, sends instant notifications, and then uses AI to provide a short, playful “reality-TV style” commentary about what’s happening (arriving, leaving, pausing, etc).
It works with any camera that can do snapshots and a detection sensor (person or motion). Notifications include deep links to HA’s camera dashboard, and you can also have the AI commentary spoken on your smart speakers.
Requirements
Before you paste the YAML, here’s what you’ll need:
- A Camera in Home Assistant
- Must support camera.snapshot.
- Example: Reolink, Tapo, UniFi Protect, Doorbird, etc.
- A Binary Sensor for Person/Motion Detection
- Example: binary_sensor.front_door_person_detection.
- Some cameras provide person detection. If not, you can use generic motion detection.
- AI Task Integration
- You need the new AI Task integration in Home Assistant 2025.
- Works with OpenAI (ai_task.openai_ai_task), Google Gemini (ai_task.google_ai_task), or other supported providers.
- Notification Service
- Example: notify.mobile_app_YOUR_PHONE.
- Needed if you want push notifications with snapshots.
- (Optional) TTS Speakers
- Example: media_player.YOUR_SPEAKER.
- Any media_player entity that supports TTS will work.
Setup Steps
- Copy the YAML code from this post into your automations.
- In HA: Settings → Automations & Scenes → Add Automation → Edit in YAML → Paste.
- Adjust entity IDs
- Replace camera.YOUR_FRONT_DOOR_CAMERA with your camera.
- Replace binary_sensor.YOUR_PERSON_OR_MOTION_SENSOR with your detection sensor.
- Replace notify.mobile_app_YOUR_PHONE with your notification service(s).
- Replace media_player.YOUR_SPEAKER with your speaker(s).
- Check snapshot paths
- This automation saves images to /media/snapshots/ and copies one to /config/www/snapshots/.
- Make sure you have both folders in place.
- Update AI Task entity if needed
- Change ai_task.YOUR_AI_TASK_ENTITY to your actual AI task entity (for example ai_task.openai_ai_task).
- Save and test
-
Walk in front of your camera or trigger your person sensor.
-
You should get:
- Immediate “Person detected” spoken on speakers.
- Instant notification with snapshot + deep link.
- A second update with the AI commentary after all frames are analyzed.
Features
- Fast initial alert (first snapshot + instant push).
- Full analysis (multiple frames captured and sent to AI).
- Fun commentary (reality-TV style, always 1–2 sentences).
- iOS deep links to jump directly into HA’s Cameras dashboard.
- TTS announcements on speakers of your choice.
- 40s cooldown so you don’t get spammed.
alias: Front Door AI Vision (Reality-TV Style)
mode: single
max_exceeded: silent
triggers:
- platform: state
entity_id: binary_sensor.YOUR_PERSON_OR_MOTION_SENSOR
to: "on"
variables:
snapshot_dir: /media/snapshots
snapshot_www: /config/www/snapshots
camera_entity: camera.YOUR_FRONT_DOOR_CAMERA
notify_target: notify.mobile_app_YOUR_PHONE
speaker_target: media_player.YOUR_SPEAKER
ai_entity: ai_task.YOUR_AI_TASK_ENTITY
actions:
- parallel:
# 1. Grab 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"
# 2. Send immediate notification
- sequence:
- service: notify.mobile_app_YOUR_PHONE
data:
title: "Front Door"
message: "Person detected at the front door."
data:
image: "/local/snapshots/frontdoor_latest.jpg"
url: "/lovelace/cameras"
# 3. 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: only describe what is visible.
- 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_YOUR_PHONE
data:
title: "Front Door AI"
message: "{{ final_text }}"
- service: tts.speak
target:
entity_id: "{{ speaker_target }}"
data:
cache: false
message: "{{ final_text }}"