-
Notifications
You must be signed in to change notification settings - Fork 0
/
automations.yaml
303 lines (303 loc) · 9.18 KB
/
automations.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
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
- id: 'Rubbish: Update Bin Night Sensors'
alias: 'Rubbish: Update Bin Night Sensors'
trigger:
- event: start
platform: homeassistant
- hours: /1
platform: time_pattern
action:
- entity_id: sensor.recycling_bin_today, sensor.recycling_bin_tomorrow, sensor.landfill_bin_today,
sensor.landfill_bin_tomorrow, sensor.garden_bin_today, sensor.garden_bin_tomorrow
service: homeassistant.update_entity
- id: 'Rubbish: Calculate Bin Reminders'
alias: 'Rubbish: Calculate Bin Reminders'
trigger:
- at: '19:00:00'
platform: time
condition:
- condition: and
conditions:
- condition: template
value_template: '{{ now().strftime("%H:%M") == "19:00" and now().weekday() ==
1 }}'
- condition: or
conditions:
- condition: state
entity_id: sensor.recycling_bin_today
state: 'True'
- condition: state
entity_id: sensor.landfill_bin_today
state: 'True'
action:
- data_template:
message: "'{%- if (states.sensor.recycling_bin_today.state) == \"True\" -%}\
\ \n Recycling Bin Night \n {%- elif (states.sensor.landfill_bin_today.state)\
\ == \"True\" -%}\n Landfill Bin Tonight \n {%- endif -%}\n {%- if (states.sensor.garden_bin_today.state)\
\ == \"True\" -%}\n Garden Bin Tonight \n {%- endif -%}'"
title: Bins Out Tonight
service: notify.everyone
initial_state: 'true'
- id: 'Bedroom: Turn On Nightlight When Dark'
alias: 'Bedroom: Turn On Nightlight When Dark'
trigger:
- entity_id: binary_sensor.squiggley_nightlight_motion_sensor
from: 'off'
platform: state
to: 'on'
- entity_id: binary_sensor.wee_bear_nightlight_motion_sensor
from: 'off'
platform: state
to: 'on'
condition: []
action:
- data:
entity_id: light.nightlight_stripper
service: light.turn_on
- delay: 00:05:00
- data:
entity_id: light.nightlight_stripper
service: light.turn_off
- id: 'Bedroom: Light Wee Bears Wardrobe When The Door Opens'
alias: 'Bedroom: Light Wee Bears Wardrobe When The Door Opens'
trigger:
- entity_id: binary_sensor.large_wardrobe_one_motion_sensor
from: 'off'
platform: state
to: 'on'
- entity_id: binary_sensor.large_wardrobe_two_motion_sensor
from: 'off'
platform: state
to: 'on'
condition:
- condition: state
entity_id: light.large_wardrobe_stripper
state: 'off'
action:
- data:
entity_id: light.large_wardrobe_stripper
service: light.turn_on
- delay: 00:10:00
- data:
entity_id: light.large_wardrobe_stripper
service: light.turn_off
- id: 'Bedroom: Light Squiggleys Wardrobe When The Door Opens'
alias: 'Bedroom: Light Squiggleys Wardrobe When The Door Opens'
trigger:
- entity_id: binary_sensor.small_wardrobe_motion_sensor
from: 'off'
platform: state
to: 'on'
condition: []
action:
- data:
entity_id: light.small_wardrobe_stripper
service: light.turn_on
- delay: 00:05:00
- data:
entity_id: light.small_wardrobe_stripper
service: light.turn_off
- id: 'Occupancy: Turn On Garden Lights At Dusk'
alias: 'Occupancy: Turn On Garden Lights At Dusk'
trigger:
- event: sunset
offset: 01:00:00
platform: sun
condition: []
action:
- data:
entity_id: light.front_garden_light
service: light.turn_on
- id: 'Occupancy: Turn On Lights When Dark and Someone Is Home'
alias: 'Occupancy: Turn On Lights When Dark and Someone Is Home'
trigger:
- minutes: /1
platform: time_pattern
condition:
- below: '400'
condition: numeric_state
entity_id: sensor.gateway_illumination_sensor
- condition: state
entity_id: sensor.house_occupancy_status
state: 'on'
- after: 07:00:00
before: '23:00:00'
condition: time
- condition: state
entity_id: group.common_lights
state: 'off'
action:
- data:
entity_id: group.common_lights
service: homeassistant.turn_on
- id: 'Occupancy: Turn Everything Off When Everyone Leaves'
alias: 'Occupancy: Turn Everything Off When Everyone Leaves'
trigger:
- entity_id: sensor.house_occupancy_status
from: 'on'
platform: state
to: 'off'
condition: []
action:
- data: {}
service: script.home_off
- data:
message: Turning everything Off as nobody does be home
service: notify.android_squigglepad
- id: 'Server: Turn On The Fan When Its Hot'
alias: 'Server: Turn On Fan When Its Hot'
trigger:
- platform: template
value_template: '{{ states(''sensor.server_room_temperature'') |float > states(''input_number.server_fan_on_temperature'')|
float}}'
action:
- data:
entity_id: switch.server_fan_relay
service: switch.turn_on
- id: 'Server: Turn Off The Server Fan When It Has Cooled'
alias: 'Server: Turn Off The Server Fan When It Has Cooled'
trigger:
- platform: template
value_template: '{{ states(''sensor.server_room_temperature'') |float < states(''input_number.server_fan_off_temperature'')|
float}}'
action:
- data:
entity_id: switch.server_fan_relay
service: switch.turn_off
- id: 'Mousetrap: Notify Squiggley When a Mouse is Caught in Trap One'
alias: 'Mousetrap: Notify Squiggley When a Mouse is Caught in Trap One'
trigger:
- entity_id: binary_sensor.mouse_trap_one
from: 'off'
platform: state
to: 'on'
condition: []
action:
- data:
message: There's a moose been caught aboot this hoose! Trap One
service: notify.android_squigglepad
- id: 'Mousetrap: Notify Squiggley When a Mouse is Caught in Trap Two'
alias: 'Mousetrap: Notify Squiggley When a Mouse is Caught in Trap Two'
trigger:
- entity_id: binary_sensor.mouse_trap_two
from: 'off'
platform: state
to: 'on'
condition: []
action:
- data:
message: There's a moose been caught aboot this hoose! Trap Two
service: notify.android_squigglepad
- id: 'Occupancy: Turn On the Common Lights When Someone Opens the Front Door'
alias: 'Occupancy: Turn On the Common Lights When Someone Opens the Front Door'
trigger:
- entity_id: binary_sensor.front_door_sensor
from: 'off'
platform: state
to: 'on'
condition:
- below: '400'
condition: numeric_state
entity_id: sensor.gateway_illumination_sensor
action:
- condition: state
entity_id: group.common_lights
state: 'off'
- data:
entity_id: group.common_lights
service: homeassistant.turn_on
- delay: 00:10:00
- data:
entity_id: group.common_lights
service: homeassistant.turn_off
- id: 'Toilet: Turn On Lights When Motion Detected'
alias: 'Toilet: Turn On Lights When Motion Detected'
trigger:
- platform: state
entity_id: binary_sensor.toilet_motion_sensor
to: 'on'
action:
- service: timer.start
entity_id: timer.toilet_lights
- service: light.turn_on
entity_id: light.toilet_lights
- id: 'Toilet: Stop Toilet Lights Timer When Door is Closed'
alias: 'Toilet: Stop Toilet Lights Timer When Door is Closed'
trigger:
- entity_id: binary_sensor.toilet_door_sensor
from: 'on'
platform: state
to: 'off'
condition:
- condition: state
entity_id: light.toilet_lights
state: 'on'
action:
- entity_id: timer.toilet_lights
service: timer.cancel
- id: 'Toilet: Start Toilet Lights Timer When Door is Opened'
alias: 'Toilet: Start Toilet Lights Timer When Door is Opened'
trigger:
- entity_id: binary_sensor.toilet_door_sensor
from: 'off'
platform: state
to: 'on'
condition:
- condition: state
entity_id: light.toilet_lights
state: 'on'
action:
- entity_id: timer.toilet_lights
service: timer.start
- id: 'Toilet: Turn off lights at end of timer'
alias: 'Toilet: Turn off lights at end of timer'
trigger:
- platform: event
event_type: timer.finished
event_data:
entity_id: timer.toilet_lights
action:
service: light.turn_off
entity_id: light.toilet_lights
- id: 'Turn On Vestibule Lights When Motion Is Detected'
alias: Turn On Vestibule Lights When Motion Detected
trigger:
- entity_id: binary_sensor.vestibule_motion_sensor
from: 'off'
platform: state
to: 'on'
condition:
- condition: state
entity_id: light.vestibule_one
state: 'off'
action:
- data:
entity_id: light.Vestibule_One
service: light.turn_on
- delay: 00:005:00
- data:
entity_id: light.Vestibule_One
service: light.turn_off
- id: 'Turn On Slow Cooker at specified time'
alias: 'Turn On Slow Cooker at specified time'
trigger:
- platform: template
value_template: '{{ states.sensor.time.state == (states.input_datetime.slow_cooker_start.attributes.timestamp | int | timestamp_custom("%H:%M", False)) }}'
action:
- service: switch.turn_on
data:
entity_id: switch.ambilight_relay
- service: notify.android_squiggle_pad
data:
message: Turning on the slow cooker
- id: 'Turn Off Slow Cooker at specified time'
alias: 'Turn Off Slow Cooker at specified time'
trigger:
- platform: template
value_template: '{{ states.sensor.time.state == (states.input_datetime.slow_cooker_stop.attributes.timestamp | int | timestamp_custom("%H:%M", False)) }}'
action:
- service: switch.turn_off
data:
entity_id: switch.ambilight_relay
- service: notify.android_squiggle_pad
data:
message: Turning off the slow cooker