Dampen new values


I’d like to ask, if it would be possible to implement a profile which may dampen the incoming values before passing it down to the item linked.

For example, my DHT22 temperature and humidity sensors are pretty good at accuracy but struggle with resolution and fluctuate rather coarse:

I’d like to apply a profile with f.e. calculates the average between the current and the incoming value in order to smoothen the curve.

Also, if it would be possible with a profile, do you have a good hint where to start investigating to write such a profile?
And, if a profile is the wrong place, where would you apply such a logic for around 20 items :wink:

Thanks & regards

You might be getting different answers whether profile is right or not. From my point of view any basic calculation such yours which reduce use of “proxy items” is valid reason to consider a profile.
Given that you seem to use rrd persistence you may utilize threshold filter for persistence to reduce number of stored changes.

So far all threshold/hysteresis related profiles are oriented towards transforming numbers to on/off commands thus there is no out-of-the box solution I know to be working with your requirements.

Are you using an esp8266 or esp32? If so you could implement the filtering on the device perhaps? The esphome framework provides a good set of filters that are pretty useful and super easy to use.

I once did but find it also useful for people/situations where this is impossible due to the device at hand.

I’ll try my best in the time available to build such a transformation based on the regex transformation as a starting point. openhab-addons/bundles/org.openhab.transform.regex at main · openhab/openhab-addons · GitHub

Thank you