Jump to content

Run programs each hour


jca001

Recommended Posts

I am new to the ISY99i so I may have just over looked what I am about to ask.

 

What is the best way to run a program or maybe even a group of programs once each hour no matter what?

 

The hours are only during the day. I know about sunup and sunset, which I may use.

 

I thought about creating directories like H0800 through H1700 and putting conditions on them to only be true for that hour. Then in the directory I would put the programs I want to run. The only thing is I would have to duplicate a lot of programs and if I decided something needed to be changed, I would have to make the changes in all the program. Or another though on this concept would to just have one program that called some common programs in another directory.

 

The reason I want to do something hourly is to turn off certain lights during the day if they get left on. Things like turning on the front porch light because it is dark early in the morning and forgetting to turn it off as I leave. Sometime the outside back light gets turn on by mistake because it is next to the garage light.

Link to comment

What is the best way to run a program or maybe even a group of programs once each hour no matter what?

 

Jack,

 

You can create a folder, add the 8 am time to it, then use the OR condition and add another line for 9 am, 10 am, and so forth, until you have:

 

 

If
       Time is  8:00:00AM
    Or Time is  9:00:00AM
    Or Time is 10:00:00AM
    Or Time is 11:00:00AM
    Or Time is 12:00:00PM
    Or Time is  1:00:00PM
    Or Time is  2:00:00PM
    Or Time is  3:00:00PM
    Or Time is  4:00:00PM
    Or Time is  5:00:00PM

Then
  Allow the programs in this folder to run.

 

With that in place, put the relevant programs in the folder, and you should be all set.

 

Chris

Link to comment

Thanks for the suggestion.

 

Here is what I tried, but it does not work for some reason. I created a folder called "Hourly 0900 to 1700" with:

 

If

Time is 9:00:00AM

Or Time is 10:32:00AM

Or Time is 11:00:00AM

Or Time is 12:00:00PM

Or Time is 1:00:00PM

Or Time is 2:00:00PM

Or Time is 3:00:00PM

Or Time is 4:00:00PM

Or Time is 5:00:00PM

 

Then

Allow the programs in this folder to run.

 

--------------

The time for 10:32 was for testing. It will be 10:00AM when I get this to work.

 

Then I added a program in the folder called "Turn Off Lights" with:

 

If

From Sunrise

To Sunset (same day)

 

Then

Set Scene 'Back Light' Off

Set Scene 'Front Porch' Off

Set Scene 'Living Room Light' On

Send Notification to All

 

Else

- No Actions - (To add one, press 'Action')

----------

 

Setting scene 'Living Room Light' On and send notification are just for testing. At first I did not have anything in the If section, but Program Summary showed a status of False for the program so I thought that was why it did not run. So I added the sunrise to sunset condition.

 

It did not run at the desired time. The Run Next time for the folder showed the 10:32 time and then after 10:32 updated to 11:00.

 

If I go to Program Summary and select the program and then select Run (If), it runs and does what I expected it to do.

 

So what am I missing in my logic or selecting the proper options?

 

This is on a ISY99i with 2.7.6.

Link to comment

You should just need to test whether the Folder is True to have the program run when the Folder becomes True.

 

If 
      Folder 'Hourly 0900 to 1700' is True
  And From Sunrise 
      To Sunset (same day) 

Then 
      Set Scene 'Back Light' Off 
      Set Scene 'Front Porch' Off 
      Set Scene 'Living Room Light' On 
      Send Notification to All 

Else 
      - No Actions - (To add one, press 'Action') 

Link to comment

Markens:

I'm pretty sure I saw a discussion recently that conditions on folders merely enable contained programs to evaluate their conditions, they don't cause them to be evaluated. So setting specific times on a folder probably won't do what you want, as you've seen.

 

I do have a condition in the program of between sunrise and sunset. So if the condition on the folder is met, then it should evaluate the condition of the program and run the then part. But it does not.

 

Before I set this up I did some testing of conditions on folders. It was not a scheduled condition, but a status of a RemoteLinc button. Then in the folder I put a couple of programs that ran if a button on a KeypadLinc was pressed.

 

In other words if RemoteLinc Button 6 was on and I pressed button 2 on the KeypadLinc turn on an ApplienceLinc. That worked. If RemoteLinc button 6 was off, then pressing button 2 on the KeypadLinc did nothing. It did what I expected it to do based on what I have read.

 

So the conditions are different but the concept is the same. If the status of the folder is true, then evaluate the condition in the programs and act accordingly.

Link to comment

Chris:

You should just need to test whether the Folder is True to have the program run when the Folder becomes True.

 

If 
      Folder 'Hourly 0900 to 1700' is True
  And From Sunrise 
      To Sunset (same day) 

Then 
      Set Scene 'Back Light' Off 
      Set Scene 'Front Porch' Off 
      Set Scene 'Living Room Light' On 
      Send Notification to All 

Else 
      - No Actions - (To add one, press 'Action') 

 

That defeats the purpose of putting programs in folders and then having a condition on the folder. The example you have given is just using the folder as a variable. My main reason for using a condition on a folder and then putting programs in the folder was to structure / organize the programs and allow me to make adjustments in one place and not several. The example I have provided is just the start of things I plan to do.

 

A program with no condition seems to always be false. I really should not have to have a condition in each program if the folder is controlling when the programs should run. There should be a condition of just true. But I can see that could cause some problems if the program was at the main level or the folder was always true, because there was no folder condition.

Link to comment

You still leave the program in the folder, it is just a means of running a program when the folder becomes true. Once you put that condition in the program, you still only have one place to make adjustments. The simple reason for doing it this way is to give the user the option having programs in the folder run or not when the folder condition becomes true.

Link to comment

Chris:

 

I read and re-read folder conditions and finally understand things better. Thou I don't completely agree with the concept that the program has to contain a test of the folder. This makes it so you can not just move a program from one folder to another without having to make changes to the program. If you don't then it will not work or it will run at the wrong time.

 

I think there needs to be a built-in test caller PARENT when you go to select the program and/or folder for the condition. Then if you copy or move the program to another folder it will not have to be changed,

Link to comment
Guest
This topic is now closed to further replies.

×
×
  • Create New...