How to reset "Pulse" if triggered again

Long time vera user, new to Reactor - this is a great plugin and I certainly appreciate all the hard work that has gone into its development. I have been able to get most things working but one is stumping me. I need to start an activity 5 minutes after a door is opened so I made a condition for Tripped = 1
Pulse = 300

This will start a timer and perform the action 300 seconds after the door is tripped, however, if the door is opened again within that 300 seconds, I need to have the timer reset to 300 seconds but it seems to continue the original countdown. I have tried “Tripped” and “LastTrip” but can’t get the timer to reset.

Any pointers would be great and much appreciated.

Thanks

That’s not how pulse output mode is defined. Pulse output mode issues a fixed-width pulse starting when triggered, regardless of any changes to the underlying test. If the door closes during the pulse period, the pulse finishes on time (it’s not terminated early); if the door is still open when the pulse period expires, the pulse ends (it does not continue until the door closes). So that won’t get you where you are going.

You need to tell me a bit more about what you want it to do–you’re on the verge of an “X-Y problem” here. Do you really want to trigger 300 seconds after the door opens, or after it closes? If the former, what should happen if the door stays open the entire 5 minutes or more?

Thanks for the quick response - I appreciate that. I’ll see if I can describe my logic…
I’m using this in conjunction with the iPhone Locator to determine if anyone is home and then set the house mode.

I mute everyone’s phone if they are home and have been unmuted for 5 minutes. If the front door opens, I unmute all phones for 5 minutes in order to give them time to leave the geofence. If they are still “present” after the 5 minutes of the door opening, I mute their phone again. This is all in an attempt to save battery life by not polling when they are home.

I have two reactors, one to mute the phone and one to unmute -

the unmute condition is that their locator shows them outside the geofence or the door as opened in the last 5 minutes. (I am currently doing the 5 minute delay with a door trigger and a delay reset of 300 secs - but to your point, I don’t know what will happen if the door is open for more than 5 minutes (other than someone getting a whooping :slight_smile: ) The scenario for this would be that if half of the family goes out and gets in the car and we are waiting on one more, I don’t want the delay to end until after the last person comes out.

The mute reactor simply says if they are present and their phone is unmuted, the mute the phone.

I hope that all makes sense…

OK. I think I follow the intent.

You UNMUTE when the door is OPENED, immediately. That’s the easy part. Let’s move on…

To MUTE, a little more involved, but still not bad at all. First of all, the door rule is simply this: device state, door sensor, Tripped is FALSE, + option “sustained for” 300 seconds. When that condition goes true, the door has been closed for five minutes, and it’s time to re-mute those phones, but only for folks that aren’t home. That can be structured with groups, like this:

Root group - NUL (we don’t care about the tripped state of the ReactorSensor itself)

  • Group “Door Closed a While” - OR
    • Device State, door sensor, Tripped is FALSE + option “sustained for” 300
  • Group “Mute Mary’s Phone” - AND
    • Group State, this reactor sensor, “Door Closed a While” is TRUE
    • Device State, iPhone Locator, Mary is home
  • Group “Mute Jack’s Phone” - AND
    • Group State, this ReactorSensor, “Door Closed a While” is TRUE
    • Device State, iPhone Locator, Jack is home
  • Group “Mute Tommy’s Phone” - AND
    …etc…

See the pattern? I’ve defined a group called “Door Closed a While” that goes true when the door has been closed continuously for five minutes (it goes false immediately when the door is opened–you can use this fact!). Then, we create additional groups for each phone, checking the state of the phone in an AND group that also checks the state of that “Door Closed a While” group–if the person/phone is still home and the door has been closed long enough, the group goes true. You put your action on each of these groups “Mute zzz’s Phone is TRUE” activities to re-mute each phone individually.

The “Group State” condition lets us use the state of another group, basically making that rule re-usable. This is a simple rule, and you could code it directly on each Mute group, but that is less efficient and doesn’t demonstrate how you can make and re-use blocks of logic. Start early!

Now–for handling door opened. As soon as the door is opened, it just so happens that “Door Closed a While” will go false immediately, so as I said above, we can use that fact and simply put all of your unmute actions for all phones in the “Door Closed a While is FALSE” activity. You’ve now done everything you need to do in one ReactorSensor.

Note: The “sustained for”, by the way, will reset its timer if the door is opened during the wait for it to be closed long enough. That gives you that reset you were looking for. The “sustained for” and “delay reset” timers are resettable.

That makes perfect sense - That is real close to what I ended up with but I did trigger on opening the door and I think I did that because technically it is possible to open the door and leave without closing it but almost impossible to leave without opening the door. I’ll let it run for a while and see how it goes.

Thanks for the feedback.