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?
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.
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.
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?
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.