How to time out or double up on a trigger


#1

So I’d like the following to happen.

Once “Bedtime routine” is ran, turn off a light 60 seconds after a motion sensor has been triggered OR after 5 minutes (in case the motion sensor doesn’t get triggered)

At the moment it switches off after the time out but not on the trigger. Please ignore the times being small, this is so I don’t have to wait 5 minutes each time I test!


#2

does the Bedtime routine, set a particular mode? Because the bedtime routine runs every 24 hours otherwise you would need to check how long ago the Bedtime routine was run, before taking these actions.


#3

The Bedtime routine doesn’t set a particular mode, nor does it run on a schedule.


#4

ok. so, this is just one time. as in:

  1. bedtime routine runs
  2. if no motion sensor trigger in 5 mins turn off lights
  3. if motion sensor trigger within 5 mins turn off lights 60 seconds after motion changes to inactive

these are all one time actions, not repeated till the bedtime routine runs again?


#5

Exactly what I’m after!


#6

try this:

EDIT: o yeah, remember to change the routine name. :slight_smile:


#7

Sorry for delay in replying.

That works great, I never considered doing two triggers, even though I use a very similar thing elsewhere with a recentlyArrivedHome variable.

At first I thought it was wrong because it resets on a second movement, but actually that makes so much more sense, and using changed to inactive is really clever. Thanks for your help!


#8

awesome!

thats my rule of thumb. if turning something on use changes to active and if turning something off use changes to inactive instead of playing around with TCP or TEP. :slight_smile:

you are welcome.