Jump to content

Programming challenge


steveng57

Recommended Posts

Posted

Hi all,

 

Looking for some guidance on an odd programming thing I want to do with my ISY-99i.

 

I have a device that need to be on for 40 minute of every hour from 7 am to midnight, and on for 10 minutes of every hour from midnight to 7. What's the best way to do this?

 

Thanks

Steve

Posted

Use two Programs. This one covers one of the time slots. The second program would be the same approach with a different trigger time and shorter On to Off duration.

 

If

Time is 7:00:00AM

 

Then

Repeat 17 times

Set 'ICON Relay 1' On

Wait 40 minutes

Set 'ICON Relay 1' Off

Wait 20 minutes

 

Else

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

Posted

Alternatively

 

If
Time is from 7:00:00AM
to 12am (next day)

Then
Set 'ICON Relay 1' On
Wait 40 minutes 
Set 'ICON Relay 1' Off
Wait 20 minutes 
Repeat

Else
Set 'ICON Relay 1' On
Wait 10 minutes 
Set 'ICON Relay 1' Off
Wait 50 minutes
Repeat

Posted

oberkc

 

I like your single Program approach better. Keeps all the function in one Program.

 

Note that the Repeat goes before the statements to be repeated. Easier to see under the actual Admin Console as it indents the statements within the scope of the repeat loop.

Posted

Noted about the repeat. More correct, then:

 

If
Time is from 7:00:00AM
to 12am (next day)

Then
Repeat
Set 'ICON Relay 1' On
Wait 40 minutes 
Set 'ICON Relay 1' Off
Wait 20 minutes 

Else
Repeat
Set 'ICON Relay 1' On
Wait 10 minutes 
Set 'ICON Relay 1' Off
Wait 50 minutes

Posted

Very cool gang. Thanks for the tips.

 

Putting things into one program looks great, but need some understanding on how the programming model works on the ISY: if the 7 am to midnight program is run manually or by another program at 10 or 11 in the morning, are there two or more instance of the thing running at the same time, and therefor potentially multiple "timers" running turning things on and off. Or when the program is run, all previous running copies are killed/overridden by the last instance.

Posted
Very cool gang. Thanks for the tips.

 

Putting things into one program looks great, but need some understanding on how the programming model works on the ISY: if the 7 am to midnight program is run manually or by another program at 10 or 11 in the morning, are there two or more instance of the thing running at the same time, and therefor potentially multiple "timers" running turning things on and off. Or when the program is run, all previous running copies are killed/overridden by the last instance.

 

No, there can be only one instance. If you run this program from another program, it will be stopped and restarted, and run the then or else based on how you start it (runif, runthen or runelse).

 

Then, at 7am or 12am, program if clause will be reevaluated, and then or else will run accordingly.

 

Benoit

Guest
This topic is now closed to further replies.

×
×
  • Create New...