The One-Tap “Did I Leave the House Open?” Report
The question hits a mile from the house: did I close the garage? The house now answers before I finish asking, and if the answer is no, the fix rides along in the same notification.
the report
A few minutes after my phone leaves the home zone, my phone and watch get a one-line status: doors ✓, locks ✓, garage ✓. Attached: a fresh snapshot from the garage camera and an AI count of which vehicles are home.
On a clean report, that’s the whole interaction. A glance at the watch, done. When something is open or unlocked, the notification says so and grows a Secure Home button. One tap closes the garage and locks the exterior doors, then a follow-up confirms what it did. Peace of mind and the fix, in the same message, from the freeway.
sensors for truth, AI for color
Early on I considered asking the AI to judge everything from the camera frame: is the garage closed, are cars home. Bad allocation. Home Assistant already holds authoritative state for covers and locks; asking a vision model to re-derive what a sensor reports invites a confident wrong answer about your own security.
The split that works: sensors provide the security facts (cover states, lock states, door sensors), and the AI answers the one question sensors can’t, which vehicles are sitting in the garage. The vehicle count is color commentary. Useful color, “both cars home” versus “wife’s car out,” but nothing safety-critical rides on it. Put the model where a wrong answer costs you a shrug, and keep it away from where a wrong answer costs you an open house.
the flow
Zone-leave trigger, short delay so the garage door finishes closing behind me. Template conditions collect anything in a bad state: covers not closed, locks not locked. A camera snapshot and a one-line AI prompt (“count the vehicles in this garage; answer like: 2 vehicles: truck, sedan”) fill in the color. All-clear sends the ✓ line. Anything open sends the problem list plus the action button.
The Secure Home handler is its own tiny automation listening for the button’s action event: close the garage covers, lock the exterior lock group, wait, then report back the new states. Report back, in the actual after-states, matters. The button press is a command; the follow-up is the receipt. Trusting the receipt is what lets you stop thinking about it.
the config shape
Sanitized skeleton. I group the exterior locks behind a single group entity and keep door specifics out of published configs; you should too. Details that map your security layout onto the internet are the one thing this hobby says not to share.
- id: leaving_home_report
alias: "Away — house status report on leave"
trigger:
- platform: zone
entity_id: person.me
zone: zone.home
event: leave
action:
- delay: "00:03:00"
- variables:
problems: >
{% set p = [] %}
{% if not is_state('cover.garage_doors', 'closed') %}
{% set p = p + ['garage open'] %}{% endif %}
{% if not is_state('lock.exterior_locks', 'locked') %}
{% set p = p + ['a door is unlocked'] %}{% endif %}
{{ p }}
- service: camera.snapshot
target:
entity_id: camera.garage
data:
filename: /config/www/snapshots/garage_leave.jpg
- service: ai_task.generate_data
data:
task_name: vehicle_count
instructions: >
Count the vehicles visible in this garage image.
Answer in one line like: "2 vehicles: truck, sedan".
If the image is unclear, answer "vehicle count unavailable".
attachments:
media_content_id: media-source://media_source/local/snapshots/garage_leave.jpg
media_content_type: image/jpeg
response_variable: vehicles
continue_on_error: true
- service: notify.my_phone
data:
title: >
{{ '✅ House secure' if problems | count == 0 else '⚠️ House NOT secure' }}
message: >
{{ 'Doors ✓ Locks ✓ Garage ✓' if problems | count == 0
else problems | join(', ') }} ·
{{ vehicles.data if vehicles is defined else 'vehicle count unavailable' }}
data:
image: /local/snapshots/garage_leave.jpg
actions: >
{{ [] if problems | count == 0 else
[{'action': 'SECURE_HOME', 'title': 'Secure Home'}] }}
mode: single
- id: secure_home_handler
alias: "Away — Secure Home button handler"
trigger:
- platform: event
event_type: mobile_app_notification_action
event_data:
action: "SECURE_HOME"
action:
- service: cover.close_cover
target:
entity_id: cover.garage_doors
- service: lock.lock
target:
entity_id: lock.exterior_locks
- delay: "00:00:45"
- service: notify.my_phone
data:
title: "🔒 Secured"
message: >
Garage: {{ states('cover.garage_doors') }} ·
Locks: {{ states('lock.exterior_locks') }}
mode: single
Note the continue_on_error on the AI step, and the guard on vehicles in the message template. My first version used the AI result bare in the template; the day the AI call failed, the template errored and the entire security report silently skipped sending. The AI is garnish here, and garnish must not be able to knock over the plate.
what it replaced
The turn-the-car-around check. The “text the neighbor to walk over” favor. The low-grade background hum of not being sure. A camera, four service calls, and one honest template beat all of it.
Pair this with camera Q&A automations and the house starts to feel less like a thing you monitor and more like a thing that reports to you. That distinction is most of why I do any of this.



Post Comment