@toggledbits said in Feature Request - Wait for an event/trigger within Reaction:
As you disclose details, it's beginning to look like you've imagined a solution based on some other product, and you're trying to get Reactor to work its way, instead of doing it "the Reactor way."
That is very possible. I'm still mentally mapping this out too. And I 100% know that an image of my rule set would really help clear things up. I'm not in a position to get a screenshot at the moment. I'll try to put my thoughts in to text. (scary)
Rule set as of today:
Triggers:
After midnight AND
Before sunrise AND
Any Presence Sensor in the group changes from Not Present to Present
Actions:
Turn on the porch light
Turn on the driveway lights
Wait for a random period of time between 10-15 minutes
Turn off the porch light
Turn off the driveway lights
What I am after is within the Actions only. The Triggers are still the same.
Actions:
Turn on the porch light
Turn on the driveway lights
Wait until the HE Hub variable "lastDoorLockEvent" reports "Manually locked"
Wait for a random period of time between 10-15 minutes
Turn off the porch light
Turn off the driveway lights
The waiting until the hub variable is what's potentially causing the issue. When I go to bed, and assuming the door was open, I'll close it and lock it. So the hub variable now reports "Manually locked". If someone arrives after midnight and before sunrise, the variable will still report "Manually locked" since the lock status hasn't changed yet. So theoretically MSR won't wait since it already sees the variable as what it is looking for.
And as I type this out, I suppose I could insert a set variable into the actions. I honestly haven't looked yet, but can MSR set a variable that is local to the hub only? Not within MSR.
Actions:
Turn on the porch light
Turn on the driveway lights
Set HE Hub variable "lastDoorLockEvent" to "waiting entry"
Repeat Until the HE Hub variable "lastDoorLockEvent" reports "Manually locked"
Wait for a random period of time between 10-15 minutes
Turn off the porch light
Turn off the driveway lights
The entire concept stems from Hubitat's Rule Machine's "Wait for event" that you can define in a rule. I have a couple of these at my remote HE, where I can't run MSR easily.