jmed999 Posted October 11, 2012 Posted October 11, 2012 I'm having problems with my program below. It isn't only working after sunset and before sunrise. It works 24 hours per day....what do I have wrong? Do ISY programs follow the associative property like in algebra (the order of the and & or doesn't matter)? If Elk Zone 'Front Door' is Violated Or Elk Zone 'Garage Entry Dr' is Violated And From Sunset To Sunrise (next day) Then Set 'Insteon Bulb' Fast On Wait 2 minutes Set 'Insteon Bulb' Fast Off Else - No Actions - (To add one, press 'Action')
LeeG Posted October 11, 2012 Posted October 11, 2012 To achieve the effect, ANDing the time range with either of the other conditions, add the parens as follows If { Elk Zone 'Front Door' is Violated Or Elk Zone 'Garage Entry Dr' is Violated } And From Sunset To Sunrise (next day) Then Set 'Insteon Bulb' Fast On Wait 2 minutes Set 'Insteon Bulb' Fast Off Else - No Actions - (To add one, press 'Action') There is an order of precedence which is described in the Wiki EDIT: The original Program without parens is the same as coding If Elk Zone 'Front Door' is Violated Or { Elk Zone 'Garage Entry Dr' is Violated And From Sunset To Sunrise (next day) } Then Set 'Insteon Bulb' Fast On Wait 2 minutes Set 'Insteon Bulb' Fast Off Else - No Actions - (To add one, press 'Action')
jmed999 Posted October 11, 2012 Author Posted October 11, 2012 Ok...I now have... If From Sunset To Sunrise (next day) And ( Elk Zone 'Front Door' is Violated Or Elk Zone 'Garage Entry Dr' is Violated ) Then Set 'Insteon Bulb' Fast On Wait 2 minutes Set 'Insteon Bulb' Fast Off Else - No Actions - (To add one, press 'Action') It seems to be working correctly except it isn't turning off after 2 minutes of turning on. I want it to come on when the doors open the turn off 2 minutes later regardless of the doors being open or closed. Any ideas? Thanks!
LeeG Posted October 11, 2012 Posted October 11, 2012 The Elk zone is not staying violated. During the Wait the zone changes state causing the Program If section to be reevaluated to False driving the Else clause so statement(s) after the Wait are not executed.
apostolakisl Posted October 12, 2012 Posted October 12, 2012 Put the wait 2 minutes shut off light stuff in your else clause as well as your then clause.
kevkmartin Posted October 12, 2012 Posted October 12, 2012 The most reliable method would be to make a SECOND program with no if clause. The wait statement and the turn off would be the THEN clause of the second program. Have the THEN clause of the first program execute the THEN clause of the second program. Sent from my iPad using Tapatalk HD
apostolakisl Posted October 12, 2012 Posted October 12, 2012 The most reliable method would be to make a SECOND program with no if clause. The wait statement and the turn off would be the THEN clause of the second program. Have the THEN clause of the first program execute the THEN clause of the second program. Sent from my iPad using Tapatalk HD Actually both are equally reliable with subtle differences. Using the else clause restarts the timer when the door closes. Mostly an academic issue since exterior doors are usually not left open for long. But if you are carting a few things through the door it gives you the full 2 minutes of light once you are done and close the door. Using the else clause restarts the timer at sunrise if you happened to open/close the door within 2 minutes of sunrise. This will rarely come into play and shouldn't make any difference to anyone anyway. Using one program is a touch less confusing and saves space. But again not much difference.
jmed999 Posted October 12, 2012 Author Posted October 12, 2012 I'm now using the following program... If From Sunset To Sunrise (next day) And ( Elk Zone 'Front Door' is Violated Or Elk Zone 'Garage Entry Dr' is Violated ) Then Set 'Insteon Bulb' Fast On Wait 2 minutes Set 'Insteon Bulb' Fast Off Else Set 'Insteon Bulb' Fast On Wait 2 minutes Set 'Insteon Bulb' Fast Off The light still comes on before sunset. Today it came on at 4PM when I opened the door. It then turned off 2 minutes later. What am I doing wrong?
LeeG Posted October 12, 2012 Posted October 12, 2012 The Else clause should not turn the light On. Anytime the Elk zones are violated outside the desired time range the else clause runs turning the light On.
Recommended Posts