Repository navigation
Automation examples
A cookbook of common patterns. Adjust entity ids to match your devices.
-
Security notifications - combine
event.motionwith anotifyaction andcamera.snapshotto get a push notification with a still image whenever someone approaches, even while you're away. - Doorbell-and-announce - when a front-door camera detects a person, announce "Someone is at the door" through a speaker and flash the living-room lights.
- PTZ patrol - step through a sequence of pan/tilt positions on a schedule or when a zone becomes occupied.
-
Occupancy-triggered lighting - use
binary_sensor.occupancyto turn on outdoor lights when the camera detects presence, off a fixed time after it clears. - Recording review in HA - browse and replay cloud clips in the Media panel (see Cloud recordings).
Send a mobile notification with a camera still when motion is detected.
alias: Camera motion alert
triggers:
- trigger: state
entity_id: binary_sensor.front_door_occupancy
to: "on"
actions:
- action: camera.snapshot
target:
entity_id: camera.front_door
data:
filename: /config/www/snapshots/front_door_latest.jpg
- action: notify.mobile_app_my_phone
data:
title: Motion detected
message: Someone is at the front door.
data:
image: /local/snapshots/front_door_latest.jpgThe event.motion entity fires with an event_type of person for person
detections and motion for general motion. Filter on person to avoid
triggering on animals or branches.
alias: Floodlight on person
triggers:
- trigger: event
event_type: state_changed
event_data:
entity_id: event.backyard_motion
actions:
- condition: template
value_template: >
{{ trigger.event.data.new_state.attributes.event_type == 'person' }}
- action: light.turn_on
target:
entity_id: light.backyard_floodlight
- delay:
seconds: 60
- action: light.turn_off
target:
entity_id: light.backyard_floodlightStep through positions in sequence. Each button.press nudges the camera; adjust
the delay to control dwell time. The camera must be streaming for PTZ
commands to reach it - include a camera_view: live card on a dashboard to keep
the session alive, or start the stream with a camera.turn_on action before the
sequence.
alias: PTZ patrol
triggers:
- trigger: time_pattern
minutes: /30
actions:
- action: button.press
target:
entity_id: button.outdoor_ptz_ptz_left
- delay:
seconds: 5
- action: button.press
target:
entity_id: button.outdoor_ptz_ptz_stop
- delay:
seconds: 10
- action: button.press
target:
entity_id: button.outdoor_ptz_ptz_right
- delay:
seconds: 5
- action: button.press
target:
entity_id: button.outdoor_ptz_ptz_stopalias: Announce at the door
triggers:
- trigger: state
entity_id: binary_sensor.front_door_occupancy
to: "on"
actions:
- action: aidot.talk
target:
entity_id: camera.front_door
data:
media: "media-source://media_source/local/please_wait.mp3"
max_seconds: 10PTZ requires an active stream. If an automation runs it against an idle camera, start the stream first (
camera.turn_on) and allow for the cold-start delay described in Cameras.aidot.talkdoes not need one - it reuses the live session when there is one and otherwise opens its own temporary session - but an idle camera still pays that cold start before the clip plays.
AiDot for Home Assistant / camera-capable fork of AiDot-Development-Team/hass-AiDot / device communication via python-aidot-cameras / MIT licensed / Open an issue
Getting started
Cameras
- Cameras overview
- Dashboard cards
- PTZ control
- Two-way audio
- Resolution (removed)
- Cloud recordings
- On-device recordings
Lights
Using it
Help