It is not really clear to me where you want to go with it, but if you want a way to make a more generic rule, you might be interested to read up on how to trigger behaviors over rules using groups:
Edit: Updates for OH 4, inclusion of JS Scripting and Blockly examples, removed the doors example as it’s superfluous.
Please see Design Pattern: What is a Design Pattern and How Do I Use Them for how to read and use DPs.
Problem Statement
One powerful way to consolidate code in rules is to use array/list manipulation operations on the members of a Group. For example, filter down to just those members that are ON, get a list of the labels of those Items that are NULL, etc.
Concept
[image]
T…
There is now a Rule Template on the marketplace to implement this for you. See below for instructions on how to set it up.
Please see Design Pattern: What is a Design Pattern and How Do I Use Them for a description of what Design Patterns are and how to use them.
Problem Statement
Many sensors report status to openHAB periodically (e.g. temperature sensor) or unpredictably (e.g. motion sensors) and a subset of these sensors do not have a built in way for openHAB to query whether or not they a…
1 Like