-
Notifications
You must be signed in to change notification settings - Fork 3
/
Copy pathautomations.yaml
executable file
·390 lines (389 loc) · 12.4 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
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
- alias: Normalize Temperature
id: normalize_temperature
initial_state: false
trigger:
- entity_id: sensor.ecobee_spread
platform: state
condition:
- condition: numeric_state
entity_id: sensor.ecobee_spread
above: 3.0
action:
- service: climate.set_fan_mode
data_template:
entity_id: climate.thermostat_2
fan_mode: "{%- if (state_attr('climate.thermostat_2', 'current_temperature')|float\
\ >= 67.0)\n and (states('sensor.ecobee_spread')|float > 4.0) -%}\n on\n\
{%- else -%}\n auto\n{%- endif -%}"
- id: auto_start_register_booster
alias: Auto Start Register Booster
trigger:
- entity_id: climate.thermostat
platform: state
condition:
- condition: template
value_template: "{{- is_state_attr(\"climate.thermostat\", \"hvac_action\", \"\
cooling\") or \n (states('sensor.office_temperature')|float >= 75.5)\n-}}"
- condition: device
device_id: ad80753855d64fbfb84fa35223d54bb5
domain: switch
entity_id: switch.register_booster_plug_switch
type: is_off
action:
- entity_id: switch.register_booster_plug_switch
service: switch.turn_on
initial_state: true
- id: auto_stop_register_booster
alias: Auto Stop Register Booster
trigger:
- entity_id: climate.thermostat
platform: state
condition:
- condition: template
value_template: '{{- (not is_state_attr("climate.thermostat", "hvac_action", "cooling")
) and ( states(''sensor.office_temperature'')|float < 75.0 ) -}}'
- condition: device
device_id: ad80753855d64fbfb84fa35223d54bb5
domain: switch
entity_id: switch.register_booster_plug_switch
type: is_on
action:
- entity_id: switch.register_booster_plug_switch
service: switch.turn_off
initial_state: true
- alias: Listen to CDs started from Harmony Hub
initial_state: true
trigger:
platform: state
entity_id: remote.family_room_harmony_hub
condition:
condition: template
value_template: "{{-\n trigger is defined and trigger.to_state is not none\n\
\ and trigger.to_state.attributes is not none\n and trigger.to_state.attributes.current_activity\
\ == \"Listen to CDs\"\n-}}"
action:
service: switch.turn_on
entity_id: switch.denon_cd_plug_switch
id: 0135cb5921284e4787091873eb245f06
- alias: Listen to CDs ended from Harmony Hub
initial_state: true
trigger:
platform: state
entity_id: remote.family_room_harmony_hub
condition:
condition: template
value_template: "{{- \n trigger is defined \n and trigger.from_state is not\
\ none\n and trigger.from_state.attributes is not none \n and trigger.from_state.attributes.current_activity\
\ == \"Listen to CDs\" and trigger.to_state.attributes.current_activity !=\
\ \"Listen to CDs\" \n-}}"
action:
service: switch.turn_off
entity_id: switch.denon_cd_plug_switch
id: 689ac6077a2f43578a4078871d416a75
- id: fb582d1acf324c77bcdd43f08fc2e4dd
alias: Casting to Yamaha RX-V475
trigger:
- entity_id: media_player.office_chromecast
platform: state
to: playing
condition:
- condition: template
value_template: "{{-\n trigger is defined\n and trigger.from_state is defined\n\
\ and trigger.from_state.state != 'playing'\n-}}"
action:
- data:
entity_id: media_player.rx_v475_a16974
source: HDMI1
service: media_player.select_source
- condition: state
entity_id: media_player.rx_v475_a16974
state: 'off'
- data:
entity_id: media_player.rx_v475_a16974
service: media_player.turn_on
initial_state: true
mode: single
- id: 6a964c94c92f49b699d258c2a018e1e3
alias: Powering off Yamaha RX-V475
trigger:
- entity_id: media_player.rx_v475_a16974
platform: state
to: 'off'
condition:
- condition: state
entity_id: media_player.office_chromecast
state: playing
action:
- data: {}
entity_id: media_player.office_chromecast
service: media_player.media_pause
initial_state: true
mode: single
- alias: Casting to Onkyo TX-RZ820
initial_state: true
trigger:
- platform: state
entity_id: media_player.onkyo_txrz820_4f772a
to: playing
condition:
condition: template
value_template: "{{-\n not is_state_attr(\"remote.family_room_harmony_hub\",\
\ \"current_activity\", \"Network Music\")\n-}}"
action:
service: remote.turn_on
data:
entity_id: remote.family_room_harmony_hub
activity: Network Music
id: df5f52f3006d4b1ca9d64ecbded66987
- alias: Casting to SHIELD
initial_state: true
trigger:
- platform: state
entity_id: media_player.shield
to: playing
condition:
condition: template
value_template: "{{-\n not is_state_attr(\"remote.family_room_harmony_hub\",\
\ \"current_activity\",\n \"SHIELD TV\")\n-}}"
action:
service: remote.turn_on
data:
entity_id: remote.family_room_harmony_hub
activity: SHIELD TV
id: f9812165edca4dfeb19ca130fbaa00dc
- id: a141efb59e9f429c9671c0033dcfe027
alias: Casting to SHIELD ended from Harmony Hub
trigger:
- platform: state
entity_id: remote.family_room_harmony_hub
attribute: current_activity
from: SHIELD TV
condition:
- condition: template
value_template: "{{-\n trigger is defined\n and trigger.to_state is not none\n\
\ and trigger.to_state.attributes.current_activity != \"SHIELD TV\"\n-}}"
action:
- service: media_player.media_stop
data:
entity_id: media_player.shield
- service: media_player.turn_off
data:
entity_id: media_player.shield
initial_state: true
mode: single
- alias: Casting to Family Room
initial_state: true
trigger:
- platform: state
entity_id: media_player.chromecast
to: playing
condition:
condition: template
value_template: '{{- not is_state_attr("remote.family_room_harmony_hub", "current_activity",
"Chromecast") -}}'
action:
service: remote.turn_on
data:
entity_id: remote.family_room_harmony_hub
activity: Chromecast
id: 123e9a5ea0d24d8982760adf1a5bf685
- alias: Casting to Family Room ended from Harmony Hub
initial_state: true
trigger:
platform: template
value_template: '{{- is_state_attr(''remote.family_room_harmony_hub'', ''last_activity'',
''Chromecast'') and
not is_state_attr(''remote.family_room_harmony_hub'', ''current_activity'',
''Chromecast'') -}}'
condition:
condition: template
value_template: "{{-\nis_state('media_player.chromecast', 'playing') and\ntrigger\
\ is defined and\ntrigger.to_state.attributes.current_activity != \"Chromecast\"\
\ and \ntrigger.from_state.attributes.current_activity == \"Chromecast\" \n\
-}}"
action:
- service: media_player.media_pause
data:
entity_id: media_player.chromecast
- service: persistent_notification.create
data:
notification_id: harmony_pause_chromecast
message: Automation Triggered Pause at {{now().strftime('%c')}}!
title: Harmony Pause
id: 580aacc8e53241ae94ff165b2a9e6469
- alias: Fridge Temperature Warning
id: fridge_alarm
initial_state: true
trigger:
platform: state
entity_id: sensor.fridge_temperature
condition:
condition: template
value_template: "{%- if is_state('sensor.fridge_temperature', 'unknown') -%}\n\
\ false\n{%- else -%}\n {%- set t = states('sensor.fridge_temperature')|float\
\ -%}\n {{- 33.0 > t or t > 42.0 -}}\n{%- endif -%}\""
action:
service: persistent_notification.create
data:
notification_id: warning_fridge_temperature
message: Fridge temperature {{states.sensor.fridge_temperature.state_with_unit}}
at {{now().strftime('%c')}}!
title: Fridge Temp out of Range!
- alias: Garage Warning
id: garage_warning
initial_state: true
trigger:
platform: state
entity_id: cover.linear_nortek_security_control_llc_gd00z_4_garage_door_opener_remote_controller_barrier_state_label
to: open
for:
minutes: 15
condition:
condition: template
value_template: "{{-\n not is_state(\n \"cover.linear_nortek_security_control_llc_gd00z_4_garage_door_opener_remote_controller_barrier_state_label\"\
,\n \"closed\")\n-}}"
action:
service: persistent_notification.create
data_template:
notification_id: garage_warning
title: Garage Door is {{ states('cover.linear_nortek_security_control_llc_gd00z_4_garage_door_opener_remote_controller_barrier_state_label')|title
}}!
message: The garage door has been {{ states('cover.linear_nortek_security_control_llc_gd00z_4_garage_door_opener_remote_controller_barrier_state_label')
}} for at least 15 minutes, consider closing it.
- id: sync_front_door_unlocked
trigger:
- entity_id: sensor.kwikset_front_door_alarm_type
platform: state
to: '19'
- entity_id: sensor.kwikset_front_door_alarm_type
platform: state
to: '22'
condition:
- condition: state
entity_id: lock.kwikset_front_door
state: locked
action:
- data:
entity_id: lock.kwikset_front_door
service: lock.unlock
initial_state: true
- id: sync_front_door_locked
trigger:
- entity_id: sensor.kwikset_front_door_alarm_type
platform: state
to: '18'
- entity_id: sensor.kwikset_front_door_alarm_type
platform: state
to: '21'
- entity_id: sensor.kwikset_front_door_alarm_type
platform: state
to: '27'
condition:
- condition: state
entity_id: lock.kwikset_front_door
state: unlocked
action:
data:
entity_id: lock.kwikset_front_door
service: lock.lock
initial_state: true
- id: autolock_front_door
alias: Autolock Front Door
trigger:
- entity_id: lock.kwikset_front_door
for: 0:05:00
platform: state
to: unlocked
condition:
- condition: state
entity_id: lock.kwikset_front_door
state: unlocked
action:
- data: {}
service: lock.lock
target:
entity_id: lock.kwikset_front_door
initial_state: true
mode: restart
- id: propagate_kitchen_light
trigger:
- platform: event
event_type: automation_reloaded
- platform: state
entity_id: light.switch_kitchen_lights
from: 'off'
to: 'on'
- platform: state
entity_id: light.switch_kitchen_lights
from: 'on'
to: 'off'
condition:
condition: or
conditions:
- condition: state
entity_id: light.switch_kitchen_lights
state: 'on'
- condition: state
entity_id: light.switch_kitchen_lights
state: 'off'
action:
- service_template: light.turn_{{- states("light.switch_kitchen_lights") -}}
entity_id: light.cree_connected_a_19_60w_equivalent_c11b0bfe_level_on_off
- id: '1602622298053'
alias: sync-mbr-subwoofer
description: Master Bedroom Subwoofer should be on whenever the master bedroom chromecast
is playing.
trigger:
- platform: state
entity_id: media_player.master_bedroom
condition: []
action:
- delay: "{% if is_state('media_player.master_bedroom', 'playing') or\n is_state('media_player.master_bedroom',\
\ 'paused') %}\n 0\n{% else %}\n 60\n{% endif %}\n"
- service: "{% if is_state('media_player.master_bedroom', 'playing') or\n is_state('media_player.master_bedroom',\
\ 'paused') %}\n switch.turn_on\n{% else %}\n switch.turn_off\n{% endif %}\n"
data:
entity_id:
- switch.audioengine_a2_plug_switch
- switch.hank_electronics_ltd_hkzw_so03_smart_plug_switch
mode: restart
- id: '1629143869166'
alias: Chromecast Volume Management - Office
description: ''
use_blueprint:
path: tonyapuzzo/chromecast_volume_management.yaml
input:
trigger_chromecast: media_player.office_chromecast
target_receiver: media_player.rx_v475_a16974
in_max_threshold: '0.90'
in_min_threshold: '0.25'
- id: '1629145968232'
alias: Chromecast Volume Management - TV
description: ''
use_blueprint:
path: tonyapuzzo/chromecast_volume_management.yaml
input:
trigger_chromecast: media_player.chromecast
target_receiver: media_player.downstairs_tx_rz820
- id: '1635372798806'
alias: Ecobee Mix
description: ''
use_blueprint:
path: tonyapuzzo/ecobee_mix.yaml
input:
in_thermostat: climate.thermostat_2
in_sensors:
entity_id:
- sensor.thermostat_temperature
- sensor.lil_bee_temperature_2
- sensor.office_temperature_2
- id: '1647999535304'
alias: Motion-activated Light
description: ''
use_blueprint:
path: homeassistant/motion_light.yaml
input:
motion_entity: binary_sensor.motion_sensor_home_security_motion_detection
light_target:
entity_id: light.switch_front_porch_light
no_motion_wait: 300