I’m experiencing something weird.
Recently, I hacked an IKEA PM2.5 sensor by adding an ESP8266 and added it to HA via ESPHome.
So far so good. It works as expected.
Now, I tried to add a 24h average sensor for it. I installed Average Sensor from HACS and added the sensor to my HA config.yaml.
It came up and seems to work fine, but then I noticed this: During the time I was away from home, the sensor value went down to 10. Average was 70. The average should be dropping hard, but strangely enough, it stays sortoff stable. And then hours later, it starts dropping off hard, while the primary sensor value has remained relatively constant all that time.
Am I overseeing something? Or misunderstanding the use of the ‘Average Sensor’?
Thanks!
I think the problem is that when the value doesn’t change compared to the previous value, HA does not register it. And so, the average sensor also doesn’t register it.
So when the sensor value is stable @ 10ug/m3 for a couple hours, the average sensor only gets 1 value. So 5 hours of 10ug/m3 is being treated equally to 5 seconds of changing value.
I will ask about it on the integration page. Thanks.
Unless something has changed recently, I disagree.
The core integration does not take into account the time the state exists, just the number of state changes. The third party one does take time into account.
e.g. say you had a sensor that was 1.0 all day except for one state change to 0.0, the core integration gives this an average of 0.5, the third part one gives 0.999…