forked from Danielhiversen/home-assistant_config
-
Notifications
You must be signed in to change notification settings - Fork 0
/
sensors.yaml
260 lines (243 loc) · 10.1 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
- platform: rfxtrx
automatic_add: False
devices:
0a52080601010038480349:
name: Kjoleskap
0a520806020100c7340159: # 02
name: Stue_Vindu
0a52080103010012260259:
name: Ute_soverom
0a5208030401001f1d0259:
name: Ute_veranda
0a52080705020095220269:
name: Soverom
0a520802060100ff0e0269: # 1 06
name: Bad
data_type:
- Humidity
- Temperature
0a520800070100d2140269:
name: Stue
data_type:
- Humidity
- Temperature
0a5208980a0100d5310169:
name: Utepotte
data_type:
- Humidity
08500902cbff017469:
name: Steketermometer
- platform: yr
monitored_conditions:
- symbol
- precipitation
- temperature
#- platform: xiaomi_scale
# mac: 'c8:0f:10:a1:4d:18'
# name: Vekt
#- platform: scale
- platform: template
sensors:
relative_alarm_time:
value_template: >
{% set relative_time = (states.input_number.alarmhour.state|float|multiply(60) + states.input_number.alarmminutes.state|float) - (now().hour|float|multiply(60) + now().minute) %}
{%- if relative_time < 0 -%}
{{24*60+relative_time}}
{%- else -%}
{{relative_time}}
{%- endif %}
unit_of_measurement: "min"
entity_id:
- sensor.time
phone_battery:
friendly_name: 'Telefon batteri'
value_template: '{{ states.device_tracker.daniel.attributes.battery|float }}'
unit_of_measurement: "%"
entity_id:
- device_tracker.daniel
target_temp_stue:
value_template: '{{ states.climate.termostat_stue.attributes.temperature }}'
entity_id:
- climate.termostat_stue
mean_stue_temp:
friendly_name: 'Avg stue temp'
value_template: >
{% set sum = 0 %}
{% set num = 0 %}
{% for state in [states.sensor.temperature_158d000159c9d0, states.sensor.stue_temperature] %}
{%- if state.state !="unknown" and as_timestamp(now()) - as_timestamp(state.last_updated) < 300 -%}
{% set sum = sum + state.state|float %}
{% set num = num + 1|float %}
{%- endif %}
{%- if loop.last %}
{%- if states.sensor.stue_temperature.state !="unknown" and states.sensor.temperature_158d000159c9d0.state !="unknown" and (as_timestamp(now()) - as_timestamp(states.sensor.stue_temperature.last_updated) < 180) and (as_timestamp(now()) - as_timestamp(states.sensor.temperature_158d000159c9d0.last_updated)<180) -%}
{{ ((states.sensor.stue_temperature.state|float + states.sensor.temperature_158d000159c9d0.state|float)/2.0) | round(1)}}
{%- elif states.sensor.temperature_158d000159c9d0.state !="unknown" and as_timestamp(now()) - as_timestamp(states.sensor.temperature_158d000159c9d0.last_updated) < 180 -%}
{{ states.sensor.temperature_158d000159c9d0.state | round(1) }}
{%- elif states.sensor.stue_temperature.state !="unknown" and as_timestamp(now()) - as_timestamp(states.sensor.stue_temperature.last_updated) < 240 -%}
{{ states.sensor.stue_temperature.state }}
{%- elif num > 0 -%}
{{ (sum/num) | round(1) }}
{%- else -%}
{{ states.sensor.stue_temperature.state }}
{%- endif %}
{%- endif %}
{%- endfor -%}
unit_of_measurement: "°C"
entity_id:
- sensor.temperature_158d000159c9d0
- sensor.blomst_tv_temperature
- sensor.blomst_sofa_temperature
- sensor.blomst_bokhylle_temperature
- sensor.stue_temperature
- sensor.stue_tvbenk_temperature
mean_bad_fuktighet:
friendly_name: 'Bad fuktighet'
value_template: >
{%- if states.sensor.bad_humidity.state !="unknown" and states.sensor.humidity_158d000159f1af.state !="unknown" and (as_timestamp(now()) - as_timestamp(states.sensor.bad_humidity.last_updated) < 180) and (as_timestamp(now()) - as_timestamp(states.sensor.humidity_158d000159f1af.last_updated)<180) -%}
{{ ((states.sensor.bad_humidity.state|float + states.sensor.humidity_158d000159f1af.state|float)/2.0) | round(1)}}
{%- elif states.sensor.humidity_158d000159f1af.state !="unknown" and as_timestamp(now()) - as_timestamp(states.sensor.humidity_158d000159f1af.last_updated) < 180 -%}
{{ states.sensor.humidity_158d000159f1af.state|float| round(1) }}
{%- else -%}
{{ states.sensor.bad_humidity.state|float| round(1) }}
{%- endif %}
unit_of_measurement: "%"
entity_id:
- sensor.humidity_158d000159f1af
- sensor.bad_humidity
mean_bad_temp:
friendly_name: 'Bad temperatur'
value_template: >
{%- if states.sensor.bad_temperature.state !="unknown" and states.sensor.temperature_158d000159f1af.state !="unknown" and (as_timestamp(now()) - as_timestamp(states.sensor.bad_temperature.last_updated) < 180) and (as_timestamp(now()) - as_timestamp(states.sensor.temperature_158d000159f1af.last_updated)<180) -%}
{{ ((states.sensor.bad_temperature.state|float + states.sensor.temperature_158d000159f1af.state|float)/2.0) | round(1)}}
{%- elif states.sensor.temperature_158d000159f1af.state !="unknown" and (as_timestamp(now()) - as_timestamp(states.sensor.temperature_158d000159f1af.last_updated) < 180) -%}
{{ states.sensor.temperature_158d000159f1af.state|float| round(1) }}
{%- else -%}
{{ states.sensor.bad_temperature.state|float| round(1) }}
{%- endif %}
unit_of_measurement: "°C"
entity_id:
- sensor.temperature_158d000159f1af
- sensor.bad_temperature
mean_soverom_temp:
friendly_name: 'Soverom temperatur'
value_template: >
{%- if states.sensor.soverom_temperature.state !="unknown" and states.sensor.temperature_158d00012cb96c.state !="unknown" and (as_timestamp(now()) - as_timestamp(states.sensor.soverom_temperature.last_updated) < 180) and (as_timestamp(now()) - as_timestamp(states.sensor.temperature_158d00012cb96c.last_updated)<180) -%}
{{ ((states.sensor.soverom_temperature.state|float + states.sensor.temperature_158d00012cb96c.state|float)/2.0) | round(1)}}
{%- elif states.sensor.temperature_158d00012cb96c.state !="unknown" and (as_timestamp(now()) - as_timestamp(states.sensor.temperature_158d00012cb96c.last_updated) < 180) -%}
{{ states.sensor.temperature_158d00012cb96c.state|float| round(1) }}
{%- else -%}
{{ states.sensor.soverom_temperature.state|float| round(1) }}
{%- endif %}
unit_of_measurement: "°C"
entity_id:
- sensor.temperature_158d00012cb96c
- sensor.soverom_temperature
auroa_visibility_level:
value_template: '{{ states.binary_sensor.aurora_visibility.attributes.visibility_level }}'
unit_of_measurement: " "
entity_id:
- binary_sensor.aurora_visibility
# no_updates:
# friendly_name: 'No updates'
# value_template: >
# {% set val = "" %}
# {% for state in states.sensor%}
# {%- if as_timestamp(now()) - as_timestamp(state.last_updated) > 60*60*10-%}
# {% set val = val + state.entity_id + "\n" %}
# {%- endif %}
# {%- if loop.last %}
# {%- if val == "" -%}
# {{ False }}
# {%- else -%}
# {{ val }}
# {%- endif %}
# {%- endif %}
# {%- endfor-%}
- platform: time_date
display_options:
- 'time'
#- platform: broadlink
# scan_interval: 160
# update_interval: 160
# host: 192.168.1.173
# mac: 'B4:43:0D:D1:02:F7'
# name: "Stue_tvbenk"
# timeout: 10
# monitored_conditions:
# - temperature
# - humidity
# - air_quality
# - light
# - noise
#- platform: broadlink
# scan_interval: 160
# update_interval: 160
# host: 192.168.1.100
# mac: '34:EA:34:E4:6D:B0'
# name: "Stue_bokhylle"
# timeout: 10
# monitored_conditions:
# - temperature
- platform: brain_fm
email: !secret email
password: !secret brain_fm_password
# platform: tellstick
# 11: Kjoleskap
# 22: Blomst_stue
# 41: Ute_veranda
# 31: Ute_soverom
# 52: Soverom
# 61: Bad
# 71: Stue
# only_named: 1
# temperature_scale: °C
# datatype_mask: 127
- platform: miflora
update_interval: 900
mac: C4:7C:8D:61:7E:3B
name: Blomst tv
force_update: false
median: 3
monitored_conditions:
- moisture
# - light
# - temperature
# - conductivity
# - battery
- platform: miflora
update_interval: 912
mac: C4:7C:8D:61:7F:EC
name: Blomst sofa
force_update: false
median: 3
monitored_conditions:
- moisture
# - light
# - temperature
# - conductivity
# - battery
- platform: miflora
update_interval: 921
mac: C4:7C:8D:61:7E:5D
name: Blomst bokhylle
force_update: false
median: 3
monitored_conditions:
- moisture
# - light
# - temperature
# - conductivity
# - battery
- platform: dnsip
- platform: dnsip
hostname: server1.dahoiv.net
- platform: mqtt
name: "badevekt"
state_topic: "miscale/weight/kg"
value_template: "{{ value }}"
unit_of_measurement: "kg"
- platform: tibber
access_token: d610f070b55347ee7aa90ed51da8307612b55b77266247315a6fce2a6eaccf1a
- platform: spot_price
postal_code: 7033