[] Why does Rule stop after While loop is complete?

I cannot figure out why this rule wont run to completion. I think the only time it did was when the while loop was false. If the loop remains true the rule stops running as soon as the loop is over.

If the while loop is false then the rest of the rule will run

This is not really an answer as to why it is happening, but --

Have you tried it with the IF-THEN inside the loop? (Move END-REP to the end)

Tried using two sequential IF-THENs with a delay in the middle instead of the loop?

Any particular reason why you need the loop logic to Refresh? (Is there a downside to refreshing no matter what the states are?)

It’s unnecessary is the down side. If the light is flipped on and the bulbs are reachable there is no need to refresh.

There are a bunch of other ways I could work around this I am sure. But to me this is broken unless someone can convince me otherwise. Broken should be fixed, not worked around.

@bravenel is this normal behavior or a possible bug? I originally thought before I posted this that somehow I mucked up my rule when editing it, so I rebuilt it from scratch and the same thing happened.

I will look into it. Seems at first blush to be a bug.


I found this bug! Ha, that was nasty and subtle. Fix coming...


Call you Mr. Orkin? :slight_smile:

1 Like

If anyone has any ideas to make this rule a different (maybe better) way I am open to suggestions. I had a very simple wait for expression before but it had a 3 minute delay and also with the changes to CoCoHue using the event API I set my poll to 5 minutes so I dont think it was working right either.

Basically, if the bulb group is ON and the two bulbs are both reachable = false (power cut via switch), I want to turn the group off. Sometimes the bulbs do go unreachable for no reason and then come back, which is why I have the refresh in there.

I wonder if a required expressions with all 3 variables, cancel if false, and the rule is set to run every minute, refresh 3 times then turn off. That might just be cleaner and work.

UPDATE: This works. Will have to decide which one to keep.

Was this fixed in one of the hotfix versions and just not noted in the revision history?

1 Like

I believe it was fixed.