Jump to content

Help with a program that is not functioning as designed


oronomus

Recommended Posts

I am trying to build a program to turn off lights incrementally, after they are manually switched on.  An example of my program:

 

If

        Status  'Master Bath Toilet Light' > 61%

 

Then

        Wait  1 minute 

        Set 'Master Bath Can Lights' 60%

        Wait  1 minute 

        Set 'Master Bath Can Lights' 30%

        Wait  1 minute 

        Set 'Master Bath Can Lights' Off

 

Else

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

 
The program will execute the first action - setting the light to 60%.  But then nothing else happens and the light stays on at 60%.  Perhaps the "No Actions" in the Else command is stopping the program?  (i.e., status is less than 61%, so stop Then and execute Else?)  What is best way to fix this?
 
Log below shows device 2A.98.DB turned on at 3:29:15 and the program then set the lights to 60% at 3:30:15.  Then nothing else from that device or program.
 
Tue 09/02/2014 03:29:15 PM : [iNST-TX-I1  ] 02 62 2A 98 DB 0F 11 FF
Tue 09/02/2014 03:29:15 PM : [iNST-ACK    ] 02 62 2A.98.DB 0F 11 FF 06          LTONRR (FF)
Tue 09/02/2014 03:29:15 PM : [iNST-SRX    ] 02 50 2A.98.DB 23.98.2B 2B 11 FF    LTONRR (FF)
Tue 09/02/2014 03:29:15 PM : [std-Direct Ack] 2A.98.DB-->ISY/PLM Group=0, Max Hops=3, Hops Left=2
Tue 09/02/2014 03:29:15 PM : [D2D EVENT   ] Event [2A 98 DB 1] [sT] [255] uom=0 prec=-1
Tue 09/02/2014 03:29:15 PM : [  2A 98 DB 1]       ST 255
Tue 09/02/2014 03:29:15 PM : [D2D-CMP 003A] STS [2A 98 DB 1] ST op=5 Event(val=255 uom=0 prec=-1) >= Condition(val=155 uom=0 prec=-1) --> true
Tue 09/02/2014 03:30:15 PM : [iNST-TX-I1  ] 02 62 2A 98 DB 0F 11 99
Tue 09/02/2014 03:30:15 PM : [iNST-ACK    ] 02 62 2A.98.DB 0F 11 99 06          LTONRR (99)
Tue 09/02/2014 03:30:15 PM : [iNST-SRX    ] 02 50 2A.98.DB 23.98.2B 2B 11 99    LTONRR (99)
Tue 09/02/2014 03:30:15 PM : [std-Direct Ack] 2A.98.DB-->ISY/PLM Group=0, Max Hops=3, Hops Left=2
Tue 09/02/2014 03:30:15 PM : [D2D EVENT   ] Event [2A 98 DB 1] [sT] [153] uom=0 prec=-1
Tue 09/02/2014 03:30:15 PM : [  2A 98 DB 1]       ST 153
Tue 09/02/2014 03:30:15 PM : [D2D-CMP 003A] STS [2A 98 DB 1] ST op=5 Event(val=153 uom=0 prec=-1) >= Condition(val=155 uom=0 prec=-1) --> false
Tue 09/02/2014 03:32:17 PM : [iNST-SRX    ] 02 50 14.60.C9 23.98.2B 0B 6E 53           (53)
Tue 09/02/2014 03:32:17 PM : [std-Direct  ] 14.60.C9-->ISY/PLM Group=0, Max Hops=3, Hops Left=2
Tue 09/02/2014 03:32:17 PM : [D2D EVENT   ] Event [14 60 C9 1] [sT] [166] uom=0 prec=-1
Tue 09/02/2014 03:32:17 PM : [  14 60 C9 1]       ST 166

 

Link to comment

I assume that the can lights and toilet lights are different devices?

 

The lack of an ELSE statement is, in my estimation, not a factor here.

 

The first thing that comes to mind is that the toilet lights are changed to something below 61% while this program is executing, thus halting the execution during one of the wait statements.  Given your broader understanding of your system and use, is this a possibility?

Link to comment

It evaluates true when it is Greater than 61%.  Then, when set to 60% it is no longer true and thus stops.  You could call a separate program with No IF statement that does the 60, 30, off .  Any time the light was greater than 61% this would call the program to step it down.  If the switch was turned back on, it would reset the program and start again.

If

        Status  'Master Bath Toilet Light' > 61%

 

Then

        Wait  1 minute 

        Run Program 'Fade master toilet light' (then path)
 

Else

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

//Fade Master Toilet Light

If

        
  - No Conditions
 

Then

        Wait  1 minute 

        Set 'Master Bath Can Lights' 60%

        Wait  1 minute 

        Set 'Master Bath Can Lights' 30%

        Wait  1 minute 

        Set 'Master Bath Can Lights' Off

 

Else

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


Link to comment

I would get rid of the wait 1 minute in the first program.  It opens the possibility of the program getting terminated during that 1 minute and the second program never running.

 

Also, be aware that the way this is written, if you change the toilet light from any value above 61% to any other value above 61%, it will start the second program over again, or if you drop below 61% and then raise it back up.  That may or may not be something you want to happen.  If you want the second program to run all the way through, have it disable the first program as the first "then" line and the "enable" it again as the final line.

Link to comment

Archived

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


×
×
  • Create New...