-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathautomation_disabler_switch.yaml
80 lines (72 loc) · 2.58 KB
/
automation_disabler_switch.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
69
70
71
72
73
74
75
76
77
78
79
80
blueprint:
name: Automation Disabler - Switch
description: |
This automation will disable another automation upon the physical actuation of a light switch device.
- Pressing the On, Raise, or Lower buttons will cause the automation to be disabled for the specified time. After the time expires the automation is re-enabled and the switch is turned off.
- Pressing the Off button, will cause the automation to be immediately re-enabled.
domain: automation
input:
light:
name: Light Switch(es)
description: The light entity(ies) which, when physically pressed, will cause the automation to be controlled.
selector:
entity:
filter:
domain: light
multiple: true
automation:
name: Automation(s)
description: The automation(s) that will be controlled.
selector:
entity:
filter:
domain: automation
multiple: true
time:
name: Time
description: The number of minutes for which the automation(s) will be disabled.
default: 60
selector:
number:
min: 0
max: 1440
unit_of_measurement: minutes
trigger:
- trigger: state
entity_id: !input light
condition:
- condition: template
value_template: >-
{{ trigger.to_state.context.parent_id == None and
trigger.to_state.context.user_id == None }}
action:
- choose:
- conditions:
- condition: state
entity_id: !input light
state: "on"
sequence:
- action: automation.turn_off
data: {}
target:
entity_id: !input automation
- delay:
minutes: !input time
- action: automation.turn_on
data: {}
target:
entity_id: !input automation
- action: light.turn_off
data: {}
target:
entity_id: !input light
- conditions:
- condition: state
entity_id: !input light
state: "off"
sequence:
- action: automation.turn_on
data: {}
target:
entity_id: !input automation
mode: restart