Routine with time delay as a trigger


#1

1) Give a description of the problem
Lack of knowledge.

2) What is the expected behaviour?
I have a piston that will turn on an inside light when someone comes home through the garage. I have a routine we run when we go to bed called goognight that shuts all the lights off and closes the garage door. If my Son were to come in after we had gone to bed some lights would come on(desired) he may stay up or may go to bed himself and invariably leave the lights on because like all teenagers he can only turn lights on.
what I want
If Goodnight routine has been run and there is no motion on motion detector 1 for 30 minutes then turn off selected lights.
Note Goodnight routine may be run on date 1 at 11:00pm and son may leave lights on at 1:00am the next day.

3) What is happening/not happening?
Nothing yet I am barely understanding the concepts but will continue to read and edit post with example if I think I am getting close
4) Post a Green Snapshot of the pistonimage
(UPLOAD YOUR IMAGE HERE)

5) Attach logs after turning logging level to Full
(PASTE YOUR LOGS HERE THEN HIGHLIGHT ALL OF THE LOGS AND CLICK ON THE </> ICON TO FORMAT THEM CORRECTLY)

REMOVE BELOW AFTER READING
If a solution is found for your question then please mark the post as the solution.


#2

Happy to help. Please build a piston of roughly what you want and then post a green shot here. Then there are many here who will help you with the finer details.


#3

Here is the way I would approach this:

  • In your Good Night Routine, add a new command to turn on a Simulated Switch (called Sleep?)
  • In your Good Morning Routine, add a new command to turn off that Simulated Switch.
  • In your Motion Sensor piston, add a new condition to check the status of the SimSwitch

Maybe something like this:

IF 
    Sensor's motion stays inactive for X min  <-- Trigger
    and
    SimSwitchSleep is on                      <-- Condition
Then
    Turn off selected lights
END IF

Pro Tip:

Using this method, you can also add that SimSwitch condition to ANY piston to check if you are sleeping or awake. For example, in my verbal alerts, most standard messages are NOT read out loud if I am asleep…


#4

So heres my start what I can’t seem to find is a way to add at time delay to the motion sensor IE: no motion for 20min. I am also wondering how to add an “only if goodnight was run withing the last 12 hours”(don’t have a good morning routine) statement to take care of overlapping dates.

Thanks


#5

I adjusted and used the “if my motion detector stays inactive for X minutes” trigger.(still having trouble with triggers VS conditions I have reread the link but apparently still not quite getting it)


#6
  • Triggers are precise moments in time, that are only true for a brief moment…
  • Conditions are vague, and can be true for hours at a time

Generally speaking, I want a precise trigger to begin the piston, and conditions to control the flow of the logic.


#7

Trigger “Door opens”
Condition “Door is open”
Thank you for clearing that up in a very concise way.


#8

Each device shows a different list, but the drop down comparison will always group (vague) conditions at the top, and (precise) triggers at the bottom.


#9

I have this one working although only once IE: routine has been run, someone turns on light, leaves room,…15 minutes later light goes off. If they re-enter the room after that turn on light and leave the light will not turn off.
Is there a way to monitor it like as long as it’s between X time and Y time and the routine has been run light goes off if there is no motion.


#10

You could do something along the lines of this

It is set to 30 seconds but can be changed to anything you want, minutes or even hours


#11

I don’t know if you saw my post, but this method works flawlessly…