View Full Version : Using Flow control or simple timer?
jonrigg68
May 7th, 2007, 10:24 AM
I am trying to put a delay in before an action but using either wait in "Flow control" or "Simple timer" seems to stop all other events being monitored until after the delay!
What I am trying to do is use a motion sensor within my kids playroom to change the state of equipment, on motion it turns the AV on and plays a wav, this works fine although I would like it only to play once and not every time motion is detected. The main problem is turning off as I want the AV to turn to "tape" then after 3 minutes if no further motion is sensed to play a goodbye message and turn everything off!
What happens is the tree follows through but if motion is sensed during the delay it still turns off then turns back on after....
is there a way to use timers without it putting the whole system into wait"
quixote
May 7th, 2007, 10:41 AM
use simpletimer. It won't stop any other processes. Just set up a macro that runs at the same time that the timer is started and disable that macro with the last command in the macro, then set up another one that is executed once the timer is up that reenables everything.
jonrigg68
May 7th, 2007, 11:01 AM
when you say run a macro that starts at the same time as the timer, do you mean on the same event run a macro (lets say turn evrything off)?
Also how do disable a macro within a macro?
I have one macro that changes av input to "tape" the input of the pc, I then want another 3 mins later assuming no activity to play a wav and then turn everything off, I have set up all the macros - do I need to make aopther one?
in your post am I waiting for the timer to turn everything off - i.e. the macro I need "on timer" is "all off" wehereas On start it makes sure all is on?
quixote
May 7th, 2007, 12:41 PM
when you say run a macro that starts at the same time as the timer, do you mean on the same event run a macro (lets say turn evrything off)?
The Simple Timer has three Actions that it can execute; one on start, one on cancel, and one on completion. Start the series of actions by attaching the motion sensor event to the SimpleTimer, then point to the first macro as the the "on start" action.
Also how do disable a macro within a macro?
You can attach the disable event as the last action in the macro and point to the macro that it's included in.
I then want another 3 mins later assuming no activity to play a wav and then turn everything off, I have set up all the macros - do I need to make aopther one?
Point to your second macro in the last box of the simple timer. Don't forget to put an action to enable the macro that you had disabled when the timer was originally triggered. Don't disable the timer, because you'll want it to reset itself if motion is detected again.
Let me know if this is clear enough for you to figure out the rest.
jonrigg68
May 7th, 2007, 01:36 PM
You can attach the disable event as the last action in the macro and point to the macro that it's included in.
This is the bit I am struggling with - where do I find the action "disable event"?
Point to your second macro in the last box of the simple timer. Don't forget to put an action to enable the macro that you had disabled when the timer was originally triggered. Don't disable the timer, because you'll want it to reset itself if motion is detected again.
Again where is the "enable event"
Let me know if this is clear enough for you to figure out the rest.
hopefully opnce I get the disable and enable sorted I am there!
thanks
quixote
May 7th, 2007, 02:06 PM
They are called Enable Group/Action and Disable Group Action.
If you are in the expert view, you'll find them in the Girder Actions folder on the left of the interface.
jonrigg68
May 7th, 2007, 03:14 PM
ok cool so if I have it right I do the following:
1. motion is detected start simple timer with say timout of 20 mins
2. On start run macro " turn everything on", this macro should also contain a disable "turn everything off" action
3. On timer Run Macro with enable "turn everything off" action! followed by the macro "turn everything off"
This will mean everytime motion is deteceted the clock will start counting down from 20 mins... only it will need to get to 20 mins without activity to action this!
is this correct???
quixote
May 7th, 2007, 03:24 PM
Well, you almost got it.
The "Turn everything ON" macro should actually disable itself, not the "turn everything OFF" macro, and the Turn everything off macro should re-enable it. This way you won't keep sending the signals to turn on your equipment and play the wav file everytime motion is detected, but the timer will be able to keep being triggered by motion, thereby resetting itself. Once the appropriate amount of time has elapsed the timer triggers the turn everything off macro and that macro resets the turn everything on macro (re-enables it) so that the next time someone walks in everything is ready to go again.
jonrigg68
May 7th, 2007, 03:30 PM
I think I got it!
only question is the timer will reset itself each time motion is detected? Playing around earlier I found it ran multiple commands that were on "Timer"
thanks for your help am getting there ..... slowly but surely!
quixote
May 7th, 2007, 03:35 PM
The timer will reset itself as long as you have the motion sensor event attached to it.
Glad I can help you get started. A lot of people have helped me out a lot over the years here. I have a lot of karma to work off.
jonrigg68
May 7th, 2007, 04:19 PM
thanks
seems to be working great, although having a few teething probs with IR commands when using timers.... not sure my av reciever is getting a bit stressed with all the commands being sent to it...
thanks again
Powered by vBulletin® Version 4.2.0 Copyright © 2013 vBulletin Solutions, Inc. All rights reserved.