Hi
I have an:
- Sonoff TH16 Temperature and Humidity sensor
- An Template sensor over last (1) for accuracy setting if needed
- An Filter sensor over last (2) for low/high pass
What I am wanting to do is have statistical sensors defined on the filter sensor (3) to be able to save the minimum/maximum/average values according to different time values.
The problem is that in the statistics, when using the filter sensor (3), I ALWAYS receive “unavailable”.
But if I use the template sensor (2) in the statistics, I immediately begin to have values and they adjust correctly.
My question is enlarged because I have correctly saved the history on the filter (3) since I can use the statistics card on that sensor in lovelace.
I have followed all the new settings defined in: Statistics - Home Assistant
Any idea if it can or am I doing something wrong? It’s Possible to do?
Thanks
Example:
(1)
sonoff:
sensor: sonoff_123456789
(2)
template:
- sensor:
- name: humidity_th16
unique_id: hum1
device_class: humidity
state_class: measurement
unit_of_measurement: '%'
state: >
{{ (states('sensor.sonoff_123456789_humidity')|float(0)*0.98)|round(1) }}
sensor:
(3)
- platform: filter
name: "FHum1"
entity_id: sensor.hum1
filters:
- filter: lowpass
time_constant: 20
precision: 1
(4.a) DON'T WORK
- platform: statistics
name: "MAX FHum1 for 24 hours"
entity_id: sensor.fhum1
state_characteristic: value_max
max_age:
hours: 24
sampling_size: 200
precision: 1
(4.b) WORK OK
- platform: statistics
name: "MAX Hum1 for 24 hours"
entity_id: sensor.hum1
state_characteristic: value_max
max_age:
hours: 24
sampling_size: 200
precision: 1