Skip to content

Commit d0bac82

Browse files
authored
[basicprofiles] Fix StateFilterProfile to use linked Item system unit (openhab#18144)
* [basicprofiles] Improve StateFilterProfile unit based calculations Signed-off-by: Andrew Fiddian-Green <[email protected]>
1 parent 3b820ed commit d0bac82

File tree

3 files changed

+439
-181
lines changed

3 files changed

+439
-181
lines changed

bundles/org.openhab.transform.basicprofiles/README.md

+4
Original file line numberDiff line numberDiff line change
@@ -242,6 +242,10 @@ The `LHS_OPERAND` and the `RHS_OPERAND` can be either one of these:
242242
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.
243243
All the functions except `$DELTA` support a custom window size.
244244

245+
In the case of comparisons and calculations involving `QuantityType` values, all the values are converted to the Unit of the linked Item before the calculation and/or comparison is done.
246+
Note: if the binding sends a value that cannot be converted to the Unit of the linked Item, then that value is excluded.
247+
e.g. if the linked item has a Unit of `Units.METRE` and the binding sends a value of `Units.CELSIUS` then the value is ignored.
248+
245249
The state of one item can be compared against the state of another item by having item names on both sides of the comparison, e.g.: `Item1 > Item2`.
246250
When `LHS_OPERAND` is omitted, e.g. `> 10, < 100`, the comparisons are applied against the input data from the binding.
247251
The `RHS_OPERAND` can be any of the valid values listed above.

0 commit comments

Comments
 (0)