-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathlight_timer.yaml
108 lines (106 loc) · 2.55 KB
/
light_timer.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
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
blueprint:
name: Light timer
description: Start a timer for an entity
domain: automation
input:
timer_entity:
name: Timer Entity
selector:
entity:
domain: timer
conditional_entity:
name: Conditional Entity
selector:
entity:
domain: switch
light_target:
name: Light
selector:
entity:
domain: light
trigger:
- platform: state
entity_id:
- !input light_target
to: "on"
from: "off"
id: "0"
- platform: state
entity_id:
- !input timer_entity
from: idle
to: active
id: "1"
- platform: state
entity_id:
- !input light_target
to: "off"
id: "2"
- platform: state
entity_id:
- !input timer_entity
from: active
to: idle
id: "3"
action:
- choose:
- conditions:
- condition: and
conditions:
- condition: state
entity_id: !input conditional_entity
state: "on"
- condition: state
entity_id: !input timer_entity
state: idle
- condition: state
entity_id: !input light_target
state: "on"
- condition: trigger
id: "0"
sequence:
- service: timer.start
data: {}
target:
entity_id: !input timer_entity
- conditions:
- condition: and
conditions:
- condition: state
entity_id: !input light_target
state: "off"
- condition: trigger
id: "1"
sequence:
- service: light.turn_on
data: {}
target:
entity_id: !input light_target
- conditions:
- condition: and
conditions:
- condition: state
entity_id: !input light_target
state: "off"
- condition: trigger
id: "2"
sequence:
- service: timer.cancel
data: {}
target:
entity_id: !input timer_entity
- conditions:
- condition: and
conditions:
- condition: state
entity_id: !input conditional_entity
state: "on"
- condition: trigger
id: "3"
sequence:
- service: light.turn_off
data: {}
target:
entity_id: !input light_target
mode: restart
max_exceeded: silent