-
Notifications
You must be signed in to change notification settings - Fork 0
/
sensors.yaml
647 lines (569 loc) · 17.2 KB
/
sensors.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
#sensor:
#
# testing mqtt sensor 1
#
- platform: mqtt
name: "mqtt_test"
state_topic: "client-send"
#
# Torque sensor
#
- platform: mqtt
name: "Redline"
state_topic: "devices/redline/torque"
value_template: "{{ state_attr('sensor.redline_torque', 'GPS Time') }}"
json_attributes_topic: "devices/redline/torque"
#
# testing mqtt sensor 2
#
- platform: mqtt
state_topic: "home-assistant/weather/device/1"
name: "Temperature"
unit_of_measurement: "°C"
value_template: "{{ value_json.temperature }}"
- platform: mqtt
name: Zigbee2mqtt Networkmap
# if you change base_topic of Zigbee2mqtt, change state_topic accordingly
state_topic: zigbee2mqtt/bridge/response/networkmap
value_template: >-
{{ now().strftime('%Y-%m-%d %H:%M:%S') }}
# again, if you change base_topic of Zigbee2mqtt, change json_attributes_topic accordingly
json_attributes_topic: zigbee2mqtt/bridge/response/networkmap
json_attributes_template: "{{ value_json.data.value | tojson }}"
#
# QNAP NAS sensor
- platform: qnap
host: 192.168.1.55
port: 8080
username: !secret qnap_user
password: !secret qnap_psw
monitored_conditions:
- status
- cpu_usage
- memory_percent_used
- network_tx
- volume_percentage_used
- system_temp
- volume_size_used
#
# Date/Time sensor for revised clock/world time display
#
- platform: time_date
display_options:
- 'time'
- 'date'
- 'date_time'
- 'date_time_utc'
- 'date_time_iso'
- 'time_date'
- 'time_utc'
- 'beat'
#
# Air quality sensor
#
- platform: waqi
token: !secret aqicn_token
locations:
- brisbane
#
# xbox 'dan' daily online history sensort
#
- platform: history_stats
name: xbox dan time
entity_id: binary_sensor.get_plonked
type: time
state: "on"
start: "{{ now().replace(hour=0, minute=0, second=0) }}"
end: "{{ now().replace(hour=23, minute=59, second=59) }}"
# duration:
# days: 1
#
# xbox 'dan' online history sensort
#
- platform: history_stats
name: xbox weekly
entity_id: binary_sensor.get_plonked
type: time
state: "on"
end: "{{ now().replace(hour=0, minute=0, second=0) }}"
duration:
days: 7
#
# Moon integration
#
- platform: moon
#
# Centaurus uptime history sensor
#
- platform: history_stats
name: Centaurus uptime last 7 days
entity_id: device_tracker.centaurus
type: time
state: "home"
# start: "{{ now().replace(hour=0, minute=0, second=0) }}"
end: "{{ now().replace(hour=0, minute=0, second=0) }}"
duration:
days: 7
#
# ESP32 Outside uptime sensor
#
- platform: history_stats
name: esp32 outside uptime last 7 days
entity_id: device_tracker.centaurus
type: time
state: "home"
# start: "{{ now().replace(hour=0, minute=0, second=0) }}"
end: "{{ now().replace(hour=0, minute=0, second=0) }}"
duration:
days: 7
#
# Kindle daily usage history sensor
#
- platform: history_stats
name: kindle use today
entity_id: device_tracker.amazon_technologies_c7_13_4d
type: time
state: "home"
start: "{{ now().replace(hour=0, minute=0, second=0) }}"
end: "{{ now().replace(hour=23, minute=59, second=59) }}"
# duration:
# days: 7
#
# Kindle usage history sensor
#
- platform: history_stats
name: kindle_weekly
entity_id: device_tracker.amazon_technologies_c7_13_4d
type: time
state: "home"
# start: "{{ now().replace(hour=0, minute=0, second=0) }}"
end: "{{ now().replace(hour=0, minute=0, second=0) }}"
duration:
days: 7
# #
# # Time to Nudgee
# #
# - platform: waze_travel_time
# name: Waze Nudgee
# origin: zone.home
# destination: 1097 Nudgee Rd, Nudgee QLD 4014
# units: 'metric'
# vehicle_type: 'car'
# region: 'AU'
# avoid_toll_roads: true
# #
# # Time to Clontarf
# #
# - platform: waze_travel_time
# name: Waze Clontarf
# origin: zone.home
# destination: 10-22 Hornibrook Esplanade, Clontarf QLD 4019
# units: 'metric'
# vehicle_type: 'car'
# region: 'AU'
# avoid_toll_roads: true
# #
# # Time to city
# #
# - platform: waze_travel_time
# name: Waze City
# origin: zone.home
# destination: 400 George St, Brisbane QLD 4000
# units: 'metric'
# vehicle_type: 'car'
# region: 'AU'
# avoid_toll_roads: true
# #
# # Matt distance to Laura
# #
# - platform: waze_travel_time
# name: Waze Matt to Laura
# origin: device_tracker.oneplus_a5000
# destination: device_tracker.lauras_iphone
# units: 'metric'
# vehicle_type: 'car'
# region: 'AU'
# avoid_toll_roads: true
# #
# # Matt distance to Daniel
# #
# - platform: waze_travel_time
# name: Waze Matt to Dan
# origin: device_tracker.oneplus_a5000
# destination: person.dan_petersen
# units: 'metric'
# vehicle_type: 'car'
# region: 'AU'
# avoid_toll_roads: true
# #
# # Time to Gold Coast
# #
# - platform: waze_travel_time
# name: Waze Gold Coast
# origin: zone.home
# destination: Gold Coast QLD 4000
# units: 'metric'
# vehicle_type: 'car'
# region: 'AU'
# avoid_toll_roads: true
# #
# # Time for Matt to get home
# #
# - platform: waze_travel_time
# name: Waze Matt Home
# origin: device_tracker.oneplus_a5000
# destination: zone.home
# units: 'metric'
# vehicle_type: 'car'
# region: 'AU'
# avoid_toll_roads: true
#
# Scrape Petrol Price
#
# - platform: scrape
# name: petrol brisbane
# resource: view-source:https://www.qld.gov.au/health/conditions/health-alerts/coronavirus-covid-19/current-status/statistics
# select: "casesummary"
# headers:
# User-Agent: Mozilla/5.0
#
# ZigStar Sensor Scrape
#
# - platform: scrape
# name: "Zigstar Temp"
# #icon_template: "mdi:thermometer-low"
# resource: http://192.168.1.97
# select: "#genConfig"
# #index: 2
# value_template: "{{ value.split('°')[0].split('ESP Temperature : ')[1] | float(2) }}"
# unit_of_measurement: "°C"
# headers:
# User-Agent: Mozilla/5.0
#
# Average Temps
#
- platform: average
name: 'Average Weekly Temperature'
#icon_template: "mdi:thermometer-low"
duration:
days: 7
entities:
- weather.fig_tree_pocket
#
# RSS Feed sensor
#
# - platform: feedparser
# name: Engineering Feed
# feed_url: 'https://www.sciencedaily.com/rss/matter_energy/engineering.xml'
# date_format: '%a, %b %d %I:%M %p'
# scan_interval:
# hours: 3
# inclusions:
# - title
# - link
# - description
# - image
# - language
# - pubDate
# exclusions:
# - language
# #
# # Zigstar template for F
# #
# - platform: template
# sensors:
# zigstar_temp_f:
# friendly_name: "Zigstar F"
# icon_template: "mdi:thermometer-low"
# unit_of_measurement: '°F'
# value_template: >-
# {% set t = states('sensor.zigstar_internal_temp') | float(2) %}
# {{((t)*9/5)+32}}
# availability_template: >-
# {{ (states('sensor.zigstar_temp') | float(2)) >= 0 }}
- platform: template
sensors:
zigstar_internal_temp:
friendly_name: "Zigstar Temperature"
icon_template: "mdi:thermometer-low"
unit_of_measurement: '°C'
value_template: >-
{{ state_attr('sensor.esp_temperature', 'temperature') }}
- platform: scrape
name: QLD Covid Active Cases - Total
resource: https://covidlive.com.au/report/daily-active-cases/qld
select: ".DAILY-ACTIVE-CASES tr:nth-child(2) .COL2.ACTIVE"
- platform: scrape
name: QLD Covid Active Cases Change - Today
resource: https://covidlive.com.au/report/daily-active-cases/qld
select: ".DAILY-ACTIVE-CASES tr:nth-child(2) .COL4.NET"
- platform: scrape
name: QLD Covid Deaths - Today
resource: https://covidlive.com.au/report/daily-deaths/qld
select: ".DAILY-DEATHS tr:nth-child(2) .COL4.NET"
- platform: scrape
name: QLD Covid Deaths - Total
resource: https://covidlive.com.au/report/daily-deaths/qld
select: ".DAILY-DEATHS tr:nth-child(2) .COL2.DEATHS"
- platform: scrape
name: QLD Covid Hospitalisations ICU - Total
resource: https://covidlive.com.au/report/daily-hospitalised/qld
select: ".DAILY-HOSPITALISED tr:nth-child(2) .COL3.ICU"
- platform: scrape
name: QLD Covid Hospitalisations Vent - TOTAL
resource: https://covidlive.com.au/report/daily-hospitalised/qld
select: ".DAILY-HOSPITALISED tr:nth-child(2) .COL4.VENT"
- platform: scrape
name: QLD Covid Hospitalisations - TOTAL
resource: https://covidlive.com.au/report/daily-hospitalised/qld
select: ".DAILY-HOSPITALISED tr:nth-child(2) .COL2.HOSP"
- platform: scrape
name: QLD Covid Cases - Total
resource: https://covidlive.com.au/report/daily-cases/qld
select: ".DAILY-CASES tr:nth-child(2) .COL3.CASES"
- platform: scrape
name: QLD Covid Cases - Today
resource: https://covidlive.com.au/report/daily-cases/qld
select: ".DAILY-CASES tr:nth-child(2) .COL5.NET"
- platform: scrape
name: QLD Covid Cases - Last Update
resource: https://covidlive.com.au/report/daily-cases/qld
select: ".DAILY-CASES tr:nth-child(2) .COL1.DATE"
- platform: rest
name: Docker Compose
json_attributes_path: "$.[:0].tag_name"
json_attributes:
- name
- tag_name
- published_at
resource: https://api.github.com/repos/docker/compose/releases/latest
value_template: "{{ state_attr('sensor.docker_compose', 'tag_name') }}"
- platform: rest
name: QLD Fuel U98
json_attributes_path: "*[?(@.region=='QLD')].prices[?(@.type=='U98')]"
json_attributes:
- suburb
- lat
- lng
- postcode
- name
- type
- price
- state
resource: https://projectzerothree.info/api.php?format=json
value_template: "{{ state_attr('sensor.qld_fuel_u98', 'name') | replace('11-Seven','7-11')}} - {{ state_attr('sensor.qld_fuel_u98', 'price') }}"
unit_of_measurement: "¢"
- platform: rest
name: QLD Fuel U95
json_attributes_path: "*[?(@.region=='QLD')].prices[?(@.type=='U95')]"
json_attributes:
- suburb
- lat
- lng
- postcode
- name
- type
- price
- state
resource: https://projectzerothree.info/api.php?format=json
value_template: "{{ state_attr('sensor.qld_fuel_u95', 'name') | replace('11-Seven','7-11')}} - {{ state_attr('sensor.qld_fuel_u95', 'price') }}"
unit_of_measurement: "¢"
- platform: rest
name: QLD Fuel U91
json_attributes_path: "*[?(@.region=='QLD')].prices[?(@.type=='U91')]"
json_attributes:
- suburb
- lat
- lng
- postcode
- name
- type
- price
- state
resource: https://projectzerothree.info/api.php?format=json
value_template: "{{ state_attr('sensor.qld_fuel_u91', 'name') | replace('11-Seven','7-11')}} - {{ state_attr('sensor.qld_fuel_u91', 'price') }}"
unit_of_measurement: "¢"
- platform: rest
name: QLD Fuel E10
json_attributes_path: "*[?(@.region=='QLD')].prices[?(@.type=='E10')]"
json_attributes:
- suburb
- lat
- lng
- postcode
- name
- type
- price
- state
resource: https://projectzerothree.info/api.php?format=json
value_template: "{{ state_attr('sensor.qld_fuel_e10', 'name') | replace('11-Seven','7-11')}} - {{ state_attr('sensor.qld_fuel_e10', 'price') }}"
unit_of_measurement: "¢"
- platform: rest
name: QLD Fuel Diesel
json_attributes_path: "*[?(@.region=='QLD')].prices[?(@.type=='Diesel')]"
json_attributes:
- suburb
- lat
- lng
- postcode
- name
- type
- price
- state
resource: https://projectzerothree.info/api.php?format=json
value_template: "{{ state_attr('sensor.qld_fuel_diesel', 'name') | replace('11-Seven','7-11')}} - {{ state_attr('sensor.qld_fuel_diesel', 'price') }}"
unit_of_measurement: "¢"
- platform: rest
name: QLD Fuel LPG
json_attributes_path: "*[?(@.region=='QLD')].prices[?(@.type=='LPG')]"
json_attributes:
- suburb
- lat
- lng
- postcode
- name
- type
- price
- state
resource: https://projectzerothree.info/api.php?format=json
value_template: "{{ state_attr('sensor.qld_fuel_lpg', 'name') | replace('11-Seven','7-11')}} - {{ state_attr('sensor.qld_fuel_lpg', 'price') }}"
unit_of_measurement: "¢"
- platform: version
name: H-A Current Version
source: local
- platform: version
name: H-A Latest Version
image: default
source: docker
- platform: sql
db_url: !secret r_db_url
queries:
- name: Recorder DB size
query: 'SELECT table_schema "database", Round(Sum(data_length + index_length) / POWER(1024,2), 1) "value" FROM information_schema.tables WHERE table_schema="harecorder" GROUP BY table_schema;'
column: 'value'
unit_of_measurement: Mb
# - platform: template
# sensors:
# avg_temp:
# friendly_name: "Avg Temp"
# icon_template: "mdi:thermometer-low"
# unit_of_measurement: 'C'
# value_template: >-
# {% set avg = ((states('sensor.fig_tree_pocket_temp') | float) + (states('sensor.outside_temperature') | float)) / 2 | round(2) %}
# {{ avg }}
# - platform: min_max
# name: "Avg MinMax Temp"
# entity_ids:
# - sensor.fig_tree_pocket_temp
# - sensor.outside_temperature
#
# QNAP template GiB to Tib
#
- platform: template
sensors:
qnap_space_used:
friendly_name: "QNAP disk utilisation"
unit_of_measurement: "TiB"
value_template: >-
{% set u = states('sensor.cygnus_used_space_volume_1') | float(2) | round(2) %}
{{(u/1024) | round(2)}}
#
# Total Used Storage
#
- platform: template
sensors:
total_disk_utilisation:
friendly_name: "Used Disk"
unit_of_measurement: "TB"
value_template: >-
{% set total = (((states('sensor.qnap_disk_utilisation') | float(2)) / 1.1) + (states('sensor.centaurus_used_space') | float) | round(2) ) %}
{{(total) | round(2)}}
availability_template: >-
{{ ((states('sensor.qnap_disk_utilisation') | float(2)) + (states('sensor.centaurus_used_space') | float) | round(2)) >= 0}}
#
# Total Storage
#
- platform: template
sensors:
total_disk_storage:
friendly_name: "Total disk"
unit_of_measurement: "TB"
value_template: >-
{{(19.2 + 5.5) | round(2)}}
#
# Zigstart device tracker (uptime)
#
- platform: template
sensors:
zigstar_up:
friendly_name: "Zigstar Up"
value_template: >-
{% if is_state('device_tracker.zigstargw', 'home') %} Up
{% else %} Down {% endif %}
# - platform: garbage_collection
# name: "Schedule Christmas"
# frequency: annual
# date: '12/25'
# icon_template: mdi:pine-tree
# verbose_state: true
# verbose_format: "in {days} days"
# - platform: garbage_collection
# name: Schedule Green Waste
# frequency: 'even-weeks'
# collection_days: mon
# icon_template: mdi:leaf-circle-outline
# icon_tomorrow: mdi:leaf-circle
# verbose_state: True
# verbose_format: "in {days} days"
# - platform: garbage_collection
# name: Schedule Recycle Waste
# frequency: 'odd-weeks'
# icon_template: mdi:recycle-variant
# icon_tomorrow: mdi:recycle
# collection_days: mon
# verbose_state: True
# # verbose_format: "on {date}, in {days} days"
# verbose_format: "in {days} days"
#
# Original world clock display
#
# - platform: worldclock
# time_zone: America/New_York
# - platform: worldclock
# time_zone: Australia/Brisbane
# - platform: worldclock
# time_zone: Europe/London
# - platform: worldclock
# time_zone: Asia/Bangkok
# - platform: worldclock
# time_zone: Asia/Manila
# - platform: template
# sensors:
# newyork_12hrs:
# value_template: >
# {% set nt = strptime(states('sensor.worldclock_sensor'), "%H:%M") %}
# {{ nt.strftime("%I:%M %p") }}
# brisbane_12hrs:
# value_template: >
# {% set nt = strptime(states('sensor.worldclock_sensor_2'), "%H:%M") %}
# {{ nt.strftime("%I:%M %p") }}
# london_12hrs:
# value_template: >
# {% set nt = strptime(states('sensor.worldclock_sensor_3'), "%H:%M") %}
# {{ nt.strftime("%I:%M %p") }}
# phuket_12hrs:
# value_template: >
# {% set nt = strptime(states('sensor.worldclock_sensor_4'), "%H:%M") %}
# {{ nt.strftime("%I:%M %p") }}
# manila_12hrs:
# value_template: >
# {% set nt = strptime(states('sensor.worldclock_sensor_5'), "%H:%M") %}
# {{ nt.strftime("%I:%M %p") }}
#
# The number of people at home
#
- platform: template
sensors:
people_home:
value_template: >
{{ states.person | selectattr('state', 'eq', 'home') | list | count }}