Jump to content

Trying to program a switch to cycle


Recommended Posts

I have been using Indigo on a Mac to control my many devices and wanted a stand alone box for a controller. The ISY994i seemed to be what I wanted but now I am having trouble with a couple of programming issues.


In this post I have a need to cycle a fan motor on for 30 minutes then off for 30 minutes between sunset and sunrise.


I am successful in doing that but it won't stop cycling for the rest of the day.


I am using AND statements, one to initially turn it on from sunset to sunrise (next day). Another AND statement to turn it on for thirty minutes after initial 60 minutes sunset on - else off. That works but it seems to ignore the AND statements of sunset to sunrise (next day) so I tried it from sunset to 11 pm and it still kept cycling after the limited AND period.


Not sure what else to try.



Link to comment

I think this will do what you want:


From Sunset to Sunrise (next day)



Repeat 30 times

fan on

wait 30 mins

fan off



Fan off


The Repeat 30 times accounts for up to 15 hours of darkness, but should get short circuited when the sunrise event occurs and runs the else clause to turn the fan off (it it was it was in an on cycle at the time)

Link to comment

Thanks for the help. It seems to be working with your suggestions. I also caught the needed line as I was looking at the script so I guess I'm beginning to understand the logic a little.


Been running for two days as expected.



Link to comment


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

  • Recently Browsing

    • No registered users viewing this page.
  • Forum Statistics

    • Total Topics
    • Total Posts
  • Create New...