-
Notifications
You must be signed in to change notification settings - Fork 158
/
Copy pathtemplate.yaml
633 lines (552 loc) · 24.3 KB
/
template.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
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
#################################################################
## Templates
#################################################################
##########################################################
## Thermostat Out of Bounds
##########################################################
- binary_sensor:
- unique_id: thermostat_out_of_bounds
name: "eco+ Enabled"
state: >
{% if is_state('climate.main_floor', 'cool') and state_attr('climate.main_floor', 'preset_mode') =='Upstairs' and state_attr('climate.main_floor', 'temperature')| int != 75 %}
on
{% elif is_state('climate.main_floor', 'cool') and state_attr('climate.main_floor', 'preset_mode') =='home' and state_attr('climate.main_floor', 'temperature')| int != 75 %}
on
{% elif is_state('climate.main_floor', 'cool') and state_attr('climate.main_floor', 'preset_mode') =='Guest' and state_attr('climate.main_floor', 'temperature')| int != 72 %}
on
{% elif is_state('climate.main_floor', 'cool') and state_attr('climate.main_floor', 'preset_mode') =='Downstairs' and state_attr('climate.main_floor', 'temperature')| int != 73 %}
on
{% elif is_state('climate.main_floor', 'cool') and state_attr('climate.main_floor', 'preset_mode') =='away_indefinitely' and state_attr('climate.main_floor', 'temperature')| int != 79 %}
on
{% elif is_state('climate.main_floor', 'cool') and state_attr('climate.main_floor', 'preset_mode') =='sleep' and state_attr('climate.main_floor', 'temperature')| int != 72 %}
on
{% else %}
off
{% endif %}
##########################################################
## Electricity Rate
##########################################################
- sensor:
- unique_id: current_electricity_rate
name: Current Electricity Rate
unit_of_measurement: "USD/kWh"
device_class: monetary
state: >
{% if is_state('select.monthly_electric', 'Summer Rate') %}
{{ 0.1296 }}
{% elif is_state('select.monthly_electric', 'Winter Rate First 750') %}
{{ 0.0REDACTED1 }}
{% elif is_state('select.monthly_electric', 'Winter Rate Over 750') %}
{{ 0.0591 }}
{% endif %}
##########################################################
## Hot Tub Modes
##########################################################
- sensor:
- unique_id: hot_tub_mode
name: Hot Tub Mode
state: >
{% if states('sensor.hot_tub_watts') | float > 10000 %}
CircPump-Blower-Pump1-Pump2-Heat
{% elif states('sensor.hot_tub_watts') | float > 9500 %}
CircPump-Pump1-Pump2-Heat
{% elif states('sensor.hot_tub_watts') | float > 7900 %}
CircPump-Blower-Pump1-Heat
{% elif states('sensor.hot_tub_watts') | float > 7790 %}
CircPump-Blower-Pump2-Heat
{% elif states('sensor.hot_tub_watts') | float > 7600 %}
CircPump-Pump1-Heat
{% elif states('sensor.hot_tub_watts') | float > 7400 %}
CircPump-Pump2-Heat
{% elif states('sensor.hot_tub_watts') | float > 5600 %}
CircPump-Blower-Heat
{% elif states('sensor.hot_tub_watts') | float > 5200 %}
CircPump-Heat
{% elif states('sensor.hot_tub_watts') | float > 5000 %}
CircPump-Blower-Pump1-Pump2
{% elif states('sensor.hot_tub_watts') | float > 4600 %}
CircPump-Pump1-Pump2
{% elif states('sensor.hot_tub_watts') | float > 2900 %}
CircPump-Blower-Pump1
{% elif states('sensor.hot_tub_watts') | float > 3700 %}
CircPump-Blower-Pump2
{% elif states('sensor.hot_tub_watts') | float > 2350 %}
CircPump-Pump1
{% elif states('sensor.hot_tub_watts') | float > 2400 %}
CircPump-Pump2
{% elif states('sensor.hot_tub_watts') | float > 500 %}
CircPump-Blower
{% elif states('sensor.hot_tub_watts') | float > 150 %}
CircPump
{% else %}
Off
{% endif %}
##########################################################
## Hot Tub Circulation Pump
##########################################################
- binary_sensor:
- unique_id: hot_tub_circ_pump
name: Hot Tub Circ Pump
state: >
{% if is_state('sensor.hot_tub_mode', 'Off') %}
off
{% else %}
on
{% endif %}
##########################################################
## Hot Tub Pump 1
##########################################################
- binary_sensor:
- unique_id: hot_tub_pump_1
name: Hot Tub Pump 1
state: >
{{ is_state('sensor.hot_tub_mode', 'CircPump-Blower-Pump1-Pump2-Heat')
or is_state('sensor.hot_tub_mode', 'CircPump-Pump1-Pump2-Heat')
or is_state('sensor.hot_tub_mode', 'CircPump-Blower-Pump1-Heat')
or is_state('sensor.hot_tub_mode', 'CircPump-Pump1-Heat')
or is_state('sensor.hot_tub_mode', 'CircPump-Blower-Pump1-Pump2')
or is_state('sensor.hot_tub_mode', 'CircPump-Pump1-Pump2')
or is_state('bsensor.hot_tub_mode', 'CircPump-Blower-Pump1')
or is_state('sensor.hot_tub_mode', 'CircPump-Pump1') }}
##########################################################
## Hot Tub Pump 2
##########################################################
- binary_sensor:
- unique_id: hot_tub_pump_2
name: Hot Tub Pump 2
state: >
{{ is_state('sensor.hot_tub_mode', 'CircPump-Blower-Pump1-Pump2-Heat')
or is_state('sensor.hot_tub_mode', 'CircPump-Pump1-Pump2-Heat')
or is_state('sensor.hot_tub_mode', 'CircPump-Blower-Pump2-Heat')
or is_state('sensor.hot_tub_mode', 'CircPump-Pump2-Heat')
or is_state('sensor.hot_tub_mode', 'CircPump-Blower-Pump1-Pump2')
or is_state('sensor.hot_tub_mode', 'CircPump-Pump1-Pump2')
or is_state('sensor.hot_tub_mode', 'CircPump-Blower-Pump2')
or is_state('sensor.hot_tub_mode', 'CircPump-Pump2') }}
##########################################################
## Hot Tub Air Blower
##########################################################
- binary_sensor:
- unique_id: hot_tub_air_blower
name: Hot Tub Air Blower
state: >
{{ is_state('sensor.hot_tub_mode', 'CircPump-Blower-Pump1-Pump2-Heat')
or is_state('sensor.hot_tub_mode', 'CircPump-Blower-Pump1-Heat')
or is_state('sensor.hot_tub_mode', 'CircPump-Blower-Pump2-Heat')
or is_state('sensor.hot_tub_mode', 'CircPump-Blower-Heat')
or is_state('sensor.hot_tub_mode', 'CircPump-Blower-Pump1-Pump2')
or is_state('sensor.hot_tub_mode', 'CircPump-Blower-Pump1')
or is_state('sensor.hot_tub_mode', 'CircPump-Blower-Pump2')
or is_state('sensor.hot_tub_mode', 'CircPump-Blower') }}
##########################################################
## Hot Tub Heater
##########################################################
- binary_sensor:
- unique_id: hot_tub_heater
name: Hot Tub Heater
state: >
{{ is_state('sensor.hot_tub_mode', 'CircPump-Blower-Pump1-Pump2-Heat')
or is_state('sensor.hot_tub_mode', 'CircPump-Pump1-Pump2-Heat')
or is_state('sensor.hot_tub_mode', 'CircPump-Blower-Pump1-Heat')
or is_state('sensor.hot_tub_mode', 'CircPump-Blower-Pump2-Heat')
or is_state('sensor.hot_tub_mode', 'CircPump-Pump1-Heat')
or is_state('sensor.hot_tub_mode', 'CircPump-Pump2-Heat')
or is_state('sensor.hot_tub_mode', 'CircPump-Blower-Heat')
or is_state('sensor.hot_tub_mode', 'CircPump-Heat') }}
##########################################################
## UPS-A Watts
##########################################################
- sensor:
- unique_id: ups_a_watts
name: UPS-A Watts
state_class: measurement
device_class: power
unit_of_measurement: "W"
state: "{{ states('sensor.ups_a_load')|float * 0.01 * states('sensor.ups_a_nominal_output_power')|round(2) }}"
##########################################################
## UPS-B Watts
##########################################################
- sensor:
- unique_id: ups_b_watts
name: UPS-B Watts
state_class: measurement
device_class: power
unit_of_measurement: "W"
state: "{{ states('sensor.ups_b_load')|float * 0.01 * states('sensor.ups_b_nominal_output_power')|round(2) }}"
##########################################################
## Server Rack Watts
##########################################################
- sensor:
- unique_id: server_rack_watts
name: Server Rack Watts
state_class: measurement
device_class: power
unit_of_measurement: "W"
state: "{{ states('sensor.ups_a_load')|float * 0.01 * states('sensor.ups_a_nominal_output_power')|round(2) + states('sensor.ups_b_load')|float * 0.01 * states('sensor.ups_b_nominal_output_power')|round(2) }}"
##########################################################
## Washing Machine Time Remaining
##########################################################
- sensor:
- unique_id: washing_machine_time_remaining
name: Washing Machine Time Remaining
state: '{{ states.sensor.washer.attributes.remain_time }}'
##########################################################
## Washing Machine Error Message
##########################################################
- sensor:
- unique_id: washer_error
name: Washer Error
state: '{{ states.sensor.washer.attributes.error_message }}'
##########################################################
## Washing Machine Tub Clean Count
##########################################################
- sensor:
- unique_id: washer_tub_clean
name: Washer Tub Clean
state: '{{ states.sensor.washer.attributes.tubclean_count }}'
##########################################################
## Washer Tub Clean
##########################################################
- binary_sensor:
- unique_id: washer_tub_clean_on
name: Washer Tub Clean On
device_class: problem
state: "{{ states('sensor.washer_tub_clean')|float > 29 }}"
##########################################################
## Dryer Time Remaining
##########################################################
- sensor:
- unique_id: dryer_time_remaining
name: Dryer Time Remaining
state: '{{ states.sensor.dryer.attributes.remain_time }}'
##########################################################
## Dryer Error Message
##########################################################
- sensor:
- unique_id: dryer_error
name: Dryer Error
state: '{{ states.sensor.dryer.attributes.error_message }}'
##########################################################
## Calendars
##########################################################
- sensor:
- unique_id: holidays_calendar
name: Holiday Calendar
state: '{{ states.calendar.holiday.attributes.message }}'
##########################################################
## Water Flow
##########################################################
- binary_sensor:
- unique_id: water_flow_status
name: "Water Flow Status"
state: >-
{{ states('sensor.water_meter_current') != "0" }}
##########################################################
## USER1's Office Echo Timer
##########################################################
- binary_sensor:
- unique_id: USER1_office_echo_timer
name: "USER1's Office Timer"
state: >-
{{ states('sensor.USER1_s_office_echo_next_timer') != "unknown" }}
##########################################################
## Basement Echo Timer
##########################################################
- binary_sensor:
- unique_id: basement_echo_timer
name: "Basement Timer"
state: >-
{{ states('sensor.basement_echo_next_timer') != "unknown" }}
##########################################################
## Bathroom Echo Timer
##########################################################
- binary_sensor:
- unique_id: bathroom_echo_timer
name: "Bathroom Timer"
state: >-
{{ states('sensor.bathroom_echo_next_timer') != "unknown" }}
##########################################################
## Bathroom Echo Timer
##########################################################
- binary_sensor:
- unique_id: bedroom_echo_timer
name: "Bedroom Timer"
state: >-
{{ states('sensor.bedroom_echo_spot_next_timer') != "unknown" }}
##########################################################
## Bathroom Echo Timer
##########################################################
- binary_sensor:
- unique_id: craft_room_echo_timer
name: "Craft Room Timer"
state: >-
{{ states('sensor.craft_room_echo_next_timer') != "unknown" }}
##########################################################
## Dining Room Echo Timer
##########################################################
- binary_sensor:
- unique_id: dining_room_echo_timer
name: "Dining Room Timer"
state: >-
{{ states('sensor.dining_room_echo_next_timer') != "unknown" }}
##########################################################
## Fitness Room Echo Timer
##########################################################
- binary_sensor:
- unique_id: fitness_room_echo_timer
name: "Fitness Room Timer"
state: >-
{{ states('sensor.fitness_room_echo_next_timer') != "unknown" }}
##########################################################
## Guest Bedroom Echo Timer
##########################################################
- binary_sensor:
- unique_id: guest_bedroom_echo_timer
name: "Guest Bedroom Timer"
state: >-
{{ states('sensor.guest_bedroom_echo_dot_next_timer') != "unknown" }}
##########################################################
## Kitchen Echo Timer
##########################################################
- binary_sensor:
- unique_id: kitchen_echo_timer
name: "Kitchen Timer"
state: >-
{{ states('sensor.kitchen_echo_dot_next_timer') != "unknown" }}
##########################################################
## USER2's Office Echo Timer
##########################################################
- binary_sensor:
- unique_id: USER2_office_echo_timer
name: "USER2's Office Timer"
state: >-
{{ states('sensor.USER2_s_office_echo_next_timer') != "unknown" }}
##########################################################
## Thermostat
##########################################################
- sensor:
- unique_id: thermostat_climate_mode
name: Thermostat Climate Mode
state: '{{ states.climate.main_floor.attributes.preset_mode }}'
##########################################################
## Outdoor Humidity
##########################################################
- sensor:
- unique_id: REDACTED_humidity
name: REDACTED, MO Humidity
device_class: humidity
unit_of_measurement: '%'
state: '{{ states.weather.REDACTED.attributes.humidity }}'
##########################################################
## Outdoor Temperature
##########################################################
- sensor:
- unique_id: REDACTED_temperature
name: REDACTED, MO Temperature
device_class: temperature
unit_of_measurement: '°F'
state: '{{ states.weather.REDACTED.attributes.temperature }}'
##########################################################
## Get Forecast Every Hour
##########################################################
- trigger:
- platform: time_pattern
hours: '/1'
action:
- service: weather.get_forecasts
target:
entity_id: weather.REDACTED_ecobee
data:
type: daily
response_variable: daily
sensor:
- name: REDACTED, MO Daily Forecast
unique_id: REDACTED_forecast_daily
state: "{{ now().isoformat() }}"
attributes:
forecast: "{{ daily['weather.REDACTED_ecobee'].forecast }}"
- name: REDACTED, MO Forecasted Condition
unique_id: REDACTED_forecasted_condition
state: "{{ daily['weather.REDACTED_ecobee'].forecast[0].condition }}"
- name: REDACTED, MO Forecasted Temperature (High)
unique_id: REDACTED_forecasted_temperature_high
state: "{{ daily['weather.REDACTED_ecobee'].forecast[0].temperature }}"
device_class: temperature
unit_of_measurement: '°F'
- name: REDACTED, MO Forecasted Temperature (Low)
unique_id: REDACTED_forecasted_temperature_low
state: "{{ daily['weather.REDACTED_ecobee'].forecast[0].templow }}"
device_class: temperature
unit_of_measurement: '°F'
##########################################################
## Outdoor Temperature Ranges
##########################################################
- sensor:
- unique_id: outdoor_temp_range
name: Outdoor Temp Range
state: >
{% if states('sensor.REDACTED_temperature') | int >= 90 %}
temp-hot
{% elif states('sensor.REDACTED_temperature') | int >= 82 %}
temp-warmer
{% elif states('sensor.REDACTED_temperature') | int >= 76 %}
temp-warm
{% elif states('sensor.REDACTED_temperature') | int >= 60 %}
temp-norm
{% elif states('sensor.REDACTED_temperature') | int >= 45 %}
temp-cool
{% elif states('sensor.REDACTED_temperature') | int >= 33 %}
temp-cooler
{% elif states('sensor.REDACTED_temperature') | int <= 32 %}
temp-cold
{% else %}
temp-norm
{% endif %}
##########################################################
## Weather Condition Night Fix
##########################################################
- sensor:
- unique_id: weather_condition_REDACTED
name: Weather Condition REDACTED, MO
state: >
{% if is_state('weather.REDACTED_ecobee', 'sunny') and is_state('sun.sun', 'above_horizon') %}
sunny
{% elif is_state('weather.REDACTED_ecobee', 'sunny') and is_state('sun.sun', 'below_horizon') %}
clear-night
{% else %}
{{ states("weather.REDACTED_ecobee") }}
{% endif %}
##########################################################
## Weather Condition LCD Clock Icons
##########################################################
- sensor:
- unique_id: weather_condition_lcd_clock_icon
name: Weather Condition LCD Clock Icon
state: >
{% if is_state('weather.REDACTED_ecobee', 'sunny') and is_state('sun.sun', 'above_horizon') %}
sunny
{% elif is_state('weather.REDACTED_ecobee', 'sunny') and is_state('sun.sun', 'below_horizon') %}
clear_night
{% elif is_state('weather.REDACTED_ecobee', 'partlycloudy') and is_state('sun.sun', 'above_horizon') %}
partlycloudy_day
{% elif is_state('weather.REDACTED_ecobee', 'partlycloudy') and is_state('sun.sun', 'below_horizon') %}
partlycloudy_night
{% elif is_state('weather.REDACTED_ecobee', 'cloudy') %}
cloudy
{% elif is_state('weather.REDACTED_ecobee', 'fog') %}
fog
{% elif is_state('weather.REDACTED_ecobee', 'lightning') %}
lightning
{% elif is_state('weather.REDACTED_ecobee', 'lightning-rainy') %}
lightning_rainy
{% elif is_state('weather.REDACTED_ecobee', 'pouring') %}
rainy
{% elif is_state('weather.REDACTED_ecobee', 'rainy') %}
rainy
{% elif is_state('weather.REDACTED_ecobee', 'snowy') %}
snowy
{% elif is_state('weather.REDACTED_ecobee', 'snowy-rainy') %}
snowy_rainy
{% elif is_state('weather.REDACTED_ecobee', 'windy') %}
windy
{% elif is_state('weather.REDACTED_ecobee', 'windy-variant') %}
windy
{% elif is_state('weather.REDACTED_ecobee', 'hail') %}
hail
{% else %}
{{ states("sensor.weather_condition_REDACTED") }}
{% endif %}
##########################################################
## Weather Condition Human Readable
##########################################################
- sensor:
- unique_id: weather_condition_human_readable
name: Weather Condition Human Readable
state: >
{% if is_state('weather.REDACTED_ecobee', 'sunny') and is_state('sun.sun', 'above_horizon') %}
Sunny
{% elif is_state('weather.REDACTED_ecobee', 'sunny') and is_state('sun.sun', 'below_horizon') %}
Clear Night
{% elif is_state('weather.REDACTED_ecobee', 'partlycloudy') and is_state('sun.sun', 'above_horizon') %}
Partly Cloudy
{% elif is_state('weather.REDACTED_ecobee', 'partlycloudy') and is_state('sun.sun', 'below_horizon') %}
Partly Cloudy
{% elif is_state('weather.REDACTED_ecobee', 'cloudy') %}
Cloudy
{% elif is_state('weather.REDACTED_ecobee', 'fog') %}
Fog
{% elif is_state('weather.REDACTED_ecobee', 'lightning') %}
Lightning
{% elif is_state('weather.REDACTED_ecobee', 'lightning-rainy') %}
Thunderstorm
{% elif is_state('weather.REDACTED_ecobee', 'pouring') %}
Rain
{% elif is_state('weather.REDACTED_ecobee', 'rainy') %}
Rain
{% elif is_state('weather.REDACTED_ecobee', 'snowy') %}
Snow
{% elif is_state('weather.REDACTED_ecobee', 'snowy-rainy') %}
Sleet
{% elif is_state('weather.REDACTED_ecobee', 'windy') %}
Windy
{% elif is_state('weather.REDACTED_ecobee', 'windy-variant') %}
Windy
{% elif is_state('weather.REDACTED_ecobee', 'hail') %}
Hail
{% else %}
{{ states("sensor.weather_condition_REDACTED") }}
{% endif %}
##########################################################
## Front Door Lock Code
##########################################################
- sensor:
- unique_id: front_door_lock_code
name: Front Door Lock Code
state: >
{% if is_state('sensor.front_door_lock_alarmlevel', '2') %}
USER2
{% elif is_state('sensor.front_door_lock_alarmlevel', '3') %}
USER1
{% elif is_state('sensor.front_door_lock_alarmlevel', '4') %}
guest
{% elif is_state('sensor.front_door_lock_alarmlevel', '5') %}
guest
{% else %}
none
{% endif %}
##########################################################
## Back Door Lock Code
##########################################################
- sensor:
- unique_id: back_door_lock_code
name: Back Door Lock Code
state: >
{% if is_state('sensor.back_door_lock_alarmlevel', '2') %}
USER2
{% elif is_state('sensor.back_door_lock_alarmlevel', '3') %}
USER1
{% elif is_state('sensor.back_door_lock_alarmlevel', '4') %}
guest
{% elif is_state('sensor.back_door_lock_alarmlevel', '5') %}
guest
{% else %}
none
{% endif %}
##########################################################
## Basement Door Lock Code
##########################################################
- sensor:
- unique_id: basement_door_lock_code
name: Basement Door Lock Code
state: >
{% if is_state('sensor.basement_door_lock_alarmlevel', '2') %}
USER2
{% elif is_state('sensor.basement_door_lock_alarmlevel', '3') %}
USER1
{% elif is_state('sensor.basement_door_lock_alarmlevel', '4') %}
guest
{% elif is_state('sensor.basement_door_lock_alarmlevel', '5') %}
guest
{% else %}
none
{% endif %}