-
-
Notifications
You must be signed in to change notification settings - Fork 429
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
Allow comparison operators in rules definition #4503
Comments
This is what the Rule Condition is for.
You have the option to test the state of Items (not just the triggering Item), time periods, ephemeris, or even write your own script. All comparisons are UoM aware. |
I absolutely agree with Rich, this is what conditions are for. |
Maybe in the UI, we can add a hint to use rule conditions for more complex comparisons? |
Depending on where this hint should be placed we would need to update some definitions in core, but I like the idea 👍 |
It could be as simple as adding to the description under Previous State and State something along the lines of: "For anything other than exact matches, add a rule condition." We can word smith it a bit but I don't know that we need anything more complicated than that. I don't know where that's defined though. While we are at it, does it make sense to add some more details to the main rule page? When Then But only if Adding these shouldn't mess with the size and layout of the rule page too much and I think it makes it much more clear what the three parts of the rule do. I'm often surprised at how many people simply don't know what conditions are or that they even exist. And we have a precident of including a description under most fields everywhere else in MianUI. Again, I'm not loving the wording but something to tell the user what the three sections of the rule do before they click through could help the new user in a hurry figure out what to do. |
Related to openhab#4503. Signed-off-by: Florian Hotze <[email protected]>
Related to openhab#4503. Signed-off-by: Florian Hotze <[email protected]>
Merged, but will take some time until it makes it into all the translations.... |
Sure 👍 |
Currently, it's only possible to check an item state being EQUAL to a given value, like in this example:
In this example, the value needs to be EQUAL zero so that the rule fires.
I'd like to suggest to introduce the opportunity of a comparison operator to add flexibility in the rule creation.
Means: It shoud be possible to use <, >, <> and = as additional parameter.
Example: When the combination is like "<" and 5 then the rule should fire every time when the item state is lower than 5.
Thank you!
The text was updated successfully, but these errors were encountered: