Jump to content

Setting "wait" in an ISY program to a variable


lpollis

Recommended Posts

Posted

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

Posted (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 by larryllix
Posted

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)
Posted

 

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?

Posted (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 by randyth
Posted

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')
Posted

 

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. 

post-1970-0-84360400-1439325952_thumb.png

post-1970-0-38837600-1439325963_thumb.png

post-1970-0-17819200-1439326092_thumb.png

Posted

 

 
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

Posted

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).

Posted

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 . . .

Guest
This topic is now closed to further replies.

×
×
  • Create New...