-
Notifications
You must be signed in to change notification settings - Fork 0
/
automatic_lighting-bedroom.yaml
130 lines (130 loc) · 3.5 KB
/
automatic_lighting-bedroom.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
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
alias: Automatic Lighting - Bedroom
description: ""
trigger:
- platform: state
entity_id:
- binary_sensor.bedroom_occupancy
to: "on"
id: Motion
- platform: template
value_template: "{{is_state('binary_sensor.bedroom_occupancy','off') }}"
for:
seconds: "{{ states('input_number.bedroom_light_auto_off_time')|int(0) }}"
id: No Motion
- platform: state
entity_id:
- binary_sensor.night_mode
id: Night Mode On
to: "on"
- platform: state
entity_id:
- binary_sensor.night_mode
id: Night Mode Off
to: "off"
- platform: state
entity_id:
- input_boolean.sleep_mode
to: "on"
id: Sleep Mode On
- platform: state
entity_id:
- input_boolean.sleep_mode
to: "off"
id: Sleep Mode Off
- platform: state
entity_id:
- media_player.bedroom_tv
id: TV On
to:
- idle
- paused
- playing
- platform: state
entity_id:
- media_player.bedroom_tv
id: TV Off
to:
- "off"
- standby
condition: []
action:
- choose:
- conditions:
- condition: or
conditions:
- condition: trigger
id: Motion
- condition: trigger
id: Night Mode On
- condition: trigger
id: Sleep Mode Off
- condition: state
entity_id: light.bedroom_lamps
state: "off"
for:
hours: 0
minutes: 0
seconds: 10
- condition: state
entity_id: input_boolean.bedroom_automatic_lights
state: "on"
- condition: state
entity_id: binary_sensor.bedroom_occupancy
state: "on"
- condition: state
entity_id: binary_sensor.bedroom_night_mode
state: "on"
- condition: state
entity_id: input_boolean.sleep_mode
state: "off"
sequence:
- service: light.turn_on
target:
entity_id: light.bedroom_lamps
data:
brightness: "{{ states(\"sensor.circadian_brightness\")|float(0) }}"
- conditions:
- condition: or
conditions:
- condition: trigger
id: No Motion
- condition: trigger
id: Night Mode Off
- condition: trigger
id: Sleep Mode On
- condition: trigger
id: TV Off
- condition: state
entity_id: light.bedroom_lamps
state: "on"
- condition: state
entity_id: input_boolean.bedroom_automatic_lights
state: "on"
- condition: state
entity_id: media_player.bedroom_tv
state:
- "off"
- standby
- unknown
- unavailable
- condition: state
entity_id: binary_sensor.bedroom_occupancy
state: "off"
sequence:
- service: light.turn_off
data: {}
target:
entity_id: light.bedroom_lamps
- conditions:
- condition: trigger
id: TV On
- condition: state
entity_id: binary_sensor.night_mode
state: "off"
sequence:
- service: light.turn_on
data:
brightness: "{{ states(\"sensor.circadian_brightness\")|float(0) }}"
target:
entity_id: light.bedroom_lamps
mode: restart