-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathstudy_room.yaml
190 lines (159 loc) · 4.92 KB
/
study_room.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
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
---
automation:
- alias: "Study Room - Turn lights off when no one is in the room"
id: study_room_turn_ac_and_lights_off
initial_state: true
trigger:
- platform: state
entity_id: binary_sensor.apollo_msr_1_ce7700_radar_target
to: 'off'
for:
minutes: 2
- platform: homeassistant
event: start
condition:
- condition: state
entity_id: switch.shellyplus1pm_e465b8f12024_switch_0
state: 'on'
- condition: state
entity_id: binary_sensor.apollo_msr_1_ce7700_radar_target
state: 'off'
action:
- action: homeassistant.turn_off
entity_id: switch.shellyplus1pm_e465b8f12024_switch_0
- alias: "Study Room - Turn on the lights when motion is detected"
initial_state: true
id: study_room_turn_lights_on_motion_detected
trigger:
- platform: state
entity_id: binary_sensor.apollo_msr_1_ce7700_radar_target
to: 'on'
condition:
- condition: state
entity_id: switch.shellyplus1pm_e465b8f12024_switch_0
state: 'off'
action:
- action: homeassistant.turn_on
entity_id: switch.shellyplus1pm_e465b8f12024_switch_0
- alias: "Study room - Turn on AC when temperature is above threshold"
initial_state: true
id: study_room_turn_ac_on
trigger:
- platform: numeric_state
entity_id: sensor.study_temperature_temperature
above: 32
condition:
- condition: state
entity_id: binary_sensor.apollo_msr_1_ce7700_radar_target
state: 'on'
- condition: state
entity_id: sensor.ohad_ble
state: 'study'
- condition: numeric_state
entity_id: sensor.ohad_ble
attribute: distance
below: 5.5
action:
- action: switch.turn_on
entity_id: switch.study_room_ac_beeper
- action: climate.set_hvac_mode
target:
entity_id: climate.study_room_ac
data:
hvac_mode: cool
- action: switch.turn_off
entity_id: switch.study_room_ac_beeper
- action: climate.set_preset_mode
data:
preset_mode: sleep
entity_id: climate.study_room_ac
- action: climate.set_temperature
data:
temperature: 25
entity_id: climate.study_room_ac
- action: climate.set_fan_mode
data:
fan_mode: silent
entity_id: climate.study_room_ac
- action: climate.set_swing_mode
data:
swing_mode: both
entity_id: climate.study_room_ac
- alias: "Study Room - Close cover on sunset"
initial_state: true
id: study_room_close_cover_sunset
trigger:
- platform: sun
event: sunset
condition:
- condition: state
entity_id: input_boolean.away_mode
state: 'off'
action:
- action: cover.close_cover
entity_id: cover.study_room
- alias: "Study Room - Open cover in the morning"
initial_state: true
id: study_room_open_cover_morning
trigger:
- platform: time
at: "08:00:00"
- platform: time
at: "08:30:00"
condition:
- condition: state
entity_id: input_boolean.away_mode
state: 'off'
- condition: state
entity_id: person.ohad_benita
state: 'home'
action:
- action: cover.set_cover_position
data_template:
entity_id: cover.study_room
position: >-
{{ max(state_attr('cover.study_room', 'current_position') | int, 80) }}
- alias: "Study Room - Toggle light by switch"
initial_state: true
id: study_room_toggle_light_by_switch
trigger:
- platform: state
entity_id: sensor.study_room_01_action
to: 'open'
action:
- action: switch.toggle
entity_id: switch.shellyplus1pm_e465b8f12024_switch_0
- alias: "Study Room - Toggle AC by switch"
initial_state: true
id: study_room_toggle_ac_by_switch
trigger:
- platform: state
entity_id: sensor.study_room_01_action
to: 'close'
action:
- if:
- condition: state
entity_id: climate.study_room_ac
state: 'off'
then:
- choose:
- conditions:
- condition: state
entity_id: binary_sensor.dst
state: 'on'
sequence:
- action: climate.set_hvac_mode
data:
entity_id: climate.study_room_ac
hvac_mode: 'cool'
- conditions:
- condition: state
entity_id: binary_sensor.dst
state: 'off'
sequence:
- action: climate.set_hvac_mode
data:
entity_id: climate.study_room_ac
hvac_mode: 'heat'
- action: climate.toggle
entity_id: climate.study_room_ac