Monday at 07:51 PM1 day This plugin gives you interval timers, which allows programs to interact based on time intervals. This is more versatile than a Wait statement because the triggering condition doesn't have to stay true for the time interval to complete and move on to the next statment. Several programs can also interact based on the timer. Think of it as a State variable with a built-in clock. The rule is very simple: if the timer is set to any value other than 0, it increments once per second.A couple of examples to illustrate use:1- An Insteon motion sensor that is configured to send only On commands whenever motion is sensed (this is a programming option for the motion sensor), to allow retriggering the time interval as long as motion is sensed. Two programs are used:-Motion turns on light and starts timer:If Motion sensor is switched on (looks for control event)Then Turn on lightThen Timer_1 Start (timer start command sets/resets it to 1)-Timer reaches 60 seconds (or whatever value you want) without being retriggered by movement)If Timer Controller / Timer_1 Value > 60 (better to use > instead of =, in case the test doesn't occur exactly during the one second period when it reaches 61)Then Turn off lightThen Timer_1 Reset to 02- second example: a fancy bathroom fan timer that sets the fan run time (as a variable) to an initial 10 minute value, and allows you to add an extra 4 minutes twice (for a maximum of 18 minutes) by pressing the switch again up to twice more (generate additionnal control events). 4 programs are used:- Turn on fan and start timer.If Fan_switch is switched On (looks for control event)And Timer Controller / Timer_2 value is 0 (if first press, timer isn't running)Then s_fan_time = 600 (set desired time variable to 600 seonds)Then Timer_2 Start-Optionally add time with additionnal switch pressesIf Fan_switch is switched OnAnd Timer Controller / Timer_2 > 0 (if not first press...)And s_fan time < 1080 (and maximum 18 minute interval is not reached)Then s_fan_time += 240 (add 4 minutes)-If the timer reaches the desired durationIf Timer_2 Value > s_fan_time (better to use > instead of =, in case the test doesn't occur exactly during the one second period when it reaches the exact value)Then Set Timer_2 Reset to 0 (stop the timer)Then s_fan_time = 0 (reset the duration value to 0)Then Set Fan_switch Off (stop the fan)-If the switch is turn off manually, just stop the timer and reset duration valuesIf Fan_switch is switched OffThen Set Timer_2 Reset to 0 (stop the timer)Then s_fan_time = 0 (reset the duration value to 0)
Create an account or sign in to comment