zorax2 Posted May 27, 2014 Posted May 27, 2014 My goal is upon entry to my home (whether or not Elk is armed) is to turn on mudroom lights for 5 minutes at which time they should turn off. Currently, the lights do not turn off after 5 minutes. The natural progression is upon entry, the lights turn on as the entry door zone is violated. Next, the zone is violated again as the door is closed. This second zone violation may be causing me the problem with my program. My current program which does not work is: If Elk Zone 'Entry Door' is Violated Then Set 'Mudroom Light' On Wait 5 minutes Set 'Mudroom Light' Off I don't think the second violation (door closing) should do anything other than restart the program again enabling a 5 minute wait; however, I tested with a 10 second wait for opening and closing the door and the mudroom light still would not turn off. This program does work if the door is opened and not closed. For example, if I open the door and do not close it, the program will run as intended and turn off the light after the specified time. Again, it would seem that I must be doing something incorrectly as it regards to what happens after the door closes. I tried the forum search and couldn't find a post on this topic and hope someone can provide some guidance to get this program to work as intended.
LeeG Posted May 27, 2014 Posted May 27, 2014 When the door is closed it is no longer Violated. This triggers the Program with a False If which drives the Else. This would normally happen well before the Wait completes. The simple solution is to split into two Programs. The Then in the first Program invokes the second Program which has the current Then section. When the door closes and triggers the first Program Else it has no affect on the second Program.
Xathros Posted May 27, 2014 Posted May 27, 2014 I believe the Elk zone violation works much like a device status does. In this case, once the door closes and the zone is no longer violated, the program is re evaluated and runs the empty Else clause. The timer is never given a chance to expire. Here is the easy solution: If Elk Zone 'Entry Door' is Violated Then Set 'Mudroom Light' On Wait 5 minutes Set 'Mudroom Light' Off Else Wait 5 minutes Set 'Mudroom Light' Off This way, the lights will come on when the door is opened and will stay on for 5 minutes. If during those 5 minutes, the door is closed, then the else will run and the 5 minute delay in the else, then the lights will turn off. So, you may end up with longer than 5 minutes of light depending on how long you leave the door open. -Xathros EDIT: Or as Lee pointed out above, you can move your existing then to a second program. This would keep your delay at exactly 5 minutes regardless of how long you kept the door open.
zorax2 Posted May 27, 2014 Author Posted May 27, 2014 Thank you very much! Everything now works as intended.
Recommended Posts
Archived
This topic is now archived and is closed to further replies.