lpollis Posted August 10, 2015 Posted August 10, 2015 Is there a way to use the Wait command with a variable? Instead of "Wait 15 Min" I want to "Wait Irrigation_Timer_Setting" where "Wait Irrigation_Timer_Setting" can be 5, 10, or 15 minutes? Lp
larryllix Posted August 10, 2015 Posted August 10, 2015 (edited) What unit would the variable specify? Seconds, minutes, hours, days or would the unit be specified separately, as it is now, and only the quantity be a variable? I would like to see all ISY settings using a parsing subroutine that accepts absolute immediate quantities or variables. Pulldown menus for analogue value condition matching would disappear from the whole interface. Edited August 10, 2015 by larryllix
randyth Posted August 10, 2015 Posted August 10, 2015 Maybe not exactly what you're looking for, but I use the following logic to "wait" for as many minutes as the state variable s_RackFanCoolTimer is set to. Because I use a state variable, this timer program is triggered by simply setting the variable to a positive value. If $s_RackFanCoolTimer > 0 Then Wait 1 minute $s_RackFanCoolTimer -= 1 Else Run Program 'Time is Up' (If)
Teken Posted August 11, 2015 Posted August 11, 2015 Maybe not exactly what you're looking for, but I use the following logic to "wait" for as many minutes as the state variable s_RackFanCoolTimer is set to. Because I use a state variable, this timer program is triggered by simply setting the variable to a positive value. If $s_RackFanCoolTimer > 0 Then Wait 1 minute $s_RackFanCoolTimer -= 1 Else Run Program 'Time is Up' (If) Randy, Could you provide the rest of the program code for review?
larryllix Posted August 11, 2015 Posted August 11, 2015 Just need to add your own "Program 'Time is Up' (If)"
Michel Kohanim Posted August 11, 2015 Posted August 11, 2015 Hello, This can be done in 5.0 (currently in alpha). With kind regards, Michel
randyth Posted August 11, 2015 Posted August 11, 2015 (edited) Just need to add your own "Program 'Time is Up' (If)" What I originally posted is one of three programs I use to run a fan that cools an equipment rack if it gets above a certain temperature (as determined by the variable i_RackFanTempLimit). These programs run the fan for at least five minutes and then continually add an additional minute if the rack hasn't decreased in temperature enough. I went ahead and posted all three programs below. @Michel, that's great about 5.0. It will be fun to streamline many of my programs with 5.0's new features. Cool Rack If $s_RackTemp >= $i_RackFanTempLimit And Status 'Rack / ZW 004 Rack Fan' is not On And $s_RackFanCoolTimer is 0 Then Set 'Rack / ZW 004 Rack Fan' On $s_RackFanCoolTimer = 5 Else - No Actions - (To add one, press 'Action') Cool Rack Delay If $s_RackFanCoolTimer > 0 Then Wait 1 minute $s_RackFanCoolTimer -= 1 Else Run Program 'Cool Rack Off' (If) Cool Rack Off - [Not Enabled] If $s_RackTemp < $i_RackFanTempLimit Then $s_RackFanCoolTimer = 0 Set 'Loft / ZW 004 Rack Fan' Off Else $s_RackFanCoolTimer = 1 Edited August 11, 2015 by randyth
randyth Posted August 11, 2015 Posted August 11, 2015 With this method, I can easily have custom triggers that turn the fan on for as much or as little time as I want. For example, I use the following program to turn on the fan for 30 minutes when I hit a button on a remote. (I'm often working around the rack and want the fan to stay on for a while to keep the human -- that's me -- cool). RackFan On If IR 'Up' is Pressed Then Set 'Rack / ZW 004 Rack Fan' On $s_RackFanCoolTimer = 30 Else - No Actions - (To add one, press 'Action')
Teken Posted August 11, 2015 Posted August 11, 2015 With this method, I can easily have custom triggers that turn the fan on for as much or as little time as I want. For example, I use the following program to turn on the fan for 30 minutes when I hit a button on a remote. (I'm often working around the rack and want the fan to stay on for a while to keep the human -- that's me -- cool). RackFan On If IR 'Up' is Pressed Then Set 'Rack / ZW 004 Rack Fan' On $s_RackFanCoolTimer = 30 Else - No Actions - (To add one, press 'Action') Randy, Thank you so very much for taking the time to share this with me and the forum members. This *Human* needs lots of cooling at the moment as its extremely hot where I am now. Thankfully, the home is super insulated as you can see the interior space is still 22'C when compared to the humid and hot 32.1'C which will rise to 36'C before the day is over. Keeping the home cool with out the aid of AC is hard sometimes when there are consecutive hot evenings and the humidity is off the charts.
larryllix Posted August 12, 2015 Posted August 12, 2015 What I originally posted is one of three programs I use to run a fan that cools an equipment rack if it gets above a certain temperature (as determined by the variable i_RackFanTempLimit). These programs run the fan for at least five minutes and then continually add an additional minute if the rack hasn't decreased in temperature enough. I went ahead and posted all three programs below. @Michel, that's great about 5.0. It will be fun to streamline many of my programs with 5.0's new features. Cool Rack If $s_RackTemp >= $i_RackFanTempLimit And Status 'Rack / ZW 004 Rack Fan' is not On And $s_RackFanCoolTimer is 0 Then Set 'Rack / ZW 004 Rack Fan' On $s_RackFanCoolTimer = 5 Else - No Actions - (To add one, press 'Action') Cool Rack Delay ..... If $s_RackTemp < $i_RackFanTempLimit .... Cool! I see you use what appears to be constants also. I denote them with a $c...... prefix for easy reading like this. I also use some programming language style by using all uppercase but it is very abrupt and not sure about that one. $s_RackTemp < $cRackFanTempLimit
randyth Posted August 12, 2015 Posted August 12, 2015 Yeah, RackFanTempLimit is a constant of sorts in the form of an ISY Integer variable so I can tweak it now and then based on how paranoid I am about how hot I can let the rack get versus how much energy I want to save by not running the fan as often (which is really silly of me, I know).
Teken Posted August 12, 2015 Posted August 12, 2015 Yeah, RackFanTempLimit is a constant of sorts in the form of an ISY Integer variable so I can tweak it now and then based on how paranoid I am about how hot I can let the rack get versus how much energy I want to save by not running the fan as often (which is really silly of me, I know). This really depends upon *Human* being comfortable now doesn't it. LOL . . .
randyth Posted August 12, 2015 Posted August 12, 2015 Of course! The human is the most important component.
Recommended Posts