Jump to content

Noob programming question


Hydroid

Recommended Posts

I'll state right off the bat that I'm new to the ISY-994i....

 

I'm trying to get a lamp to cycle on for and hour, then off for two hours, and then repeat, during the day between 8:00am and 10:00pm. Incase you're wondering, it's the lamp for a scentsy fragranced wax pot...

 

As a test, i came up with this program which I titled 'Test' to cycle the lamp on and off every 10 seconds - so I could watch it and not have to wait for hours. Then, I planned on just changing the 'wait' values to the desired time. The lamp is plugged into a 2635-222 On/Off Module titled 'Lamp'

 

Program - 'Test':

 

If

          From     08:00:00AM

          To         10:00:00PM (same day)

 

Then

          Set  'Lamp'  On

          Wait 10 seconds

          Set  'Lamp'  Off

          Wait 10 seconds

          Run Program  'Test'  (If)

 

Else

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

 

 

I click 'Save changes' and then exit the Administrative Console, thinking that the lamp will start to cycle on then off every 10 seconds because it's about 1:00PM now which is within the 8AM to 10PM 'If" time, but nothing - the lamp remains off. I know the module is being seen by the ISY, because if I use the manual ON and OFF buttons from within the console, it does respond.

 

What am I missing?

 

Regards, John.

 

Link to comment

With a time range the Program is triggered twice based on time.  At 8 AM the Program is triggered and the If is True so the Then clause executes.

 

At 10 PM the Program is triggered and the If is False so the Else clause executes.

 

If triggered at other times the If is False (not 8 AM) so Else clause executes. - this is wrong

 

One approach follows ....

 

 

If

          From     08:00:00AM

          To         10:00:00PM (same day)

 

Then

         Repeat 16 times

              Set  'Lamp'  On

               Wait 1 hour

              Set  'Lamp'  Off

               Wait 2 hours

               Repeat 1 time  

        

Else

          Set  'Lamp'  Off

 

The second Repeat is necessary so second Wait has statement that follows.  Otherwise no 2 hour Wait

 

 

Your original Program and "test" Program are triggered at From and To times (as stated by jerlands and larryllix) and by Run (If) statement.  Either change "test" Program From time to a few minutes in the future or manually start execution.  Saving Program after 8 AM does not trigger Program.  Ending Admin Console has no affect. 

Link to comment

As jerlands stated above but I would do it with an internal loop.

 

Program - 'Test':

 

If

          From     08:00:00AM

          To         10:00:00PM (same day)

 

Then

          Repeat every 10 seconds <---this time is plus the internal Wait = 20 seconds

          Set  'Lamp'  On

          Wait 10 seconds

          Set  'Lamp'  Off

         

Else

          Set  'Lamp'  Off

Link to comment

My comment about a False evaluation in my previous post was wrong. 

 

Thanks larryllix for pointing out that mistake!

 

 

Your original Program and "test" Program are triggered at From and To times (as stated by jerlands and larryllix) and by Run (If) statement.  Either change "test" Program From time to a few minutes in the future or manually start execution.  Saving Program after 8 AM does not trigger Program.  Ending Admin Console has no affect. 

Link to comment

Well there you go. I didn't know that the program only executes at the 'from' and 'to' times. As a test, I changed the from time to a few minutes into the future, saved the changes, and sure enough, it started cycling....

 

Also didn't know about the right clicking and running the various parts of the program...

 

Thanks very much for the help!

 

Regards, John.

Link to comment

Well there you go. I didn't know that the program only executes at the 'from' and 'to' times. As a test, I changed the from time to a few minutes into the future, saved the changes, and sure enough, it started cycling....

 

Also didn't know about the right clicking and running the various parts of the program...

 

Thanks very much for the help!

 

Regards, John.

The from-to construct only triggers program execution at the two times listed.

However as a condition the from-to construct works as a filter evaluating as True between the two times.

 

This can be dangerous as unsuspecting programmers using the from-to construct as a filter condition often get caught with the 'to' time clause executing the Else section of the program. Always keep this in mind when you use lines in the Else section with a time frame. Disabled programs do not have this behaviour.

 

You're on your way to designing some fancy stuff that will tickle your imagination. ISY forever!

Link to comment

Have you seen the negative reports about Scentsy and fires? If not please look into it. My neighbors wife had one catch on fire. Candles are also as you probably know a fire issue too.

 

There is also some debate about if they use petroleum in the wax or not which is toxic. Of course Scentsy denies using petroleum but wont release the ingredients. So IMHO its best to use an Air diffuser with natural oils to scent the air to be safe.

 

As always this is just an opinion and Im just stating this to help inform you. What you decide to do is none of my business.

Link to comment

Archived

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


×
×
  • Create New...