-
Notifications
You must be signed in to change notification settings - Fork 0
/
sensors.yaml
executable file
·392 lines (354 loc) · 11.8 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
- platform: time_date
display_options:
- 'date_time'
- platform: ups
name: 'UPS'
username: !secret ups_user
password: !secret ups_password
- platform: fedex
name: 'Fedex'
username: !secret fedexdeliverymanager_username
password: !secret fedexdeliverymanager_password
- platform: speedtest
hour:
- 9
- 12
- 20
monitored_conditions:
- ping
- download
- upload
- platform: mqtt
state_topic: "homeassistant/garage/door/relay"
name: "Garage Door Relay"
# force_update: True
- platform: mqtt
state_topic: "homeassistant/garage/door/status"
name: "Garage Door Status"
# force_update: True
# - platform: mqtt
# name: "ESP TEST"
# state_topic: "30/rotary"
# qos: 0
# unit_of_measurement: "Rotary"
- platform: darksky
api_key: !secret darksky_api_key
monitored_conditions:
- summary
- icon
- nearest_storm_distance
- nearest_storm_bearing
- precip_type
- precip_intensity
- precip_probability
- temperature
- apparent_temperature
- dew_point
- wind_speed
- wind_bearing
- cloud_cover
- humidity
- pressure
- visibility
- ozone
- minutely_summary
- hourly_summary
- daily_summary
- temperature_max
- temperature_min
- apparent_temperature_max
- apparent_temperature_min
- precip_intensity_max
- platform: template
sensors:
template_front_door:
value_template: >-
{%- if is_state("sensor.doorfront_burglar", "3") -%}
Tampered
{%- elif is_state("sensor.doorfront_burglar", "0") -%}
{%- if is_state("sensor.doorfront_access_control", "22") -%}
Open
{%- endif %}
{%- if is_state("sensor.doorfront_access_control", "23") -%}
Closed
{%- endif %}
{%- endif %}
friendly_name: 'Front Door'
template_garage_door:
value_template: >-
{%- if is_state('sensor.garage_door_status', 'CLOSED') -%}
Closed
{%- elif is_state('sensor.garage_door_status', 'OPEN') -%}
Open
{%- else -%}
<--- ERROR --->
{%- endif %}
icon_template: >-
{%- if is_state("sensor.garage_door_status", "CLOSED") -%}
mdi:garage
{%- else -%}
mdi:garage-open
{%- endif %}
friendly_name: 'Garage Door'
template_lightwell_door:
value_template: >-
{%- if is_state("sensor.doorlightwell_access_control", "23") -%}
Closed
{%- else -%}
Open
{%- endif %}
friendly_name: 'Lightwell Door'
# 88888888ba db 888888888888 888888888888 88888888888 88888888ba 88 88888888888 ad88888ba
# 88 "8b d88b 88 88 88 88 "8b 88 88 d8" "8b
# 88 ,8P d8'`8b 88 88 88 88 ,8P 88 88 Y8,
# 88aaaaaa8P' d8' `8b 88 88 88aaaaa 88aaaaaa8P' 88 88aaaaa `Y8aaaaa,
# 88""""""8b, d8YaaaaY8b 88 88 88""""" 88""""88' 88 88""""" `"""""8b,
# 88 `8b d8""""""""8b 88 88 88 88 `8b 88 88 `8b
# 88 a8P d8' `8b 88 88 88 88 `8b 88 88 Y8a a8P
# 88888888P" d8' `8b 88 88 88888888888 88 `8b 88 88888888888 "Y88888P"
zwave_battery_door_front:
value_template: '{{ states.zwave.doorfront.attributes.battery_level|default(0) }}'
icon_template: >
{% set battery_level = states.zwave.doorfront.attributes.battery_level | default(0) | int %}
{% set battery_round = (battery_level / 10) |int * 10 %}
{% if battery_round >= 100 %}
mdi:battery
{% elif battery_round > 0 %}
mdi:battery-{{ battery_round }}
{% else %}
mdi:battery-alert
{% endif %}
friendly_name: Front Door
unit_of_measurement: "%"
zwave_battery_door_lightwell:
value_template: '{{ states.zwave.doorlightwell.attributes.battery_level|default(0) }}'
icon_template: >
{% set battery_level = states.zwave.doorlightwell.attributes.battery_level | default(0) | int %}
{% set battery_round = (battery_level / 10) |int * 10 %}
{% if battery_round >= 100 %}
mdi:battery
{% elif battery_round > 0 %}
mdi:battery-{{ battery_round }}
{% else %}
mdi:battery-alert
{% endif %}
friendly_name: Lightwell Door
unit_of_measurement: "%"
# PACKAGE TRACKING
packages_in_transit:
friendly_name: "Packages in Transit"
value_template: >
{% macro in_transit(sensor) %}
{{sensor.state|int - delivered(sensor)|int}}
{% endmacro %}
{% macro delivered(sensor) %}
{% if 'delivered' in sensor.attributes %}
{{sensor.attributes.delivered}}
{% else %}
0
{% endif %}
{% endmacro %}
{{in_transit(states.sensor.usps_packages)|int + in_transit(states.sensor.ups)|int + in_transit(states.sensor.fedex)|int}}
deliveries_today:
friendly_name: "Today's Deliveries"
value_template: >
{% macro delivered(sensor) %}
{% if 'delivered' in sensor.attributes %}
{{sensor.attributes.delivered}}
{% else %}
0
{% endif %}
{% endmacro %}
{{delivered(states.sensor.usps_packages)|int + delivered(states.sensor.ups)|int + delivered(states.sensor.fedex)|int}}
# WASHING MACHINE
washer_status:
friendly_name: "Washing Machine Status"
value_template: "{{states.input_select.washer_status.state}}"
# CURTAIN ALARM CLOCK
alarm_time:
friendly_name: 'Time'
value_template: '{{ "%0.02d:%0.02d" | format(states("input_number.alarmhour") | int, states("input_number.alarmminutes") | int) }}'
dark_sky_template:
value_template: "{{ states('sensor.dark_sky_summary') }}"
icon_template: >
{% if is_state('sensor.dark_sky_icon', 'clear-day') %}
mdi:weather-sunny
{% elif is_state('sensor.dark_sky_icon', 'clear-night') %}
mdi:weather-night
{% elif is_state('sensor.dark_sky_icon', 'rain') %}
mdi:weather-rainy
{% elif is_state('sensor.dark_sky_icon', 'snow') %}
mdi:weather-snowy
{% elif is_state('sensor.dark_sky_icon', 'sleet') %}
mdi:weather-snowy-rainy
{% elif is_state('sensor.dark_sky_icon', 'wind') %}
mdi:weather-windy-variant
{% elif is_state('sensor.dark_sky_icon', 'fog') %}
mdi:weather-fog
{% elif is_state('sensor.dark_sky_icon', 'cloudy') %}
mdi:weather-cloudy
{% elif is_state('sensor.dark_sky_icon', 'partly-cloudy-day') or is_state('sensor.dark_sky_icon', 'partly-cloudy-night') %}
mdi:weather-partlycloudy
{% elif is_state('sensor.dark_sky_icon', 'hail') %}
mdi:weather-hail
{% elif is_state('sensor.dark_sky_icon', 'thunderstorm') %}
mdi:weather-lightning
{% else %}
mdi:help-circle
{% endif %}
# https://home-assistant.io/components/sensor.template/
since_last_boot_templated:
value_template: >-
{%- set slb = states.sensor.since_last_boot.state.split(' ') -%}
{%- set count = slb | length -%}
{%- set hms = slb[count - 1] -%}
{%- set hms_trimmed = hms.split('.')[0] -%}
{%- set hms_split = hms_trimmed.split(':') -%}
{%- set hours = hms_split[0] | int -%}
{%- if count == 3 -%}
{{ slb[0] ~ ' ' ~ slb[1] ~ ' ' }}
{%- endif -%}
{%- if hours > 0 -%}
{%- if hours == 1 -%}
1 hour
{%- else -%}
{{ hours }} hours
{%- endif -%}
{%- endif -%}
- platform: mqtt
state_topic: "homeassistant/garage/door/status"
name: "Garage Door Status"
payload_on: "OPEN"
payload_off: "CLOSED"
- platform: mqtt
state_topic: "homeassistant/garage/door/control"
name: "Garage Door Control"
payload_on: "OPEN"
payload_off: "CLOSED"
# SONOFF S31 SMART PLUG
- platform: mqtt
name: 'Washer Energy Yesterday'
state_topic: "homeassistant/outlets/washer/SENSOR"
value_template: "{{ value_json.ENERGY.Yesterday }}"
unit_of_measurement: "kWh"
- platform: mqtt
name: "Washer Energy Today"
state_topic: "homeassistant/outlets/washer/SENSOR"
value_template: "{{ value_json.ENERGY.Today }}"
unit_of_measurement: "kWh"
- platform: mqtt
name: "Washer Energy Total"
state_topic: "homeassistant/outlets/washer/SENSOR"
value_template: "{{ value_json.ENERGY.Total }}"
unit_of_measurement: "kWh"
- platform: mqtt
name: "Washer Power"
state_topic: "homeassistant/outlets/washer/SENSOR"
value_template: "{{ value_json.ENERGY.Power }}"
unit_of_measurement: "W"
- platform: mqtt
name: "Washer Voltage"
state_topic: "homeassistant/outlets/washer/SENSOR"
value_template: "{{ value_json.ENERGY.Voltage }}"
unit_of_measurement: "V"
- platform: mqtt
name: "Washer Current"
state_topic: "homeassistant/outlets/washer/SENSOR"
value_template: "{{ value_json.ENERGY.Current }}"
unit_of_measurement: "A"
- platform: mqtt
name: "Washer Power Factor"
state_topic: "homeassistant/outlets/washer/SENSOR"
value_template: "{{ value_json.Factor }}"
# SONOFF S31 SMART PLUG
- platform: mqtt
name: "HomeLab Energy Yesterday"
state_topic: "homeassistant/outlets/homelab/SENSOR"
value_template: "{{ value_json.ENERGY.Yesterday }}"
unit_of_measurement: "kWh"
- platform: mqtt
name: "HomeLab Energy Today"
state_topic: "homeassistant/outlets/homelab/SENSOR"
value_template: "{{ value_json.ENERGY.Today }}"
unit_of_measurement: "kWh"
- platform: mqtt
name: "HomeLab Energy Total"
state_topic: "homeassistant/outlets/homelab/SENSOR"
value_template: "{{ value_json.ENERGY.Total }}"
unit_of_measurement: "kWh"
- platform: mqtt
name: "HomeLab Power"
state_topic: "homeassistant/outlets/homelab/SENSOR"
value_template: "{{ value_json.ENERGY.Power }}"
unit_of_measurement: "W"
- platform: mqtt
name: "HomeLab Voltage"
state_topic: "homeassistant/outlets/homelab/SENSOR"
value_template: "{{ value_json.ENERGY.Voltage }}"
unit_of_measurement: "V"
- platform: mqtt
name: "HomeLab Current"
state_topic: "homeassistant/outlets/homelab/SENSOR"
value_template: "{{ value_json.ENERGY.Current }}"
unit_of_measurement: "A"
- platform: mqtt
name: "HomeLab Power Factor"
state_topic: "homeassistant/outlets/homelab/SENSOR"
value_template: "{{ value_json.Factor }}"
- platform: systemmonitor
resources:
- type: disk_use_percent
arg: /home
- type: memory_use_percent
- type: processor_use
- type: since_last_boot
- type: network_in
arg: eth0
- type: network_out
arg: eth0
- platform: crimereports
name: Crime Reports
radius: 1000
# include:
# exclude:
# Alarm
# Arson
# Assault
# Assault with Deadly Weapon
# Breaking & Entering
# Community Policing
# Death
# Disorder
# Drugs
# Emergency
# Family Offense
# Fire
# Homicide
# Kidnapping
# Liquor
# Missing Person
# Other
# Other Sexual Offense
# Pedestrian Stop
# Proactive Policing
# Property Crime
# Property Crime Commercial
# Property Crime Residential
# Quality of Life
# Robbery
# Sexual Assault
# Sexual Offense
# Theft
# Theft from Vehicle
# Theft of Vehicle
# Traffic
# Vehicle Recovery
# Vehicle Stop
# Weapons Offense
# - platform: systemmonitor
# resources:
# - type: disk_free
# arg: /home
# - type: memory_free
# - type: processor_use
# - type: last_boot