KHouse Posted Monday at 04:29 PM Posted Monday at 04:29 PM (edited) Attached is a screenshot for what I would assume to be a very basic program that is not working for me. Appreciate any help anyone can give on what I am doing wrong here. If garage door sensor or motion sensor is activated, turn garage lights ON. Wait X number of minutes, then turn garage lights OFF. The door sensor and motion sensor are ELK, tied to the alarm, while the light switch is INSTEON. The lights do turn on when triggered...but they do not turn off. I must be missing something basic or not understanding how this work. Appreciate any help! Edited Monday at 04:30 PM by KHouse Quote
Solution apostolakisl Posted Monday at 05:17 PM Solution Posted Monday at 05:17 PM It is because the program is terminating when the motion sensor goes back to normal. Those are status conditions, they trigger whenever the status changes regardless of what it changes to. So when "violated" occurs, the program triggers, turns the lights on, and starts the timer. But the sensor will return to "normal" prior to one minute, the program will then stop and start over. But it will now be false, which runs the "else" clause, which is blank. To make this work, you either need to use "control" commands in the if clause since "control" commands only trigger on the precise action. Alternatively, you use two programs, the conditions are in the first program and the actions are in the second program. If elk thing 1 is violated or elk thing 2 is violated Then run then program 2 Pgm2 If (blank) Then turn light on wait 1 minute turn light off. 1 Quote
Guy Lavoie Posted Monday at 06:17 PM Posted Monday at 06:17 PM My preferred way of doing things like this, where the initial triggering condition will cease to be true, is to set a state variable, and then have a separate program look for the variable to become true, do the wait, turn off the light, and reset the variable. - So your first program would be If garage door is violated Or other trigger... Then Turn light on Then Variable garage_light = 1 - Second program If Variable garage_light = 1 Then Wait 1 minute Then Turn light off Then Variable garage_light = 0 1 Quote
KHouse Posted Monday at 06:30 PM Author Posted Monday at 06:30 PM Thank you both so much. I was racking my brain trying to think through the logic and figure out what I was missing. Didn't realize it returns to "normal" before the time is up and that is the root cause of the problem. Thank you again for the explanation and examples! Quote
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.