-
-
Notifications
You must be signed in to change notification settings - Fork 3.6k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[basicprofiles] Fix inability to filter a percent QuantityType input #18091
base: main
Are you sure you want to change the base?
Conversation
This pull request has been mentioned on openHAB Community. There might be relevant details there: https://community.openhab.org/t/state-filter-range-filter-profile/158025/43 |
e31c9f6
to
d116107
Compare
Signed-off-by: Jimmy Tanagra <[email protected]>
d116107
to
402f179
Compare
Are you sure there is no better solution? To be clear I don’t have any 😀I suspect that it is counter intuitive for users to have a different declaration for this case. |
The other alternative I can think of is to remove the handy |
Let me sleep on it first... (literally). |
This pull request has been mentioned on openHAB Community. There might be relevant details there: https://community.openhab.org/t/state-filter-range-filter-profile/158025/55 |
This pull request has been mentioned on openHAB Community. There might be relevant details there: https://community.openhab.org/t/state-filter-range-filter-profile/158025/57 |
Normally to filter the values of QuantityType inputs, the conditions are written as
> min_value
, e.g.> 100 W
. However, when the QuantityType is a percent, writing it as> 10 %
caused the statefilter parser to think it's a $DELTA_PERCENT check instead of checking the actual input value.This is a bug and a problem, preventing the state filter from being used to filter a percent quantity type.
This PR fixes this problem by adding a new $INPUT function which can be used in this situation to help the parser, so the condition needs to be rewritten as
$INPUT > 10 %
to achieve "input-value-filter" instead of "delta-percent-filter".This should be backported to 4.3