I first started by defining the IF TempVar1...THEN...ENDIF
Then I decided to insert an IF TempVar2... THEN...ENDIF before it to get something like this:
IF (Variable TempVar2(Off) != On TRUE) THEN
Set TempVar2 to 'Off'
ENDIF
IF (Variable TempVar1(Off) = Off TRUE) THEN
Set TempVar1 to 'On'
ENDIF
But the system won't allow it (it's not in the Action List).
But strangely, it allows me to add another "IF (condition) THEN" even though (according to the documentation on Rule 3.0) it's not allowed "IF-THEN-ELSE may not be nested".
I'm pretty sure that we should see an ENDIF instead of "IF (Condition) THEN" in this particular sequence
(This is a very simple example). The one I need to change is much bigger.
This is forcing me to rewrite everything after the "inserted" If/Then/Endif just because I want to
add a Conditional Action
P.S. If I do the same but there is no existing EndIf, I can insert the Conditional Action.
Correct, you can NOT have nested if-then-else.
I know, but it should allow us to add an EndIf instead of an another IF (Condition) then
Maybe I'm missing something but wouldn't allowing another EndIf endorse the idea of nested ifs? I have two If-Then and it works just fine. In the image above, it looks like you have two IF-Then statements (vs. a If (condition) THEN) which you can put in an If-Then.
As soon as you did that you broke this rule. You created a nested IF-THEN by inserting the IF-THEN before the other one. RM is not a compiler, it has limited smarts, and at that point this particular rule went off the rails. Suggest that you could have edited IF TempVar1 to TempVar2, and then added IF TempVar1 below that. All would have been fine.
I'm sure something is missing/wrong.
Look at what the system allow us to do:
I can add a bunch of "If (Condition) THEN" all over the place...but No ENDIF.
Please, Please, Please, add that action instead of the allowing us to do nested If (Condition) THEN.
This was just a example. The real rule I wanted to adjust is way more complicated but the same principle apply: I cannot insert an If/then/endif if another one exist after the one I want to insert.
You've already received your answer - nested IF THEN are not allowed. Just because the UI lets you incorrectly do it doesn't mean that it is supported. Consider it a UI bug and move on.
If your logic is getting that complicated, you should probably just go make a dedicated app instead of using RM...
I was just making a suggestion to improve the system.
Case closed
Gotcha, I misunderstood! No harm in making feature requests!!
Don't do this. You break the rule once you insert an IF-THEN before another IF-THEN.
I know that, that's why I'm just asking to be able to insert an ENDIF to "unbreak" the rule.
Maybe in Rule 3.1
You're way ahead of me, I can't even figure out how to add in the If, ElseIf and just the one Endif in my system. I'm much more used to programming with that type of logic but can't even figure out how to edit the rules I've put in. What am I missing here??? Is it browser dependent?
Don't know? Works fine in Chrome - I've built a dozen or so if-then, else-if, end-if rules.
I have been using Edge, Can't edit anything in there after it's created. Next up Firefox, Can edit in there but don't see how to add If Then Else types of logic. Will try Chrome.
Thanks
Should work in Firefox, too...
This is actually a bug. It's fixed, will be in the next release.
1 Like
So I was not crazy after all, something "was" missing
I know you guys are full busy, but any idea when the fix will be released?
Thanks!!!
Another question or 3, if I may:
When I see "Staff" besides your name, does that mean you are one of Hubitat creators/developers?
How many are you and is this system open source (or will it be someday)?
Bruce is the developer of Rule Manager and Button Controller
and likely other HE built-in apps.
Yes all "staff" users are either developers or support (employees) of HE.
I doubt highly that HE will ever be open-source (unless the day comes when "pigs fly" ) but I don't have any insider info so who knows.
1 Like
I believe as prolific as he seems there are several people using the @bravenel avatar. If you look at the time stamps of several of his posts I don't think he sleeps!
3 Likes