-
Notifications
You must be signed in to change notification settings - Fork 52
/
sensors.yaml
253 lines (228 loc) · 8.11 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
# Now in UI
# - platform: systemmonitor
# scan_interval:
# seconds: 60
# resources:
# - type: disk_use_percent
# arg: /home
# - type: disk_use_percent
# arg: /
# - type: disk_use_percent
# arg: /frigate_disk
# - type: memory_use_percent
# - type: network_in
# arg: eno1
# - type: network_out
# arg: eno1
# - type: last_boot
# - type: processor_use
# - type: load_1m
# - type: load_5m
# - type: load_15m
- platform: pfsense_gateways
host: 10.0.1.1
name: pfSense gateway
# https://github.com/alexpmorris/pfsense-status-gateways-json
key: !secret pfsense_json_key
monitored_gateway_interfaces:
- wan
- platform: history_stats
name: ac_runtime_today_cool
entity_id: sensor.thermostat_state
state: "Cooling"
type: time
start: "{{ now().replace(hour=0).replace(minute=0).replace(second=0) }}"
end: "{{ now() }}"
- platform: history_stats
name: ac_runtime_today_heat
entity_id: sensor.thermostat_state
state: "Heating"
type: time
start: "{{ now().replace(hour=0).replace(minute=0).replace(second=0) }}"
end: "{{ now() }}"
- platform: history_stats
name: ac_runtime_yesterday_cool
entity_id: sensor.thermostat_state
state: "Cooling"
type: time
end: "{{ now().replace(hour=0).replace(minute=0).replace(second=0) }}"
duration:
hours: 24
- platform: history_stats
name: ac_runtime_yesterday_heat
entity_id: sensor.thermostat_state
state: "Heating"
type: time
end: "{{ now().replace(hour=0).replace(minute=0).replace(second=0) }}"
duration:
hours: 24
- platform: statistics
name: "Neighbor 5in1 Rain Last 5 Days"
entity_id: sensor.neighbor_5in1_rain_total
state_characteristic: sum_differences
max_age:
days: 5
precision: 3
- platform: statistics
name: "Neighbor 5in1 Rain Last 24 Hours"
entity_id: sensor.neighbor_5in1_rain_total
state_characteristic: sum_differences
max_age:
hours: 24
precision: 3
- platform: statistics
name: "Neighbor 5in1 Rain Last 1 Hour"
entity_id: sensor.neighbor_5in1_rain_total
state_characteristic: sum_differences
max_age:
hours: 1
precision: 3
- platform: statistics
name: "Neighbor 5in1 Wind 5 Minute Average"
entity_id: sensor.neighbor_5in1_wind
state_characteristic: mean
max_age:
minutes: 5
# - platform: statistics
# name: "Neighbor Rain Last 24 Hours"
# entity_id: sensor.neighbor_rain_total
# state_characteristic: change
# max_age:
# hours: 24
# precision: 3
# - platform: statistics
# name: "Neighbor Rain Last 1 Hour"
# entity_id: sensor.neighbor_rain_total
# state_characteristic: change
# max_age:
# hours: 1
# precision: 3
#############
# TEMPLATES #
#############
- platform: template
sensors:
kitchen_timer_countdown:
value_template: ""
icon_template: "mdi:timer"
kitchen_all_timers:
friendly_name: "All Kitchen Timers"
value_template: "{{ state_attr('sensor.kitchen_next_timer','sorted_active') | from_json | length }}"
attribute_templates:
timers_ending: >
{% set ns = namespace(timers=[]) %}
{% for i in (state_attr('sensor.kitchen_next_timer','sorted_active') | from_json) -%}
{% set last_update = as_timestamp(state_attr('sensor.kitchen_next_timer','last_updated')) -%}
{% set remain = i[1]['remainingTime']/1000 -%}
{% set end_epoch = remain + last_update -%}
{% set end_time = end_epoch | timestamp_custom('%Y-%m-%dT%H:%M:%S', True) -%}
{% set ns.timers = ns.timers + [end_time] %}
{% endfor %}
{{ ns.timers }}
ac_runtime_today:
friendly_name: "AC Runtime Today"
unit_of_measurement: "h"
value_template: "{{ (states('sensor.ac_runtime_today_cool') | float + states('sensor.ac_runtime_today_heat') | float) }}"
attribute_templates:
value: "{{ (60 * (states('sensor.ac_runtime_today_cool') | float + states('sensor.ac_runtime_today_heat') | float)) | int }}m"
ac_runtime_yesterday:
friendly_name: "AC Runtime Today"
unit_of_measurement: "h"
value_template: "{{ (states('sensor.ac_runtime_yesterday_cool') | float + states('sensor.ac_runtime_yesterday_heat') | float) }}"
attribute_templates:
value: "{{ (60 * (states('sensor.ac_runtime_yesterday_cool') | float + states('sensor.ac_runtime_yesterday_heat') | float)) | int }}m"
netatmo_home_rain_sum_rain_today_inches:
friendly_name: Rainfall Today
unit_of_measurement: in
value_template: "{{ '%.2f'%((states('sensor.netatmo_home_home_rain_sum_rain_24') | float) / 25.4) }}"
icon_template: >
{% set amount = (states('sensor.netatmo_home_rain_sum_rain_today_inches') | float) %}
{% if amount >= 0.50 %}
mdi:weather-pouring
{% elif amount > 0.00 and amount < 0.50 %}
mdi:weather-rainy
{% else %}
mdi:cloud-outline
{% endif %}
netatmo_home_rain_sum_rain_last_hour_inches:
friendly_name: Rainfall Last 1 Hour
unit_of_measurement: in
value_template: "{{ '%.2f'%((states('sensor.netatmo_home_home_rain_sum_rain_1') | float) / 25.4) }}"
icon_template: >
{% set amount = (states('sensor.netatmo_home_rain_sum_rain_last_hour_inches') | float) %}
{% if amount >= 0.50 %}
mdi:weather-pouring
{% elif amount > 0.00 and amount < 0.50 %}
mdi:weather-rainy
{% else %}
mdi:cloud-outline
{% endif %}
mail_deliveries_message:
friendly_name: "Deliveries Summary"
value_template: >
{# Deliveries Sentence #}
{% macro deliveries_sentence() -%}
{%- if states("sensor.mail_usps_mail")|int(0) == 0 -%}
No
{%- else -%}
{{states("sensor.mail_usps_mail")|int(0)}}
{%- endif -%}
{{' '}}
{%- if states("sensor.mail_usps_mail")|int(0) <= 1 -%}
mail
{%- else -%}
pieces of mail
{%- endif -%}
{{' '}}will be delivered.{{' '}}
{%- if states("sensor.mail_packages_in_transit")|int(0) == 0 -%}
No
{%- else -%}
{{states("sensor.mail_packages_in_transit")|int(0)}}
{%- endif -%}
{{' '}}
{%- if states("sensor.mail_packages_in_transit")|int(0) == 1 -%}
package is
{%- else -%}
packages are
{%- endif -%}
{{' '}}in transit.{{' '}}
{%- endmacro %}
{{deliveries_sentence()}}
nws_temperature:
friendly_name: "Temperature"
unit_of_measurement: "°F"
value_template: "{{ state_attr('weather.kcll_daynight', 'temperature') }}"
nws_humidity:
friendly_name: "Humidity"
unit_of_measurement: "%"
icon_template: mdi:water-percent
value_template: "{{ state_attr('weather.kcll_daynight', 'humidity') }}"
nws_pressure:
friendly_name: "Pressure"
unit_of_measurement: "mbar"
value_template: "{{ state_attr('weather.kcll_daynight', 'pressure') }}"
nws_wind_speed:
friendly_name: "Wind Speed"
unit_of_measurement: "mph"
icon_template: mdi:weather-windy
value_template: "{{ state_attr('weather.kcll_daynight', 'wind_speed') }}"
nws_precip_probability:
friendly_name: "Percent Chance of Rain"
unit_of_measurement: "%"
icon_template: mdi:water-percent
value_template: >
{% if state_attr('weather.kcll_daynight', 'forecast')[0]['daytime'] == True %}
{{ state_attr('weather.kcll_daynight', 'forecast')[0]['precipitation_probability'] }}
{% else %}
{{ state_attr('weather.kcll_daynight', 'forecast')[1]['precipitation_probability'] }}
{% endif %}
# electricity_price:
# friendly_name: "Electricity Price per kWH"
# unit_of_measurement: "USD/kWh"
# icon_template: mdi:currency-usd
# value_template: >
# {% if now().month >= 5 and now().month <= 10 %}
# {{ 0.1187 + 0.0166 }}
# {% else %}
# {{ 0.1136 + 0.0166 }}
# {% endif %}