-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathsensors.yaml
executable file
·242 lines (220 loc) · 6.45 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
#
# Learn more at https://home-assistant.io/components/sensor/
#
#
# Speed Test
#
#- platform: speedtest
# minute:
# - 0
# - 30
# monitored_conditions:
# - ping
# - download
# - upload
#
# System Monitor
#
- platform: systemmonitor
resources:
- type: processor_use
- type: memory_use_percent
- type: disk_use_percent
arg: /
- type: load_1m
- type: load_5m
- type: load_15m
# - type: since_last_boot
- platform: command_line
name: Installed HA Version
command: /srv/homeassistant/bin/hass --version
scan_interval: 3600
- platform: command_line
name: CPU Temp
command: "cat /sys/class/thermal/thermal_zone0/temp | awk '{printf \"%.1f\", ((($1*.001) * 1.8))+32}'"
unit_of_measurement: "F"
# C *1.8 + 32 = F
# command: "cat /sys/class/thermal/thermal_zone0/temp"
# value_template: '{{ value | multiply(0.001) | round(1) }}'
- platform: command_line
name: "HA Uptime"
command: echo "$(($(date +%s) - $(date -d "$(head -n1 /home/homeassistant/.homeassistant/home-assistant.log | cut -d' ' -f-2)" +%s)))"
scan_interval: 60
value_template: >-
{% set uptime = value | int %}
{% set seconds = uptime % 60 %}
{% set minutes = ((uptime % 3600) / 60) | int %}
{% set hours = ((uptime % 86400) / 3600) | int %}
{% set days = (uptime / 86400) | int %}
{%- if days > 0 -%}
{%- if days == 1 -%}
1 day
{%- else -%}
{{ days }} days
{%- endif -%}
{{ ', ' }}
{%- endif -%}
{{ '%02d' % hours }}:{{ '%02d' % minutes }}
- platform: command_line
command: python3 -c "import requests; print(requests.get('https://pypi.python.org/pypi/homeassistant/json').json()['info']['version'])"
name: Current HA Release
scan_interval: 3600
#
# Weather
#
- platform: openweathermap
api_key: !secret api_key_openweather
monitored_conditions:
- weather
- temperature
- wind_speed
- humidity
- rain
# - platform: wunderground
# api_key: !secret api_key_wunderground
# monitored_conditions:
# - weather
# - temp_f
# - feelslike_f
# - wind_mph
# - relative_humidity
# - precip_today_in
# - alerts
# - heat_index_f
# - heat_index_string
# - observation_time
# - station_id
# - solarradiation
# - weather_2d
# - weather_2n
#
# Weather Prediction
#
# - platform: yr
#
# Google Travel
#
- platform: google_travel_time
name: Home to BVSL
api_key: !secret api_key_google
origin: !secret addr_home
destination: !secret addr_bvsl
- platform: google_travel_time
name: BVSL to Home
api_key: !secret api_key_google
origin: !secret addr_bvsl
destination: !secret addr_home
#
# Pollen
#
- platform: pollen
zip_code: !secret my_zipcode
monitored_conditions:
- allergy_average_forecasted
- allergy_average_historical
- allergy_index_today
- allergy_index_tomorrow
- allergy_index_yesterday
#
# HP Printer
#
#- platform: snmp
# host: !secret hp_printer_ip
# name: Black Ink
# unit_of_measurement: "%"
# baseoid: 1.3.6.1.4.1.1248.1.2.2.28.1.1.2.1.1
#- platform: snmp
# host: !secret hp_printer_ip
# name: Cyan Ink
# unit_of_measurement: "%"
# baseoid: 1.3.6.1.4.1.1248.1.2.2.28.1.1.2.1.2
#- platform: snmp
# host: !secret hp_printer_ip
# name: Magenta Ink
# unit_of_measurement: "%"
# baseoid: 1.3.6.1.4.1.1248.1.2.2.28.1.1.2.1.3
#- platform: snmp
# host: !secret hp_printer_ip
# name: Yellow Ink
# unit_of_measurement: "%"
# baseoid: 1.3.6.1.4.1.1248.1.2.2.28.1.1.2.1.4
#
# Yahoo Finance
#
#- platform: yahoo_finance
# symbols:
# - HCLP
# - SLCA
# - FMSA
# - CL=F
#
# Birthdays and Anniversaries
#
- platform: command_line
name: Anniversary Countdown
unit_of_measurement: days
scan_interval: 3600
command: "BDAY=`date -d '6 Nov 1982' +%j | awk '{print $1 + 0}'`; TODAY=`date +%j | awk '{print $1 + 0}'`; DAYS=$(($BDAY - $TODAY)); echo $DAYS"
- platform: command_line
name: Birthday Countdown Mike
unit_of_measurement: days
scan_interval: 3600
command: "BDAY=`date -d '15 Sep 1960' +%j | awk '{print $1 + 0}'`; TODAY=`date +%j | awk '{print $1 + 0}'`; DAYS=$(($BDAY - $TODAY)); echo $DAYS"
- platform: command_line
name: Birthday Countdown Laura
unit_of_measurement: days
scan_interval: 3600
command: "BDAY=`date -d '17 Sep 1960' +%j | awk '{print $1 + 0}'`; TODAY=`date +%j | awk '{print $1 + 0}'`; DAYS=$(($BDAY - $TODAY)); echo $DAYS"
- platform: command_line
name: Birthday Countdown Steven
unit_of_measurement: days
scan_interval: 3600
command: "BDAY=`date -d '6 Apr 1990' +%j | awk '{print $1 + 0}'`; TODAY=`date +%j | awk '{print $1 + 0}'`; DAYS=$(($BDAY - $TODAY)); echo $DAYS"
- platform: command_line
name: Birthday Countdown Julie
unit_of_measurement: days
scan_interval: 3600
command: "BDAY=`date -d '18 Jan 1994' +%j | awk '{print $1 + 0}'`; TODAY=`date +%j | awk '{print $1 + 0}'`; DAYS=$(($BDAY - $TODAY)); echo $DAYS"
#
# TEMPLATES
#
- platform: template
sensors:
garage_status:
friendly_name: 'Door Status'
value_template: '{% if states.cover.subaru %}
{% if states.cover.subaru.attributes["door_state"] == "open" %}
Open
{% elif states.cover.subaru.attributes["door_state"] == "closed" %}
Closed
{% elif states.cover.subaru.attributes["door_state"] == "opening" %}
Opening
{% elif states.cover.subaru.attributes["door_state"] == "closing" %}
Closing
{% else %}
Unknown
{% endif %}
{% else %}
n/a
{% endif %}'
garage_car_present:
friendly_name: 'Subaru in Garage'
value_template: '{% if states.cover.subaru %}
{% if states.cover.subaru.state == "open" %}
n/a
{% elif ((states.cover.subaru.attributes["distance_sensor"] > 40) and (states.cover.subaru.attributes["distance_sensor"] < 100)) %}
Yes
{% else %}
No
{% endif %}
{% else %}
n/a
{% endif %}'
pollen_level:
friendly_name: 'Pollen Level'
value_template: >-
{%- if states.sensor.allergy_index_forecasted_average_2.state != None -%}
{{ states.sensor.allergy_index_forecasted_average_2.attributes.rating }}
{%- else -%}
NA
{%- endif -%}