[Released] Rule 4.0

So then when the end if is needed? Before you mentioned is mandatory

IF THEN
    IF THEN
          actions
    ELSE
          more actions
    ENDIF
    yet more actions
ELSE 
     some alternate actions
END-IF

That last one could be left off, but not the one for the inner IF-THEN block if there are to be actions after it.

Kind of confusing when and when not. But if a end if is missing will it warn us?

No, that's not the issue in and of itself. Think of IF-THEN and END-IF as bookends that make a complete thing. Like parentheses must be a matched pair. You wouldn't write a sentence with a left parentheses and not the right one, and then have more words in the sentence -- how would you know which were parenthetical and which weren't? Plus, your English teacher would give you bad marks if you left off the closing parenthesis. IF-THEN and END-IF are like that.

It's bad form to leave off an END-IF.

2 Likes

Ok but I see that anyways the ifs will work without end ifs sometimes. I guess to be safe would be better to close an if with an end if. I have first to give a try. Thanks

1 Like

The hot fix release is out: Hub Update 2.1.2

This fixes the two bugs reported earlier.

I still have some too. On the advice of the master, I simply don't fix what isn't broken. Have to admit to being a bit apprehensive, despite understanding the conditional logic introduced in RM 3.0

As it turns out, it's not really difficult to wrap your head around at all. It just takes some adjustment away from old habits. I converted a few multi-rules into a single 4.0 rule and it all went well. I found a few just didn't make the situation any better to convert them, and some are just single conditions/actions that just would make no sense to spend my time converting.

I'm sure I'm going to screw up a few where I needed private boolean but didn't include it, but that's just part of learning.

Is this a bug? I created a rule, and it just had that first if-then-endif statement. Then I went back to modify it to add a couple of more doors, and that second IF statement appeared and I can't get rid of it without deleting the whole rule.

Hit Done with Conditional Action, and then you can delete that action.

There is a UI anomaly that I need to fix. See this:

In this circumstance, if you were to click on Done with Conditional Action before clicking on Done with Condition, it would leave the rule in a weird incomplete state. If you then open the actions again, it will likely misbehave.

The fix for this is that lower row of buttons should not be available until after Done with this Condition is clicked on. I can't be sure this is what happened to you, but it could be something like this.

Oh...That's The Manual I should have read :wink:

There's some weird editing stuff also. I have no friggin' idea how to fix this without starting over:

I want to insert something right after that AND operator, but I cannot seem to figure out how to do it.

@bravenel

I was trying to add a new conditional actions event to ensure my push notification happens every 10 mins until the contact is closed and get this error

It happened immediately after I added a Repeat every 10 mins after my If-Then

What am I doing wrong?
Rick

You want repeat after your notification. You can't repeat the time being between sunset and 5:30 AM

1 Like

It looks like you didn't complete your condition or backed out before adding one. If you go back in and edit that condition to add something, then you can delete it.

I'm trying to get a push if the garage door is open between sunset and 5:30am and repeat every 10 mins until it's closed

Same thing as requested by @didymus

I tried moving the repeat to after the notify and get the same error

Ricki

Bruce,

Is it possible for multiple lines of (separate and not conflicting) IF statements to be true and run simultaneously?

IF condition 1  (TRUE)
   IF sub-condition 1.1 (TRUE)
   THEN do action 1.1
   ELSE do action 1.2
   END-IF
IF condition 2 (FALSE)
   IF sub-condition 2.1 (TRUE)
   THEN do action 2.1 
   END-IF
IF condition 3 (TRUE)
   THEN do action 3.1
   ELSE do action 3.2
   END-IF

Will actions 1.1 and 3.1 be run by the rule, if the rule is triggered in some manner?

Edit: For anyone wondering, it will run multiple complex IF statements.

Bruce,

A request. Is it possible to have logging levels modified slightly? At present, it seems to be all or nothing (despite the 3 logging options). With Rule 4 (great job btw), it seems that we will be having larger and more complex rules. And I want logging only if there is a change. There is a LOT of skipped in the logs with logging enabled! A lot.

What I'd like is for anything that is skipped to not log, but for anything that is actioned/done to be logged. I tried actions but it includes skipped actions as well, and when I disabled actions, there was only the trigger in the logs. I thought events might work, but I dont think that logged anything in my particular rule.

Hi Bruce,
I'm converting (and consolidating into single rule) some RM 3.0 rules, but I noticed a strange thing, consider for example this case:

IF condition THEN
    action2
ELSE IF consition THEN
    action2
END IF

In Hubitat it's shown as

IF condition THEN
    action2
    ELSE IF consition THEN
        action2
END IF

Do I need instead to ADD END IF also before the ELSE? It shouldn't be needed because ELSE it's still related to the initial IF, isn't it?

IF condition THEN
    action2
END IF
ELSE IF consition THEN
        action2
END IF

Still don’t know how to select all motion sensors instead of any.