I am trying to make a repeated trash day reminder announcement, triggered on a certain day at a certain time. I want to stop the repeated announcement once the front door or either garage doors have been opened, making sure the trash was taken out. Below is my attempt, but it looks like it's not continuously monitoring the state of the contacts, like a while loop.
As an example, I have a Rule that does something like this - nags me until I open the door of the washer or dryer to take out the clothes. Written for me by @ogiewon some many moons ago when he felt sorry for me:
I actually use Event Engine for trash reminders, has a ton of flexibility and a little easier to create this type of automation...can't do a short/neat screen shot like w/Rule Machine, but this is a summary:
Rule 5.1 does have effectively a "while" loop now, but that's not what a while loop does. It checks the condition at the beginning of the repeat, then proceeds if it's true or skips past the "loop"/repeat if it's false. In order for this condition to be false, the contact sensors would have to be open at the time when the loop starts over again, which could be up to 10 minutes (in your rule) from when it happened.
So, that's the answer to the "why" part of your question. But since you want something that works, maybe one of the below suggestions will do what you want. Or, you could use "Wait for event" inside the repeat, maybe something like:
Repeat every 0:10:00 (stoppable)
Notify "Today is trash day. Pleaes take out the trash."
Wait for event: Sensor 1, Sensor 2, Sensor 3 opened
Stop Repeating Actions
END-REP
Here, you'll only reach the "Stop Repeating Actions" if one of the wait events happens. Otherwise, the repeat will just start over again. (I don't love how this piles up the list of things the rule is waiting for, but I don't see a good way to cancel those waits without canceling all timed actions, including the repeat...and this should be pretty harmless if you actually do open one of the sensors and fulfill the event it's waitng for within some reasonable time frame, even hours later. It only creates one subscription but does seem to pile up a list in an internal data structure until it happens, once for each repeat...)
Yep I didn't catch that, I have been using the while loop and didn't think about that. You basically would have to leave the door open in order for that to work.