1
0
ansible-home-assistant/roles/automations/files/camera.yaml

99 lines
2.6 KiB
YAML

- id: camera_livingroom_notification
alias: '[Camera] Living room notification'
mode: single
trigger:
- platform: state
entity_id: binary_sensor.kitchen_motion_sensor
from: 'off'
to: 'on'
# Use open/close sensors
- platform: state
entity_id: binary_sensor.dining_window_1_open_close
to: 'on'
- platform: state
entity_id: binary_sensor.dining_window_2_open_close
to: 'on'
- platform: state
entity_id: binary_sensor.office_window_open_close
to: 'on'
condition:
- condition: state
entity_id: alarm_control_panel.home_alarm
state: armed_away
action:
- service: notify.mobile_app_iphone
data:
message: Motion Detected in Living Room!
data:
entity_id: camera.living_room
url:
_: "/lovelace-tablet/security"
- id: camera_hallway_notification
alias: '[Camera] Hallway notification'
mode: single
trigger:
- platform: state
entity_id: binary_sensor.hallway_motion_sensor
from: 'off'
to: 'on'
- platform: state
entity_id: binary_sensor.front_door_open_close
to: 'on'
- platform: state
entity_id: lock.front_door_lock_doorlock
to: 'unlocked'
condition:
- condition: state
entity_id: alarm_control_panel.home_alarm
state: armed_away
action:
- service: notify.mobile_app_iphone
data:
message: Motion Detected in Hallway!
data:
entity_id: camera.hallway
url:
_: "/lovelace-tablet/security"
- id: camera_hallway_person_notification
alias: '[Camera] Hallway person detected'
mode: single
trigger:
- platform: state
entity_id: binary_sensor.hallway_person_occupancy
to: 'on'
condition:
- condition: state
entity_id: alarm_control_panel.home_alarm
state: armed_away
action:
- service: notify.mobile_app_iphone
data:
message: >
Person detected in Hallway!
data:
entity_id: camera.hallway_person
url:
_: "/lovelace-tablet/security"
- id: camera_livingroom_person_notification
alias: '[Camera] Living Room person detected'
mode: single
trigger:
- platform: state
entity_id: binary_sensor.living_room_person_occupancy
to: 'on'
condition:
- condition: state
entity_id: alarm_control_panel.home_alarm
state: armed_away
action:
- service: notify.mobile_app_iphone
data:
message: >
Person detected in Living Room!
data:
entity_id: camera.living_room_person
url:
_: "/lovelace-tablet/security"