1
0
ansible-home-assistant/configuration/automations/alarm-door-relock.yaml

43 lines
1.2 KiB
YAML
Raw Normal View History

2022-06-05 19:55:50 +00:00
- id: vacation-door-lock
alias: "[Alarm] Door relock"
trigger:
- platform: state
entity_id:
- lock.front_door_25f246fe_door_lock
to: unlocked
condition:
- condition: not
conditions:
- condition: state
entity_id: alarm_control_panel.home_alarm
state: disarmed
action:
2022-10-19 20:25:52 +00:00
- service: notify.mobile_app_iphone
2022-06-05 19:55:50 +00:00
data:
title: "Door unlocked!"
message: Front door was unlocked, trying to lock it back
- choose:
- conditions:
- condition: state
entity_id: binary_sensor.front_door_open_close
state: 'on'
sequence:
- wait_for_trigger:
- platform: state
entity_id: binary_sensor.front_door_open_close
to: 'off'
- repeat:
until:
- condition: state
entity_id: lock.front_door_25f246fe_door_lock
state: locked
sequence:
- service: lock.lock
target:
entity_id: lock.front_door_25f246fe_door_lock
2022-10-19 20:25:52 +00:00
- service: notify.mobile_app_iphone
2022-06-05 19:55:50 +00:00
data:
title: "Door locked back"
message: Front door was successfully locked
mode: single