-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathautomatic-door-lock.yaml
68 lines (61 loc) · 1.29 KB
/
automatic-door-lock.yaml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
---
# SPDX-License-Identifier: MIT
blueprint:
name: Automatic Door Lock (v0.1)
description: |
Automatically locks a door after a set amount of time. Valdiating that the
given door sensor is closed
domain: automation
input:
door_sensor:
name: Door sensor
description: Door sensor for lock
selector:
entity:
domain: binary_sensor
device_class: door
lock:
name: Lock
description: Door lock
selector:
entity:
domain: lock
wait_time:
name: Time to wait
description: Amount of time to wait in minutes before attempting to lock
selector:
number:
min: 0
max: 60
unit_of_measurement: minutes
default: 1
mode: single
trigger:
- platform: state
entity_id:
- !input lock
to: unlocked
for:
hours: 0
minutes: !input wait_time
seconds: 0
- platform: state
entity_id:
- !input door_sensor
to: "off"
condition:
- condition: state
entity_id: !input lock
state: unlocked
for:
hours: 0
minutes: !input wait_time
seconds: 0
- condition: state
entity_id: !input door_sensor
state: "off"
action:
- service: lock.lock
data: {}
target:
entity_id: !input lock