Question about triggering a rule while it is already running

I'm having an issue with a rule I have to control the bathroom light and humidity.

This rule never seems to complete. Looking through the logs it seems when the door opens a second time it kicks off the rule again sees the light is on and ends, which I expected, but also stops the previous rule from completing.
So basically what my question is am I correct I thinking there can only be one instance of a rule running?


Multiple instances are certainly possible, and I've discovered, can cause issues.

I suspect that you need to move the first END-IF to down below the second END-IF, but I could be wrong.

I think my logic is right there. its deciding whether i am staying in the bathroom or just nipping in to put something away.

I'm glad that is the case.

You don't have any timeouts on the waits, are you sure they are not just still waiting? You can click the gear icon in the rule and scroll to the bottom of that page and it will show any pending waits.

My understanding is the waits should not be canceled by a new trigger unless you specifically cancel the waits.

1 Like

You might be correcting me, I looked and there is a specific cancel waits in RM so that is how I thought it worked. I might be wrong.

Apparently you are right. I just made a little test, see rule below, and if I re-trigger the rule the wait is canceled. Also to show how much I know, the wait is not listed on the app status page as I had thought. So the OP can disregard anything I said in this thread.

Note:The rule below shows wait for event, but wait for condition does the same thing.

1 Like

Indeed, there can be multiple instances of the rule, but in your case that wait for event door open is stopped when the rule triggers again.
When it stops, the whole rule exits.
Then when it retriggers, it skips because of your initial if.
I wonder if just removing that first if wouldn't be enough to solve your issue?

I think my solution will be to trigger another rule to do the waiting to turn things off.

1 Like

I think I would, the reason for the if is because I am using a switchbot to switch the light.

But does the switch bot change it if you send the on command twice?

it tries to switch it again but does not flip the switch as its the the expected state. It just wastes battery life.

Thanks, @terminal3 and everyone for the help.
It's all working now after moving the turn off login into a separate rule which is called from the first.

1 Like