Iām wondering if this is possible or maybe something that can be considered on an update for RM.
I have several scenarios and comparisons which require to jump back and fort between several conditions. Right now, RM is linear in processing the instructions.
Is there a way to build a condition set, under a name that can be called out from the āmasterā rule?
My rules are extremely complex and long and itās difficult to follow a chain of conditions when the same thing repeats itself under a different step.
Iām thinking something like this
If a is true
FUNCTION1
If b is true
FUNCTION2
If c is true and var is 0
FUNCTION1
End if
and then somewhere within, one defines said functions
Iām currently McGyver-ing it with another rule per āfunctionā but that adds clutter.
Not that I can think of, but you would not be alone if you just ran one rule's action from another rule.
Alternatively, if you are getting this complex, it's possible you have some coding experience. In that case, keep in mind that you can write custom apps in Groovy for Hubitat (Rule Machine just exists so you don't have to and is quite powerful on its own, though was ultimately written using this same environment). The developer docs, particularly the app primers under "App Structure," would be a good starting point if you aren't sure how: Developer Documentation | Hubitat Documentation. Just another idea -- because there, of course, you can literally use methods (as Groovy calls what some other languages call functions).
I would aver that WebCoRE strikes a very good balance between the elegant modularity of coding (e.g. Groovy) at one extreme and the point-and-click ease and linearity of Rule Machine at the other.
WC's learning curve is modest, reliability and system integration very high, sporting a feature set that's fairly rich for having begun as a community app. That includes powerful conditionals like SWITCH and CASE. It has a wide install base of users.
WC gets my vote for operations of above-average complexity. For everything else, there's still RM.
I mean, "Run Rule Actions" basically is a function call. Create a rule with no triggers, name it something like "[Function] BlahBlah" and call it from other rules.
Alternatively, consider collapsing the other direction -- have your complex set of criteria turn on/off a virtual switch, and have other rules that react to the switch turning on/off.
Thatās how I am currently doing it with run rule actions
If youād see my Rule Machine, youād probably understand the clutter pain I have.
It does what i need as is. I was hoping that maybe there is a way of which iām not aware of, on nesting the trigger-less functions under the main one.
No way of making child rules, no. I think you could install a second Rule Machine instance to hold subordinate rules, though I don't see a way to rename the instances.