forked from arsaboo/homeassistant-config
-
Notifications
You must be signed in to change notification settings - Fork 0
/
sensor.yaml
executable file
·652 lines (651 loc) · 27.8 KB
/
sensor.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
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
- platform: authenticated
- platform: email
email: !secret hassbot
password: !secret hassbot_pass
- platform: yahoo_earnings
ticker: WPC
name: Yahoo WPC
- platform: yahoo_earnings
ticker: COR
name: Yahoo COR
- platform: yahoo_earnings
ticker: O
name: Yahoo O
- platform: yahoo_earnings
ticker: COP
name: Yahoo COP
- platform: yahoo_earnings
ticker: WELL
name: Yahoo WELL
- platform: yahoo_earnings
ticker: IRM
name: Yahoo IRM
- platform: yahoo_earnings
ticker: CVS
name: Yahoo CVS
- platform: yahoo_earnings
ticker: CCI
name: Yahoo CCI
- platform: yahoo_earnings
ticker: VTR
name: Yahoo VTR
- platform: yahoo_earnings
ticker: DOC
name: Yahoo DOC
- platform: yahoo_earnings
ticker: PM
name: Yahoo PM
- platform: yahoo_earnings
ticker: BRK-B
name: Yahoo BRK.B
- platform: moon_here
app_id: !secret here_app_id
app_code: !secret here_app_code
zipcode: !secret home_zip
- platform: shodan
api_key: !secret shodan_api
query: "'home-assistant' country:'US' org:'AT&T U-verse' city:'Suwanee'"
- platform: darksky
api_key: !secret darksky_key
monitored_conditions:
- summary
- daily_summary
- hourly_summary
- temperature
scan_interval:
minutes: 20
- platform: season
- platform: sql
db_url: !secret recorder_db_url
queries:
- name: Portfolio morning
query: "SELECT state FROM states WHERE entity_id='sensor.pc_investment' and (HOUR(last_changed) >= 22 and (DATEDIFF(NOW(), last_changed) < 5)) ORDER BY last_changed desc LIMIT 1;"
column: 'state'
unit_of_measurement: $
- platform: sql
db_url: !secret recorder_db_url
queries:
- name: Master HVAC Efficiency
query: "SELECT ROUND(AVG(state),2) AS AvgEff FROM states WHERE entity_id='input_number.master_prev_eff' and state <> 0 ORDER BY last_changed desc LIMIT 50;"
column: 'AvgEff'
unit_of_measurement: min
- platform: sql
db_url: !secret recorder_db_url
queries:
- name: Upstairs HVAC Efficiency
query: "SELECT ROUND(AVG(state),2) AS AvgEff FROM states WHERE entity_id='input_number.upstairs_prev_eff' and state <> 0 ORDER BY last_changed desc LIMIT 50;"
column: 'AvgEff'
unit_of_measurement: min
- platform: sql
db_url: !secret recorder_db_url
queries:
- name: Downstairs HVAC Efficiency
query: "SELECT ROUND(AVG(state),2) AS AvgEff FROM states WHERE entity_id='input_number.downstairs_prev_eff' and state <> 0 ORDER BY last_changed desc LIMIT 50;"
column: 'AvgEff'
unit_of_measurement: min
- platform: sql
db_url: !secret recorder_db_url
queries:
- name: New Cases US
query: "SELECT (select state from states WHERE entity_id='sensor.us_coronavirus_confirmed' and DAY(last_changed)=DAY(now()) and state != 'unavailable' ORDER BY last_changed desc LIMIT 1) - (select state from states WHERE entity_id='sensor.us_coronavirus_confirmed' and DAY(last_changed)=DAY(now()) and state != 'unavailable' ORDER BY last_changed asc LIMIT 1) as NewCases;"
column: 'NewCases'
unit_of_measurement: people
- platform: sql
db_url: !secret recorder_db_url
queries:
- name: New Cases Georgia
query: "SELECT (select state from states WHERE entity_id='sensor.corona_virus_georgia' and DAY(last_changed)=DAY(now()) and state != 'unavailable' ORDER BY last_changed desc LIMIT 1) - (select state from states WHERE entity_id='sensor.corona_virus_georgia' and DAY(last_changed)=DAY(now()) and state != 'unavailable' ORDER BY last_changed asc LIMIT 1) as NewCases;"
column: 'NewCases'
unit_of_measurement: people
- platform: sql
db_url: !secret recorder_db_url
queries:
- name: New Cases India
query: "SELECT (select state from states WHERE entity_id='sensor.india_coronavirus_confirmed' and DAY(last_changed)=DAY(now()) and state != 'unavailable' ORDER BY last_changed desc LIMIT 1) - (select state from states WHERE entity_id='sensor.india_coronavirus_confirmed' and DAY(last_changed)=DAY(now()) and state != 'unavailable' ORDER BY last_changed asc LIMIT 1) as NewCases;"
column: 'NewCases'
unit_of_measurement: people
- platform: personalcapital
email: !secret pc_username
password: !secret pc_password
monitored_categories:
- investment
- mortgage
- cash
- other_asset
- credit
- platform: aarlo
monitored_conditions:
- battery_level
- signal_strength
- platform: futures_cnn
resources:
- sp
- sp_change_pct
- sp_change
- dow
- dow_change_pct
- dow_change
- nasdaq
- nasdaq_change_pct
- nasdaq_change
- platform: version
- platform: uptime
unit_of_measurement: minutes
- platform: statistics
name: Master Temp Statistics
entity_id: sensor.master_temperature
max_age:
minutes: 30
- platform: history_stats
name: Total TV Time
entity_id: media_player.living_room_tv
state: 'on'
type: time
start: '{{ now().replace(hour=0).replace(minute=0).replace(second=0) }}'
end: '{{ now() }}'
- platform: history_stats
name: Downstairs heat
entity_id: sensor.downstairsthermoper
state: 'heating'
type: time
start: '{{ now().replace(hour=0).replace(minute=0).replace(second=0) }}'
end: '{{ now() }}'
- platform: history_stats
name: Downstairs cool
entity_id: sensor.downstairsthermoper
state: 'cooling'
type: time
start: '{{ now().replace(hour=0).replace(minute=0).replace(second=0) }}'
end: '{{ now() }}'
- platform: history_stats
name: Upstairs heat
entity_id: sensor.upstairsthermoper
state: 'heating'
type: time
start: '{{ now().replace(hour=0).replace(minute=0).replace(second=0) }}'
end: '{{ now() }}'
- platform: history_stats
name: Upstairs cool
entity_id: sensor.upstairsthermoper
state: 'cooling'
type: time
start: '{{ now().replace(hour=0).replace(minute=0).replace(second=0) }}'
end: '{{ now() }}'
- platform: history_stats
name: Master heat
entity_id: sensor.masterthermoper
state: 'heating'
type: time
start: '{{ now().replace(hour=0).replace(minute=0).replace(second=0) }}'
end: '{{ now() }}'
- platform: history_stats
name: Master cool
entity_id: sensor.masterthermoper
state: 'cooling'
type: time
start: '{{ now().replace(hour=0).replace(minute=0).replace(second=0) }}'
end: '{{ now() }}'
#Morning Commute Google Travel Time Sensor
- platform: google_travel_time
name: Morning Commute
scan_interval: 60000
api_key: !secret google_key
origin: zone.home
destination: zone.downtown
#Evening Commute Google Travel Time Sensor
- platform: google_travel_time
name: Alok to Home
scan_interval: 60000
api_key: !secret google_key
origin: person.alok
destination: zone.home
# - platform: wunderground
# api_key: !secret wunderground_key
# pws_id: !secret wunderground_pws
# monitored_conditions:
# - weather
# - temp_f
# - wind_string
# - relative_humidity
- platform: sectorperformance
api_key: !secret alphavantage_key
- platform: alpha_vantage
api_key: !secret alphavantage_key
foreign_exchange:
- from: USD
to: INR
name: USDINR
- platform: mqtt
name: "Master Bed Weight"
state_topic: "/load/masterbed/WeightChanA"
# - platform: mqtt
# state_topic: "owntracks/pi/rashmiphone/step"
# name: "Steps Rashmi"
# value_template: '{{ value_json.steps }}'
# - platform: mqtt
# state_topic: "owntracks/pi/alokphone/step"
# name: "Steps Alok"
# value_template: '{{ value_json.steps }}'
- platform: command_line
name: Grafana temp down
command: !secret grafana_temp_down
scan_interval: 300
- platform: command_line
name: Grafana HVAC Eff down
command: !secret grafana_downstairs_hvac_efficiency
scan_interval: 300
- platform: command_line
name: Grafana mode down
command: !secret grafana_mode_down
scan_interval: 300
- platform: command_line
name: Grafana temp up
command: !secret grafana_temp_up
scan_interval: 300
- platform: command_line
name: Grafana HVAC Eff up
command: !secret grafana_upstairs_hvac_efficiency
scan_interval: 300
- platform: command_line
name: Grafana mode up
command: !secret grafana_mode_up
scan_interval: 300
- platform: command_line
name: Grafana temp master
command: !secret grafana_temp_master
scan_interval: 300
- platform: command_line
name: Grafana HVAC Eff master
command: !secret grafana_master_hvac_efficiency
scan_interval: 300
- platform: command_line
name: Grafana mode master
command: !secret grafana_mode_master
scan_interval: 300
- platform: command_line
name: Grafana portfolio
command: !secret grafana_portfolio
scan_interval: 600
- platform: command_line
name: Grafana networth
command: !secret grafana_networth
scan_interval: 600
- platform: command_line
name: Grafana USDINR
command: !secret grafana_usdinr
scan_interval: 600
- platform: command_line
name: SSL certificate expiry
unit_of_measurement: days
scan_interval: 86400
command: !secret cert_expiry
- platform: command_line
name: 10 Year Treasury
unit_of_measurement: '%'
scan_interval: 18000
command: "wget -O - -q http://money.cnn.com/data/premarket | grep 'last_572094' | awk -F'>' '{print $3}' | awk -F'<' '{print $1}'"
# - platform: scrape
# resource: http://money.cnn.com/data/premarket/
# name: Curr Future
# scan_interval: 86400
# # select: ".wsod_bold.wsod_aRight span"
# select: ".wsod_bold.wsod_aRight"
- platform: scrape
resource: !secret scholar_profile
name: Citations
scan_interval: 172800
select: "tr:nth-child(1) td:nth-child(2)"
value_template: '{{ value }}'
- platform: rest
method: POST
resource: http://192.168.2.253:1400/DeviceProperties/Control
name: Sonos Stereo
headers:
SOAPACTION: "urn:schemas-upnp-org:service:DeviceProperties:1#GetZoneInfo"
Content-Type: text/xml; charset="utf-8"
payload: '<s:Envelope xmlns:s="http://schemas.xmlsoap.org/soap/envelope/" s:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"><s:Body><u:GetZoneInfo xmlns:u="urn:schemas-upnp-org:service:DeviceProperties:1"></u:GetZoneInfo></s:Body></s:Envelope>'
value_template: '{{ value_json["s:Envelope"]["s:Body"]["u:GetZoneInfoResponse"]["HTAudioIn"] }}'
- platform: rest
method: POST
resource: http://192.168.2.160:1400/DeviceProperties/Control
name: Sonos Master
headers:
SOAPACTION: "urn:schemas-upnp-org:service:DeviceProperties:1#GetZoneInfo"
Content-Type: text/xml; charset="utf-8"
payload: '<s:Envelope xmlns:s="http://schemas.xmlsoap.org/soap/envelope/" s:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"><s:Body><u:GetZoneInfo xmlns:u="urn:schemas-upnp-org:service:DeviceProperties:1"></u:GetZoneInfo></s:Body></s:Envelope>'
value_template: '{{ value_json["s:Envelope"]["s:Body"]["u:GetZoneInfoResponse"]["HTAudioIn"] }}'
- platform: rest
resource: "https://services1.arcgis.com/0MSEUqKaxRlEPj5g/arcgis/rest/services/ncov_cases/FeatureServer/1/query?f=json&where=(Country_Region%3D%27US%27)%20AND%20(Province_State%20LIKE%20%27%25Georgia%27)&outStatistics=%5B%7B%22statisticType%22%3A%22sum%22%2C%22onStatisticField%22%3A%22Confirmed%22%2C%22outStatisticFieldName%22%3A%22Confirmed%22%7D%2C%20%7B%22statisticType%22%3A%22sum%22%2C%22onStatisticField%22%3A%22Deaths%22%2C%22outStatisticFieldName%22%3A%22Deaths%22%7D%2C%20%7B%22statisticType%22%3A%22sum%22%2C%22onStatisticField%22%3A%22Recovered%22%2C%22outStatisticFieldName%22%3A%22Recovered%22%7D%5D"
name: Corona Virus Georgia
value_template: "{{ value_json.features[0].attributes.Confirmed }}"
json_attributes_path: "$.features[0].attributes"
unit_of_measurement: "Confirmed"
json_attributes:
- Confirmed
- Deaths
- Recovered
# value_template: '{{ "<HTAudioIn>2</HTAudioIn>" in value }}'
# - platform: rest
# resource: !secret here_weather
# name: Moon Rise
# scan_interval: 86400
# value_template: '{{value_json.astronomy.astronomy[0].moonrise}}'
# json_attributes:
# - moonset
# - moonPhaseDesc
# - moonPhase
# - sunrise
# - sunset
- platform: template
sensors:
cube_last_action:
friendly_name: "Cube last action"
value_template: >
{% if as_timestamp(now()) - as_timestamp(states.binary_sensor.cube_158d0001035aa7.last_updated) >50 %}
None
{% else %}
{{state_attr('binary_sensor.cube_158d0001035aa7', 'last_action')}}
{% endif %}
livingroom_temp_rounded:
friendly_name: "Living room temperature"
value_template: "{{states('sensor.temperature_158d0001ab3c88')|round}}"
study_temp_rounded:
friendly_name: "Study temperature"
value_template: "{{states('sensor.temperature_158d0001ab3b2b')|round}}"
# unit_of_measurement: "°F"
sonos_audio_in:
friendly_name: "Sonos Audio-in"
value_template: >-
{%- set audio_in = {'0': 'No SPDIF input connected', '2': 'Stereo', '7': 'Dolby 2.0', '18': 'Dolby 5.1', '20': 'Pause Burst', '21': 'Paused', '22': 'Silence'} -%}
{{ audio_in[states.sensor.sonos_stereo.state] | default('NA', true)}}
icon_template: >-
{%- set audio_in = {'2': 'mdi:surround-sound-2-0', '7': 'mdi:dolby', '18': 'mdi:surround-sound-5-1'} -%}
{{ audio_in[states.sensor.sonos_stereo.state] | default('mdi:volume-high', true) }}
master_audio_in:
friendly_name: "Master Audio-in"
value_template: >-
{%- set audio_in = {'0': 'No SPDIF input connected', '2': 'Stereo', '7': 'Dolby 2.0', '18': 'Dolby 5.1', '20': 'Pause Burst', '21': 'Paused', '22': 'Silence', '33554434': 'Stereo 2.0'} -%}
{{ audio_in[states.sensor.sonos_master.state] | default('NA', true)}}
icon_template: >-
{%- set audio_in = {'2': 'mdi:surround-sound-2-0', '7': 'mdi:dolby', '18': 'mdi:surround-sound-5-1'} -%}
{{ audio_in[states.sensor.sonos_master.state] | default('mdi:volume-high', true) }}
battery_status:
friendly_name: "Battery Status"
value_template: >-
{%- set threshold = 25 -%}
{%- set domains = ['light', 'switch', 'sensor', 'zwave', 'binary_sensor', 'camera'] -%}
{%- for domain in domains -%}
{%- for item in states[domain] if ((item.attributes.battery_low is defined and item.attributes['battery_low'] == true) or (item.attributes.battery_level is defined and item.attributes['battery_level'] | int < threshold)) -%}
{{ item.name }}{%- if not loop.last %}, {% endif -%}
{%- endfor -%}
{%- endfor -%}
# hassuptime:
# friendly_name: "HASS Uptime"
# value_template: >-
# {% set uptime = states.sensor.uptime.state | round %}
# {% set minutes = (uptime % 60) | int %}
# {% set hours = ((uptime / 60) % 24) | int %}
# {% set days = (uptime / 1440) | int %}
# {%- if days > 0 -%}
# {%- if days == 1 -%}
# 1 day
# {%- else -%}
# {{ days }} days
# {%- endif -%}
# {{ ', ' }}
# {%- endif -%}
# {{ '%02d' % hours }}:{{ '%02d' % minutes }} hrs
master_temp_change:
friendly_name: "Master Efficiency"
unit_of_measurement: "min"
value_template: >-
{%- set time_elapsed_min = (as_timestamp(now()) - state_attr('input_datetime.master_time','timestamp')|float)/60 -%}
{%- set temp_diff_cool = states('input_number.master_prev_temp')|float - state_attr('climate.master_homekit','current_temperature')|float -%}
{%- set temp_diff_heat = state_attr('climate.master_homekit','current_temperature')|float - states('input_number.master_time')|float -%}
{%- if states('sensor.masterthermoper') == 'cooling' and temp_diff_cool != 0 -%}
{{ (time_elapsed_min/temp_diff_cool)|round(2) }}
{%- elif states('sensor.masterthermoper') == 'heating' and temp_diff_heat != 0 -%}
{{ (time_elapsed_min/temp_diff_heat )|round(2) }}
{%- else -%}
-999
{%- endif -%}
downstairs_temp_change:
friendly_name: "Downstairs Efficiency"
unit_of_measurement: "min"
value_template: >-
{%- set time_elapsed_min = (as_timestamp(now()) - state_attr('input_datetime.downstairs_time','timestamp')|float)/60 -%}
{%- set temp_diff_cool = states('input_number.downstairs_prev_temp')|float - state_attr('climate.downstairs_homekit','current_temperature')|float -%}
{%- set temp_diff_heat = state_attr('climate.downstairs_homekit','current_temperature')|float - states('input_number.downstairs_prev_temp')|float -%}
{%- if states('sensor.downstairsthermoper') == 'cooling' and temp_diff_cool != 0 -%}
{{ (time_elapsed_min/temp_diff_cool )|round(2) }}
{%- elif states('sensor.downstairsthermoper') == 'heating' and temp_diff_heat != 0 -%}
{{ (time_elapsed_min/temp_diff_heat )|round(2) }}
{%- else -%}
-999
{%- endif -%}
upstairs_temp_change:
friendly_name: "Upstairs Efficiency"
unit_of_measurement: "min"
value_template: >-
{%- set time_elapsed_min = (as_timestamp(now()) - state_attr('input_datetime.upstairs_time','timestamp')|float)/60 -%}
{%- set temp_diff_cool = states('input_number.upstairs_prev_temp')|float - state_attr('climate.upstairs_homekit','current_temperature')|float -%}
{%- set temp_diff_heat = state_attr('climate.upstairs_homekit','current_temperature')|float - states('input_number.upstairs_prev_temp')|float -%}
{%- if states('sensor.upstairsthermoper') == 'cooling' and temp_diff_cool != 0 -%}
{{ (time_elapsed_min/temp_diff_cool)|round(2) }}
{%- elif states('sensor.upstairsthermoper') == 'heating' and temp_diff_heat != 0 -%}
{{ (time_elapsed_min/temp_diff_heat )|round(2) }}
{%- else -%}
-999
{%- endif -%}
downstairs_hvac_runtime:
friendly_name: "Downstairs HVAC Runtime"
unit_of_measurement: "h"
value_template: >-
{%- if [states.sensor.downstairs_cool.state|float, states.sensor.downstairs_heat.state|float, 0]|max != None -%}
{{ [states.sensor.downstairs_cool.state|float, states.sensor.downstairs_heat.state|float, 0]|max }}
{%- else -%}
0
{%- endif -%}
icon_template: >-
{%- if states('sensor.downstairs_cool')|default(0) < states('sensor.downstairs_heat')|default(0) -%}
mdi:fire
{%- elif states('sensor.downstairs_cool')|default(0) > states('sensor.downstairs_heat')|default(0) -%}
mdi:snowflake
{%- endif -%}
upstairs_hvac_runtime:
friendly_name: "Upstairs HVAC Runtime"
unit_of_measurement: "h"
value_template: >-
{%- if [states.sensor.upstairs_cool.state|float, states.sensor.upstairs_heat.state|float, 0]|max != None -%}
{{ [states.sensor.upstairs_cool.state|float, states.sensor.upstairs_heat.state|float, 0]|max }}
{%- else -%}
0
{%- endif -%}
icon_template: >-
{%- if states('sensor.upstairs_cool')|default(0) < states('sensor.upstairs_heat')|default(0) -%}
mdi:fire
{%- elif states('sensor.upstairs_cool')|default(0) > states('sensor.upstairs_heat')|default(0) -%}
mdi:snowflake
{%- endif -%}
master_hvac_runtime:
friendly_name: "Master HVAC Runtime"
unit_of_measurement: "h"
value_template: >-
{%- if [states.sensor.master_cool.state|float, states.sensor.master_heat.state|float, 0]|max != None -%}
{{ [states.sensor.master_cool.state|float, states.sensor.master_heat.state|float, 0]|max }}
{%- else -%}
0
{%- endif -%}
icon_template: >-
{%- if states('sensor.master_cool')|default(0) < states('sensor.master_heat')|default(0) -%}
mdi:fire
{%- elif states('sensor.master_cool')|default(0) > states('sensor.master_heat')|default(0) -%}
mdi:snowflake
{%- endif -%}
wemopowerused:
friendly_name: "Wemo Current Power"
unit_of_measurement: "w"
value_template: >-
{%- if state_attr('switch.wemoinsight','current_power_w') -%}
{{state_attr('switch.wemoinsight','current_power_w')|round(2)}}
{%- else -%}
0
{%- endif -%}
portfolioval:
friendly_name: "Portfolio Value"
unit_of_measurement: "$"
value_template: >-
{%- if states('input_number.portfoliovalue') -%}
{{states('input_number.portfoliovalue')|round(2)}}
{%- else -%}
0
{%- endif -%}
portfoliochange:
friendly_name: "Portfolio Change"
unit_of_measurement: "$"
value_template: >-
{%- if states('input_number.portfoliochange') -%}
{{states('input_number.portfoliochange')|default(0)|round(2)}}
{%- else -%}
0
{%- endif -%}
portfoliochange2:
friendly_name: "Portfolio Change (PC)"
unit_of_measurement: "$"
value_template: >-
{{(states('sensor.pc_investment')|float - states('sensor.portfolio_morning')|float)|round (2)}}
ringvideourl:
friendly_name: "Ring Video URL"
value_template: >-
{{state_attr('camera.front_door', 'video_url').split('?')[0]}}
garagedoorbattery:
friendly_name: "Garage Door Sensor Battery"
unit_of_measurement: "%"
value_template: >-
{%- if states('zwave.garage_door_tilt_sensor') -%}
{{ state_attr('zwave.garage_door_tilt_sensor','battery_level') }}
{%- else -%}
unknown
{%- endif -%}
downstairsthermoper:
friendly_name: "Downstairs Thermostat"
value_template: >-
{{ state_attr('climate.downstairs_homekit', 'hvac_action') }}
icon_template: >-
{%- if state_attr('climate.downstairs_homekit', 'hvac_action') == "heating" -%}
mdi:fire
{%- elif state_attr('climate.downstairs_homekit', 'hvac_action') == "cooling" -%}
mdi:snowflake
{%- else -%}
mdi:fan
{%- endif -%}
upstairsthermoper:
friendly_name: "Upstairs Thermostat"
value_template: >-
{{ state_attr('climate.upstairs_homekit', 'hvac_action') }}
icon_template: >-
{%- if state_attr('climate.upstairs_homekit', 'hvac_action') == "heating" -%}
mdi:fire
{%- elif state_attr('climate.upstairs_homekit', 'hvac_action') == "cooling" -%}
mdi:snowflake
{%- else -%}
mdi:fan
{%- endif -%}
masterthermoper:
friendly_name: "Master Thermostat"
value_template: >-
{{ state_attr('climate.master_homekit', 'hvac_action') }}
icon_template: >-
{%- if state_attr('climate.master_homekit', 'hvac_action') == "heating" -%}
mdi:fire
{%- elif state_attr('climate.master_homekit', 'hvac_action') == "cooling" -%}
mdi:snowflake
{%- else -%}
mdi:fan
{%- endif -%}
living_room:
value_template: >-
{{ state_attr('remote.livingroom', 'current_activity') }}
sonos_volume:
value_template: >-
{{ (state_attr('media_player.family_room_2', 'volume_level')|default(0) * 100) |int }}
friendly_name: 'Sonos Volume'
master_sonos_volume:
value_template: >-
{{ (state_attr('media_player.master', 'volume_level')|default(0) * 100) |int }}
friendly_name: 'Master Volume'
leeoalarmstatus:
friendly_name: "Leeo Alarm"
value_template: >-
{%- if states.input_boolean.leeoalarm.state == 'off' -%}
Off
{%- elif states.input_boolean.leeoalarm.state == 'on' -%}
Active
{%- elif states.input_boolean.leeoalarm.state == None -%}
unknown
{%- endif -%}
pollen_level:
friendly_name: 'Pollen Level'
value_template: >-
{{ state_attr('sensor.allergy_index_forecasted_average', 'rating') }}
entity_picture_template: >-
{{ '/local/icons/' ~ state_attr('sensor.allergy_index_forecasted_average', 'rating').lower().replace('/', '-') ~ '.png'}}
cold_flu_risk:
friendly_name: 'Cold & Flu Risk'
value_template: >-
{{ state_attr('sensor.cold_flu_forecasted_average', 'rating') }}
entity_picture_template: >-
{{ '/local/icons/' ~ state_attr('sensor.cold_flu_forecasted_average', 'rating').lower().replace('/', '-') ~ '.png'}}
emulated_hue_names:
friendly_name: "Emulated Hue Names"
value_template: >-
{% for item in states if item.attributes.emulated_hue_name|length > 0-%}
{%- if loop.first %}{% elif loop.last %}, and {% else %}, {% endif -%}
{{item.attributes.emulated_hue_name|title}}
{%- endfor -%}.
alok_location_sensor:
value_template: >-
{% set trackers = [states.device_tracker.aloks_iphone_3, states.device_tracker.alok_s_iphone_2, states.device_tracker.life360_alok_saboo, states.device_tracker.alokphone_alokphone_2, states.device_tracker.b4445761_f6c0_4b7f_835f_cfdc03b47111]|sort(attribute='last_changed', reverse=True) %}
{{ trackers[0].state }}
attribute_templates:
latitude: >-
{% set trackers = [states.device_tracker.aloks_iphone_3, states.device_tracker.alok_s_iphone_2, states.device_tracker.life360_alok_saboo, states.device_tracker.alokphone_alokphone_2, states.device_tracker.b4445761_f6c0_4b7f_835f_cfdc03b47111]|sort(attribute='last_changed', reverse=True) %}
{{ trackers[0].attributes.latitude }}
longitude: >-
{% set trackers = [states.device_tracker.aloks_iphone_3, states.device_tracker.alok_s_iphone_2, states.device_tracker.life360_alok_saboo, states.device_tracker.alokphone_alokphone_2, states.device_tracker.b4445761_f6c0_4b7f_835f_cfdc03b47111]|sort(attribute='last_changed', reverse=True) %}
{{ trackers[0].attributes.longitude }}
source: >-
{% set trackers = [states.device_tracker.aloks_iphone_3, states.device_tracker.alok_s_iphone_2, states.device_tracker.life360_alok_saboo, states.device_tracker.alokphone_alokphone_2, states.device_tracker.b4445761_f6c0_4b7f_835f_cfdc03b47111]|sort(attribute='last_changed', reverse=True) %}
{{ trackers[0].entity_id }}
# porchtags:
# friendly_name: "Porch Tags"
# value_template: >-
# {{ states('input_text.porch') }}
# drivewaytags:
# friendly_name: "Driveway Tags"
# value_template: >-
# {{ states('input_text.driveway') }}
# backyardtags:
# friendly_name: "Backyard Tags"
# value_template: >-
# {{ states('input_text.backyard') }}
# patiotags:
# friendly_name: "Patio Tags"
# value_template: >-
# {{ states('input_text.patio') }}
# porchfaces:
# friendly_name: "Porch Faces"
# value_template: >-
# {{ states('input_text.porchfaces') }}
# drivewayfaces:
# friendly_name: "Driveway Faces"
# value_template: >-
# {{ states('input_text.drivewayfaces') }}
# backyardfaces:
# friendly_name: "Backyard Faces"
# value_template: >-
# {{ states('input_text.backyardfaces') }}
# patiofaces:
# friendly_name: "Patio Faces"
# value_template: >-
# {{ states('input_text.patiofaces') }}