Jump to content

How to Trigger a scheduled program to run overnight


rayg

Recommended Posts

Hello, I want to schedule the occasional "pond fill" for 3 hours staring at 3am but on demand.  

Google searches failed.

Q1: Is my only recourse a program to set a variable to true and after PondFill execution back to false?   

Something like this?:

If $OvernightPondFill = 1 and Time is 3:00:00 AM

THEN 

  Run program PondFill3Hours (THEN)

  Set $OvernightPndFill = 0

ELSE

 

Q2: is there a difference between a State or Integer variable when it comes to this?   I'm not clear on that.

 

Thanks for your help

...Ray

 

 

Link to comment
On 5/25/2021 at 3:11 PM, rayg said:

Hello, I want to schedule the occasional "pond fill" for 3 hours staring at 3am but on demand.  

Google searches failed.

Q1: Is my only recourse a program to set a variable to true and after PondFill execution back to false?   

Something like this?:

If $OvernightPondFill = 1 and Time is 3:00:00 AM

THEN 

  Run program PondFill3Hours (THEN)

  Set $OvernightPndFill = 0

ELSE

 

Q2: is there a difference between a State or Integer variable when it comes to this?   I'm not clear on that.

 

Thanks for your help

...Ray

 

 

Looks good to me. In this case an Integer or a State variable would work. I prefer the Integer variable as they take any evaluation time from the ISY logic engine and you are not trying to trigger your program from the variable. Most mark State Variables with an 's' prefix. This is to avoid confusion later. You can also mark your Integer variables with a prefix 'i' but I don't bother with marking Integer types.

Personally I would reset the variable at the end of the program PondFill3Hours program and I like to run (If) so I can introduce more options for the run.
eg: If time 6-9 PM run Then (6 hours of time) Else (3 hours of time). Disable the program so no triggers can disrupt it then.

Install some recovery program lines in case power fails or you reboot ISY in the middle of the run cycle.

Enable "Run at Startup" in the program summary

If
    Time is 3:00:00 AM
    AND
    $OvernightPondFill = 1
THEN 
    Run program PondFill3Hours (IF)

Else  <-------------------------- this will always run when Run at Startup triggers because 3:00 AM will always be False
    Set $OvernightPndFill = 0    <-------------pretend cycle was completed  (optional)
   Stop PondFill3Hours  <----------------just in case it self ran??
   set PumpOrValve Off  <----------------may have been left on, will short any running cycle though

 

 

Link to comment

Sorry for the late reply Larry, I thought I posted a thank you on Tuesday but don't see it here. 

Thanks very much for the reply, I implemented all that you suggested the next morning and look forward to testing overnight soon.

...Ray

Link to comment

Archived

This topic is now archived and is closed to further replies.


×
×
  • Create New...