-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathautomations.yaml
535 lines (532 loc) · 13.3 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
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
- id: '1663398489357'
alias: Set device start time
description: ''
trigger:
- platform: time
at: '23:10:00'
condition:
- condition: not
conditions:
- condition: state
entity_id: sensor.cheapest_hours_energy_tomorrow
state: unknown
action:
- service: input_datetime.set_datetime
data:
time: '{{ as_timestamp(states(''sensor.cheapest_hours_energy_tomorrow'')) |
timestamp_custom(''%H:%M'') }}'
target:
entity_id: input_datetime.device_start_time
- id: '1663398489358'
alias: Set device end time
description: ''
trigger:
- platform: time
at: '23:15:00'
condition:
- condition: not
conditions:
- condition: state
entity_id: sensor.cheapest_hours_energy_tomorrow
state: unknown
action:
- service: input_datetime.set_datetime
data:
time: '{{ ((as_timestamp(states(''sensor.cheapest_hours_energy_tomorrow''))
+ (3600*2)) | timestamp_custom(''%H:%M'')) }}'
target:
entity_id: input_datetime.device_end_time
mode: single
- id: '1663399614817'
alias: Turn on Hallway AC
description: Cheap energy time turn on hallway AC
trigger:
- platform: time
at: input_datetime.device_start_time
condition:
condition: and
conditions:
- condition: time
after: 00:00
before: 04:00
action:
- service: climate.turn_on
target:
entity_id: climate.ac_12494102
mode: single
- id: '1663399614818'
alias: Increase heating
description: Cheap energy time set heating to 24C
trigger:
- platform: time
at: input_datetime.device_start_time
condition:
condition: and
conditions:
- condition: time
after: 00:00
before: 04:00
action:
- service: climate.set_temperature
data:
temperature: 24
target:
entity_id: climate.ac_12494102
mode: single
- id: '1663399614819'
alias: Hallway AC fan to high
description: Cheap energy time set fan to high
trigger:
- platform: time
at: input_datetime.device_start_time
condition:
condition: and
conditions:
- condition: time
after: 00:00
before: 04:00
action:
- service: climate.set_fan_mode
data:
fan_mode: High
target:
entity_id: climate.ac_12494102
mode: single
- id: '1663399614820'
alias: Hallway AC fan to Auto
description: Cheap energy end time set fan to Auto
trigger:
- platform: time
at: input_datetime.device_end_time
condition:
condition: and
conditions:
- condition: time
after: 01:59
before: 06:00
action:
- service: climate.set_fan_mode
data:
fan_mode: Auto
target:
entity_id: climate.ac_12494102
mode: single
- id: '1663399614821'
alias: Hallway AC temp to 20
description: Cheap energy end time set temp to 20
trigger:
- platform: time
at: input_datetime.device_end_time
condition:
condition: and
conditions:
- condition: time
after: 01:59
before: 06:00
action:
- service: climate.set_temperature
data:
temperature: 20
target:
entity_id: climate.ac_12494102
mode: single
- id: bedroom_ac_off_630pm
alias: Bedroom heating off
description: Set off beddroom heating 6:30PM
trigger:
- platform: time
at: '18:30:00'
action:
- service: climate.turn_off
target:
entity_id: climate.ac_12488762
- id: bedroom_ac_on
alias: Bedroom heating on
description: Set on bedroom heating
trigger:
- platform: time
at: 09:00:00
condition:
condition: or
conditions:
- condition: numeric_state
entity_id: sensor.nordpool_kwh_fi_eur_3_10_0255
below: sensor.energy_spot_average_price
- condition: numeric_state
entity_id: sensor.shellyht_707c09_temperature
below: 22
action:
- service: climate.turn_on
target:
entity_id: climate.ac_12488762
- id: bedroom_ac_temp20_09am
alias: Bedroom heating 19 9AM
description: Set bedroom heating to 20
trigger:
- platform: time
at: 09:00:00
action:
- service: climate.set_temperature
data:
temperature: 20
target:
entity_id: climate.ac_12488762
- id: hallway_ac_temp17_10pm
alias: Hallway heating 17
description: Set hallway heating to 17 10PM
trigger:
- platform: time
at: '22:00:00'
action:
- service: climate.set_temperature
data:
temperature: 17
target:
entity_id: climate.ac_12494102
- id: hallway_ac_fan_low_spot
alias: If spot price below average increase heat
description: With low price increase heat by 1
trigger:
- platform: numeric_state
entity_id: sensor.nordpool_kwh_fi_eur_3_10_0255
below: sensor.energy_spot_average_price
condition:
condition: and
conditions:
- condition: time
after: 08:00
before: '17:00'
action:
- service: climate.set_temperature
data:
temperature: '{{ state_attr(''climate.ac_12494102'', ''temperature'') + 1 }}'
target:
entity_id: climate.ac_12494102
mode: single
- id: hallway_ac_fan_expensive_spot
alias: If spot price above average cents set heat 1C lower
description: ''
trigger:
- platform: numeric_state
entity_id: sensor.nordpool_kwh_fi_eur_3_10_0255
above: sensor.energy_spot_average_price
condition:
condition: and
conditions:
- condition: time
after: 08:00
before: '22:00'
action:
- service: climate.set_temperature
data:
temperature: '{{ state_attr(''climate.ac_12494102'', ''temperature'') - 1 }}'
target:
entity_id: climate.ac_12494102
mode: single
- id: bedroom_ac_fan_expensive_spot
alias: If spot price above average turn off bedroom heating
description: ''
trigger:
- platform: numeric_state
entity_id: sensor.nordpool_kwh_fi_eur_3_10_0255
above: sensor.energy_spot_average_price
condition:
condition: and
conditions:
- condition: time
after: 09:00
before: '18:30'
- condition: numeric_state
entity_id: sensor.ac_12488762_outdoor_temperature
above: 0
action:
- service: climate.turn_off
target:
entity_id: climate.ac_12488762
mode: single
- id: bedroom_ac_fan_affordable_spot
alias: If spot price below average turn on bedroom heating
description: ''
trigger:
- platform: numeric_state
entity_id: sensor.nordpool_kwh_fi_eur_3_10_0255
below: sensor.energy_spot_average_price
condition:
condition: and
conditions:
- condition: time
after: 09:00
before: '18:30'
action:
- service: climate.turn_on
target:
entity_id: climate.ac_12488762
mode: single
- id: hallway_ac_fan_on_low_temp
alias: If temp below 2 set on
description: ''
trigger:
- platform: numeric_state
entity_id: sensor.ac_12488762_outdoor_temperature
below: 2
condition: []
action:
- service: climate.turn_on
target:
entity_id: climate.ac_12494102
mode: single
- id: if_cold_at_morning_heating_high
alias: Hallway AC fan to high if cold
description: morning heating on if cold
trigger:
- platform: time
at: 04:00:00
condition:
condition: and
conditions:
- condition: time
before: input_datetime.device_start_time
- condition: numeric_state
entity_id: sensor.shellyht_707c09_temperature
below: 22
action:
- service: climate.set_fan_mode
data:
fan_mode: High
target:
entity_id: climate.ac_12494102
mode: single
- id: if_cold_at_morning_heating_on
alias: Hallway AC to 20 if cold
description: morning heating to on if cold
trigger:
- platform: time
at: 04:00:00
condition:
condition: and
conditions:
- condition: time
before: input_datetime.device_start_time
- condition: numeric_state
entity_id: sensor.shellyht_707c09_temperature
below: 22
action:
- service: climate.turn_on
target:
entity_id: climate.ac_12494102
mode: single
- id: if_cold_at_morning_heating_22
alias: Hallway AC to 20 if cold
description: morning heating to 22 if cold
trigger:
- platform: time
at: 04:00:00
condition:
condition: and
conditions:
- condition: time
before: input_datetime.device_start_time
- condition: numeric_state
entity_id: sensor.shellyht_707c09_temperature
below: 22
action:
- service: climate.set_temperature
data:
temperature: 22
target:
entity_id: climate.ac_12494102
mode: single
- id: Fan to Auto on cold morning
alias: Hallway AC fan to Auto on cold morning
description: Cold morning set fan to Auto
trigger:
- platform: time
at: 05:00:00
condition:
condition: and
conditions:
- condition: time
before: input_datetime.device_end_time
action:
- service: climate.set_fan_mode
data:
fan_mode: Auto
target:
entity_id: climate.ac_12494102
mode: single
- id: AC to 20 on cold morning
alias: Hallway AC to 20 on cold morning
description: Cold morning set fan to 20
trigger:
- platform: time
at: 05:00:00
condition:
condition: and
conditions:
- condition: time
before: input_datetime.device_end_time
action:
- service: climate.set_temperature
data:
temperature: 20
target:
entity_id: climate.ac_12494102
mode: single
- id: vacuum_downstairs
alias: Vacuum Downstairs
description: Vacuum Downstairs at Midnight
triggers:
- at: '11:20:00'
trigger: time
actions:
- data:
entity_id: vacuum.dreambot
segments:
- 2
- 4
- 5
- 1
- 3
suction_level: 3
action: dreame_vacuum.vacuum_clean_segment
mode: single
- id: notify_external_ip_change_update_dns
alias: Notify and Update DNS when external IP changes
initial_state: true
trigger:
platform: state
entity_id: sensor.myip
action:
- service: shell_command.update_dns
- id: notify_external_ip_change_by_email
alias: Notify when external ip changes
initial_state: true
trigger:
platform: state
entity_id: sensor.myip
action:
service: notify.email_notify
data_template:
message: New external IP address is {{ states('sensor.myip') }}
- id: notify_external_ip_change_with_whats_app
alias: Notify when external ip changes with whats app
initial_state: true
trigger:
platform: state
entity_id: sensor.myip
action:
service: notify.whatsapp
data_template:
message: New external IP address is {{ states('sensor.myip') }}
title: External IP address changed
target: [email protected]
- alias: Publish Binance Balance
trigger:
- platform: time_pattern
minutes: '0'
- platform: homeassistant
event: start
action:
- service: shell_command.publish_binance_balance
- delay:
seconds: 5
id: a40913a23f354c1aac3758b17e9b03f0
- alias: Publish Binance 2nd Balance
trigger:
- platform: time_pattern
minutes: '0'
- platform: homeassistant
event: start
action:
- service: shell_command.publish_binance2_balance
- delay:
seconds: 5
id: a40913a23f354c1887a758b17e9b03f0
- alias: Publish Exodus Balance
trigger:
- platform: time_pattern
minutes: '0'
- platform: homeassistant
event: start
action:
- service: shell_command.publish_exodus_balance
- delay:
seconds: 5
id: 91828ba988a444d881d5e2ea7343955f
- alias: Publish Kraken Balance
trigger:
- platform: time_pattern
minutes: '0'
- platform: homeassistant
event: start
action:
- service: shell_command.publish_kraken_balance
- delay:
seconds: 5
id: 8d76223474a64fd9b1fa1fcf32bdccf5
- alias: Publish Litewallet Balance
trigger:
- platform: time_pattern
minutes: '0'
- platform: homeassistant
event: start
action:
- service: shell_command.publish_litewallet_balance
- delay:
seconds: 5
id: 9315a4cde0fb4eda89d920463ff30e0f
- alias: Fetch Crypto Values
trigger:
- platform: time_pattern
minutes: /10
- platform: homeassistant
event: start
action:
- service: shell_command.publish_fetch_crypto_currency
- delay:
seconds: 5
id: 6c36ff4b838d4a9dba444d4de4d5f9b6
- alias: Reboot or Power Cycle Miner
description: Reboot the miner on low hash rate, fallback to power cycle if needed
trigger:
- platform: state
entity_id: sensor.litecoinpool_hashrate
to: "0"
for: "00:15:00"
condition: []
action:
- service: button.press
target:
entity_id: button.shellyplug_s_3ce90ee04b97_reboot
- delay: "00:10:00" # Wait 10 minutes to see if reboot resolves the issue
- condition: state
entity_id: sensor.litecoinpool_hashrate
state: "0" # Hashrate is still 0
- service: switch.turn_off
target:
entity_id: switch.shellyplug_s_3ce90ee04b97
- delay: "00:00:10" # Wait 10 seconds
- service: switch.turn_on
target:
entity_id: switch.shellyplug_s_3ce90ee04b97
mode: single
- alias: Turn Off Miner When Electricity Price Is High
description: "Turns off the miner when electricity price goes above 33c/kWh"
trigger:
- platform: numeric_state
entity_id: sensor.electricity_cost_in_cents_per_kwh
above: 33
action:
- service: switch.turn_off
target:
entity_id: switch.shellyplug_s_3ce90ee04b97
- alias: Turn On Miner When Electricity Price Is Low
description: "Turns on the miner when electricity price goes below 33c/kWh"
trigger:
- platform: numeric_state
entity_id: sensor.electricity_cost_in_cents_per_kwh
below: 33
action:
- service: switch.turn_on
target:
entity_id: switch.shellyplug_s_3ce90ee04b97