https://github.com/openhab/openhab-addons/pull/17362
- Improve the conditions flexibility so that any type of operand can be on either side of the operator, e.g.:
ItemName > 10and10 < ItemName - Add support for functions:
$DELTAto represent the absolute difference between the incoming value and the previously accepted value.$AVERAGE, or$AVGto represent the average of the previous incoming values, excluding the incoming value.$STDDEVto represent the population standard deviation of the previous unfiltered incoming values.$MEDIANto represent the median value of the previous incoming values.$MINto represent the minimum value of the previous incoming values.$MAXto represent the maximum value of the previous incoming values.
By default, 5 samples of the previous values are kept.
This can be customized by specifying the “window size” or sample count applicable to the function, e.g.$MEDIAN(10)will return the median of the last 10 values.
All the functions except$DELTAsupport a custom window size.
Example:
Filter out incoming data with very small difference from the previous one:
Number:Power PowerUsage {
channel="mybinding:mything:mychannel" [
profile="basic-profiles:state-filter",
conditions="$DELTA > 10 W"
]
}