I’m trying to use the filter integration on some rapidly reporting sensors to reduce the volume of data sent to a database. I still want the sensor to report rapidly so I can have the dashboard update close to real time.
The problem occurs when the coffee machine is turned off - after that point, the unfiltered sensor stops updating (because it isn’t changing, as it is always 0). However, from what I can see once that happens, the time_throttle filter never gets triggered, so it ‘sticks’ on whatever the last value it emitted happened to be - and never goes to 0. Am I doing something wrong here? How do I work around it?
This filter is relevant when you have a sensor which produces states at a very high-rate, which you might want to throttle down for storing or visualization purposes.
Yeah, the problem here is I have a high rate of change while the device is active, which I would like to filter, and then it goes to 0 and stays that way for a long period of time - and if that 0 gets dropped, it stays at the last value that got past the filter, which is kind of bad for doing statistics on.
In this particular case I suppose I want some way of exempting 0 values from being throttled, but that isn’t really a general solution.
Or alternatively have another thing which checks periodically if the unfiltered value is 0, and then updates the filtered value if it is.
It sends the moving average every 3 minutes unless there has been a significant change (delta is set just above the average noise floor) in which case it sends it immediately.