-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathsensors.yaml
522 lines (466 loc) · 16.5 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
# Weather prediction
# - platform: yr
# Google keep
- platform: google_keep
username: !secret email_cezar
password: !secret google_keep_token_password
pinned: true
name: GoogleKeep
# System monitored_conditions
- platform: systemmonitor
resources:
- type: disk_use_percent
arg: /home
- type: memory_free
- type: load_15m
- type: processor_use
- type: last_boot
# Moon phases
- platform: moon
# Anniversary
- platform: anniversaries
name: Rocznica
date: !secret rocznica
# Waze travel time
- platform: waze_travel_time
name: "Dorota"
origin: !secret waze_origin
destination: !secret waze_dest_dorota
region: 'EU'
- platform: waze_travel_time
name: "Adam"
origin: !secret waze_origin
destination: !secret waze_dest_adam
region: 'EU'
# Spaceships launch
- platform: launch_library
# Time and date
- platform: time_date
display_options:
- 'time'
- 'date'
- 'date_time'
# Seasons
- platform: season
type: astronomical
# Definition of some command line queries
- platform: command_line
name: "Raspberry CPU Temp"
command: "cat /sys/class/thermal/thermal_zone0/temp"
unit_of_measurement: "°C"
value_template: "{{ (value | multiply(0.001)) | round(1) }}"
scan_interval: 300
- platform: command_line
name: "Last HA restart"
command: "systemctl status home-assistant.service | head -3 | awk '{print $6}' | tail -1"
scan_interval: 1800
- platform: command_line
command: python3 -c "import requests; print(requests.get('https://pypi.org/pypi/homeassistant/json').json()['info']['version'])"
name: "HA Version Current"
scan_interval: 1800
- platform: command_line
command: python3 -c "import requests; print(requests.get('https://pypi.org/pypi/appdaemon/json').json()['info']['version'])"
name: "AD Version Current"
scan_interval: 1800
# DarkSky weather
- platform: darksky
api_key: !secret dark_sky_api
scan_interval:
minutes: 15
language: "pl"
forecast:
- 0
- 1
- 2
- 3
- 4
- 5
monitored_conditions:
- icon
- summary
- temperature_high
- temperature_low
- apparent_temperature
- wind_speed
- wind_bearing
- precip_probability
- daily_summary
- visibility
- uv_index
- nearest_storm_distance
- nearest_storm_bearing
- humidity
- temperature
- temperature_high
- temperature_low
- apparent_temperature_high
- apparent_temperature_low
- precip_type
- precip_accumulation
- precip_intensity
- precip_intensity_max
- pressure
- platform: template
sensors:
dark_sky_current_text:
value_template: >-
{% if is_state("sensor.dark_sky_icon","clear-day") %} Clear
{% elif is_state("sensor.dark_sky_icon","clear-night") %} Clear
{% elif is_state("sensor.dark_sky_icon","rain") %} Rain
{% elif is_state("sensor.dark_sky_icon","snow") %} Snowy
{% elif is_state("sensor.dark_sky_icon","fog") %} Foggy
{% elif is_state("sensor.dark_sky_icon","sleet") %} Sleet
{% elif is_state("sensor.dark_sky_icon","wind") %} Windy
{% elif is_state("sensor.dark_sky_icon","cloudy") %} Cloudy
{% elif is_state("sensor.dark_sky_icon","partly-cloudy-day") %} Partly Cloudy
{% elif is_state("sensor.dark_sky_icon","partly-cloudy-night") %} Partly Cloudy
{% elif is_state("sensor.dark_sky_icon","hail") %} Hailing
{% elif is_state("sensor.dark_sky_icon","lightning") %} Lightning
{% elif is_state("sensor.dark_sky_icon","thunderstorm") %} Thunderstorm
{% endif %}
dark_sky_alt_wind:
value_template: >-
{% set winddir = ['North','North-Northeast','Northeast','East-Northeast','East','East-Southeast','Southeast','South-Southeast','South','South-Southwest','Southwest','West-Southwest','West','West-Northwest','Northwest','North-Northwest','North'] %}
{{ states('sensor.dark_sky_wind_speed') | round }} mi/h from the {{ winddir[((states('sensor.dark_sky_wind_bearing') | float / 360)*16) | round]}}
# Xiaomi Air Purifier
- platform: template
sensors:
mi_aqi:
friendly_name: "Air Purifier"
unit_of_measurement: 'AQI'
value_template: "{{ state_attr('fan.xiaomi_miio_device', 'aqi') }}"
mi_humidity:
friendly_name: "Air Purifier Humidity"
unit_of_measurement: '%'
value_template: "{{ state_attr('fan.xiaomi_miio_device', 'humidity') }}"
mi_temperature:
friendly_name: "Air Purifier Temperature"
unit_of_measurement: '°C'
value_template: "{{ state_attr('fan.xiaomi_miio_device', 'temperature') }}"
# Xiaomi Power Socket
- platform: template
sensors:
nas_power_sensor:
value_template: '{{ states.switch.plug_158d0002330853.attributes.load_power }}'
unit_of_measurement: W
friendly_name: NAS power sensor
roomba_power_sensor:
value_template: '{{ states.switch.plug_158d00016ff1a4.attributes.load_power }}'
unit_of_measurement: W
friendly_name: Subwoofer power sensor
# MQTT Sensors - Sonoff
- platform: mqtt
name: Sonoff Pow Yesterday Energy
unit_of_measurement: "kWh"
state_topic: "tele/sonoffpow/SENSOR"
value_template: "{{ value_json['ENERGY'].Yesterday }}"
- platform: mqtt
name: Sonoff Pow Today Energy
unit_of_measurement: "kWh"
state_topic: "tele/sonoffpow/SENSOR"
value_template: "{{ value_json['ENERGY'].Today }}"
- platform: mqtt
name: Sonoff Pow Current
unit_of_measurement: "Amps"
state_topic: "tele/sonoffpow/SENSOR"
value_template: "{{ value_json['ENERGY'].Current }}"
- platform: mqtt
name: Sonoff Pow Power
unit_of_measurement: "Watts"
state_topic: "tele/sonoffpow/SENSOR"
value_template: "{{ value_json['ENERGY'].Power }}"
# MQTT Sensors - Sonoff TH16
- platform: mqtt
name: Sonoff Temperature
unit_of_measurement: "°C"
state_topic: "tele/sonoffth16/SENSOR"
value_template: "{{ value_json['DS18B20'].Temperature }}"
- platform: feedparser
name: Engineering Feed
feed_url: 'http://wiadomosci.gazeta.pl/pub/rss/wiadomosci_kraj.htm'
date_format: '%a, %b %d %I:%M %p'
- platform: feedparser
name: Wiadomosci Kraj
feed_url: 'http://wiadomosci.gazeta.pl/pub/rss/wiadomosci_kraj.htm'
date_format: '%a, %b %d %I:%M %p'
inclusions:
- summary
- platform: feedparser
name: Quote of the Day
feed_url: 'https://www.brainyquote.com/link/quotebr.rss'
date_format: '%a, %b %d %I:%M %p'
- platform: scrape
resource: https://www.traxelektronik.pl/pogoda/kamery/kamera.php?pkamnum=323
name: Url kamera traxel boleslaw (na katowice)
select: "#kam1 ~ a:nth-of-type(4)"
value_template: >-
{{ value.split("'")[1] }}
attribute: href
scan_interval: 60
- platform: scrape
resource: https://www.traxelektronik.pl/pogoda/kamery/kamera.php?pkamnum=323
name: Url kamera traxel boleslaw (na olkusz)
select: "#kam0 ~ a:nth-of-type(4)"
value_template: >-
{{ value.split("'")[1] }}
attribute: href
scan_interval: 60
- platform: rflink
automatic_add: false
devices:
alectov4_5fc8_temp:
sensor_type: temperature
name: Temperatura Staszek
- platform: rflink
automatic_add: false
devices:
owl_cm180_00a8_watt:
sensor_type: watt
name: Owl Waty
- platform: rflink
automatic_add: false
devices:
owl_cm180_00a8_kwatt:
sensor_type: kilowatt
name: Owl Kilowaty
- platform: rflink
automatic_add: false
devices:
eurochron_0002_temp:
sensor_type: temperature
name: Temperatura Ogród
# - platform: miflora
# mac: 'C4:7C:8D:62:A9:57'
# name: Salon Flora
# location: Salon
# force_update: true
# median: 3
# monitored_conditions:
# - temperature
# - moisture
# - light
# - conductivity
# - battery
- platform: mitemp_bt
# period: 60
active_scan: true
hci_interface:
- 0
- 1
# mac: 'C4:7C:8D:62:A9:57'
# name: Salon Flora
# force_update: true
# median: 3
# monitored_conditions:
# - temperature
# - moisture
# - light
# - conductivity
# - battery
- platform: history_stats
name: PS4 today
entity_id: switch.playstation4
state: 'on'
type: time
start: '{{ now().replace(hour=0).replace(minute=0).replace(second=0) }}'
end: '{{ now() }}'
- platform: template
sensors:
ps4_today_time:
friendly_name: PS4 dzienny czas
value_template: "{{ states('sensor.ps4_today') }}"
- platform: integration
source: sensor.owl_waty
name: owl_energy
round: 2
unit_prefix: k
- platform: integration
source: sensor.nas_power_sensor
name: "NAS energy"
round: 2
# unit: k
unit_prefix: k
- platform: integration
source: sensor.pralka_power
name: "Pralka Energy"
unit_prefix: k
round: 2
- platform: integration
source: sensor.tv_power
name: "TV Energy"
unit_prefix: k
round: 2
# - platform: template
# sensors:
# daily_energy:
# friendly_name: Daily Energy
# unit_of_measurement: W
# value_template: "{{ states('sensor.daily_energy_offpeak')|float + states('sensor.daily_energy_peak')|float }}"
# monthly_energy:
# friendly_name: Monthly Energy
# unit_of_measurement: W
# value_template: "{{ states('sensor.monthly_energy_offpeak')|float + states('sensor.monthly_energy_peak')|float }}"
- platform: pvoutput
system_id: 77346
api_key: d85e4d43516ea41260fea894f1a45c6ea08a3f0d
scan_interval: 120
- platform: template
sensors:
power_consumption:
# value_template: '{% if is_state_attr("sensor.pvoutput", "power_consumption", "NaN") %}0{% else %}{{ state_attr("sensor.pvoutput", "power_consumption") }}{% endif %}'
# value_template: '{% if is_state_attr("sensor.owl_waty", "power_consumption", "NaN") %}0{% else %}{{ state_attr("sensor.owl_waty", "power_consumption") }}{% endif %}'
value_template: '{{ states("sensor.owl_waty") }}'
friendly_name: 'Using'
unit_of_measurement: 'Watt'
energy_consumption:
# value_template: '{{ "%0.1f"|format(state_attr("sensor.pvoutput", "energy_consumption")|float/1000) }}'
value_template: '{{ "%0.1f"|format(states("sensor.owl_energy")|float/1000) }}'
# value_template: '{{ (states("sensor.owl_energy")) }}'
friendly_name: 'Used'
unit_of_measurement: 'kWh'
power_generation:
value_template: '{% if is_state_attr("sensor.pvoutput", "power_generation", "NaN") %}0{% else %}{{ state_attr("sensor.pvoutput", "power_generation") }}{% endif %}'
friendly_name: 'Generating'
unit_of_measurement: 'Watt'
energy_generation:
value_template: '{% if is_state_attr("sensor.pvoutput", "energy_generation", "NaN") %}0{% else %}{{ "%0.2f"|format(state_attr("sensor.pvoutput", "energy_generation")|float/1000) }}{% endif %}'
friendly_name: 'Generated'
unit_of_measurement: 'kWh'
- platform: template
sensors:
rain_precipitation:
value_template: '{{ state_attr("weather.home_2", "forecast")[1]["precipitation_probability"] }}'
friendly_name: 'Rain precipitation for the next day'
- platform: template
sensors:
rain_precipitation_today:
value_template: '{{ state_attr("weather.home_2", "forecast")[0]["precipitation_probability"] }}'
friendly_name: 'Rain precipitation for today'
- platform: template
sensors:
airly_pm25:
friendly_name: "Pył PM2.5"
icon_template: mdi:blur
unit_of_measurement: "μg/m3"
value_template: "{{ state_attr('air_quality.airly', 'particulate_matter_2_5') }}"
airly_pm10:
friendly_name: "Pył PM10"
icon_template: mdi:blur
unit_of_measurement: "μg/m3"
value_template: "{{ state_attr('air_quality.airly', 'particulate_matter_10') }}"
airly_quality:
friendly_name: "Jakość powietrza"
icon_template: mdi:quicktime
value_template: "{{ state_attr('air_quality.airly', 'air_quality_index') }}"
airly_level:
friendly_name: "Komunikat"
icon_template: mdi:information-outline
value_template: "{{ state_attr('air_quality.airly', 'air_quality_index_description') }}"
airly_advice:
friendly_name: "Porada"
icon_template: mdi:information-outline
value_template: "{{ state_attr('air_quality.airly', 'advice') }}"
airly_pm25_limit:
friendly_name: "Pył PM2.5 % normy"
icon_template: mdi:blur
unit_of_measurement: "%"
value_template: "{{ state_attr('air_quality.airly', 'particulate_matter_2_5_percent_of_limit') }}"
airly_pm10_limit:
friendly_name: "Pył PM10 % normy"
icon_template: mdi:blur
unit_of_measurement: "%"
value_template: "{{ state_attr('air_quality.airly', 'particulate_matter_10_percent_of_limit') }}"
- platform: mqtt
name: "TV Energy Today"
state_topic: "tele/blitzwolf1/SENSOR"
value_template: '{{ value_json["ENERGY"]["Today"] }}'
unit_of_measurement: "kWh"
- platform: mqtt
name: "TV Energy Yesterday"
state_topic: "tele/blitzwolf1/SENSOR"
value_template: '{{ value_json["ENERGY"]["Yesterday"] }}'
unit_of_measurement: "kWh"
- platform: mqtt
name: "TV Energy Total"
state_topic: "tele/blitzwolf1/SENSOR"
value_template: '{{ value_json["ENERGY"]["Total"] }}'
unit_of_measurement: "kWh"
- platform: mqtt
name: "TV Power"
state_topic: "tele/blitzwolf1/SENSOR"
value_template: '{{ value_json["ENERGY"]["Power"] }}'
unit_of_measurement: "W"
- platform: mqtt
name: "TV Voltage"
state_topic: "tele/blitzwolf1/SENSOR"
value_template: '{{ value_json["ENERGY"]["Voltage"] }}'
unit_of_measurement: "V"
- platform: mqtt
name: "TV Power Factor"
state_topic: "tele/blitzwolf1/SENSOR"
value_template: '{{ value_json["ENERGY"]["Factor"] }}'
- platform: mqtt
name: "Pralka Energy Today"
state_topic: "tele/blitzwolf2/SENSOR"
value_template: '{{ value_json["ENERGY"]["Today"] }}'
unit_of_measurement: "kWh"
- platform: mqtt
name: "Pralka Energy Yesterday"
state_topic: "tele/blitzwolf2/SENSOR"
value_template: '{{ value_json["ENERGY"]["Yesterday"] }}'
unit_of_measurement: "kWh"
- platform: mqtt
name: "Pralka Energy Total"
state_topic: "tele/blitzwolf2/SENSOR"
value_template: '{{ value_json["ENERGY"]["Total"] }}'
unit_of_measurement: "kWh"
- platform: mqtt
name: "Pralka Power"
state_topic: "tele/blitzwolf2/SENSOR"
value_template: '{{ value_json["ENERGY"]["Power"] }}'
unit_of_measurement: "W"
- platform: mqtt
name: "Pralka Voltage"
state_topic: "tele/blitzwolf2/SENSOR"
value_template: '{{ value_json["ENERGY"]["Voltage"] }}'
unit_of_measurement: "V"
- platform: mqtt
name: "Pralka Power Factor"
state_topic: "tele/blitzwolf2/SENSOR"
value_template: '{{ value_json["ENERGY"]["Factor"] }}'
- platform: template
sensors:
pralka:
friendly_name: "Pralka"
value_template: >-
{% if states('sensor.pralka_power') != ('unavailable' or 'unknown') %}
{% if states('sensor.pralka_power') | int > 2 %}
pranie
{% else %}
wyłączona
{% endif %}
{% else %}
{{ states('sensor.pralka') }}
{% endif %}
- platform: template
sensors:
tv:
friendly_name: "TV"
value_template: >-
{% if states('sensor.tv_power') != ('unavailable' or 'unknown') %}
{% if states('sensor.tv_power') | int > 1 %}
pranie
{% else %}
wyłączona
{% endif %}
{% else %}
{{ states('sensor.tv') }}
{% endif %}
- platform: mqtt
name: "Czujnik smogu PM25"
state_topic: "CzujnikSmogu_1/CzujnikSmogu/PM25"
unit_of_measurement: "ug/m3"
- platform: mqtt
name: "Czujnik smogu PM10"
state_topic: "CzujnikSmogu_1/CzujnikSmogu/PM10"
unit_of_measurement: "ug/m3"