wrique Posted May 28, 2017 Posted May 28, 2017 I have a 2842-222 motion sensor controlling my backyard floodlights through a 2476S switch. Its options are: Timeout - 3.0 minutes LED Brightness - 100 Darkness Sensitivity - 128 Sensing mode - As motion is sensed (checked) LED On - checked On commands only - unchecked Night only mode - checked The desire is to - 1) Turn on the lights for 3 minutes if there is motion 2) If the user turns on the light with the switch (instead of the motion sensor), let them leave it on as long as possible (don't timeout) 3) They can always turn off the light with the switch 1) and 2) work fine, but 3) does not. If motion turns on the light and you try to turn it off with the switch before the 3 minutes is up, the light turns back on. Here are the 2 programs: "Turn on backyard floodlights when there is motion" If Status 'Back porch motion-Sensor' is On And Status 'Backyard flood lights' is Off And From Sunset To Sunrise (next day) Then Set 'Backyard flood lights' On $backyard_motion = 1 "Turn off backyard floodlights when motion stops" If Status 'Back porch motion-Sensor' is Off And $backyard_motion is 1 And From Sunset To Sunrise (next day) Then Set 'Backyard flood lights' Off $backyard_motion = 0 Any ideas why the light turns itself back on?
larryllix Posted May 28, 2017 Posted May 28, 2017 (edited) First program. Change first line to Switched On Get rid of second status line. It is causing the problem and doesn't serve any purpose. When you turn the light On/Off it causes the first program logic to run again and execute Then or Else. Most of us disable the MS off command and let ISY decide when to turn the lights off. It reduces Insteon traffic and stops erroneous and unexpected things from happenning. Many disable the MS night time only and let ISY decide when the lights are needed. Edited May 28, 2017 by larryllix
oberkc Posted May 28, 2017 Posted May 28, 2017 To larryllix' accurate observations, I add: - get rid of first condition (Status 'Back porch motion-Sensor' is Off) from second program. If the motion sensor fires, you want this program to run, regardless. Neither do you want this program to trigger itself at each change of status. -get rid of third condition from second program. The first program is already constrained by this time period, and will only call it between those times. Neither do you want this program to trigger itself at sunset and sunrise. Also, in this case, there is no value to using a variable here. Instead, you can simply call the second program from the first, at the correct moment.
larryllix Posted May 28, 2017 Posted May 28, 2017 (edited) OK, one more go at it. This is a pretty standard procedure people use. "Turn on backyard floodlights when there is motion" If Status Control 'Back porch motion-Sensor' is Switched On And Status 'Backyard flood lights' is Off And From Sunset To Sunrise (next day) Then Set 'Backyard flood lights' On $backyard_motion = 1 Wait X minutes Set 'Backyard flood lights' Off Else Set 'Backyard flood lights' Off "Turn off backyard floodlights when motion stops" If Status 'Back porch motion-Sensor' is Off And $backyard_motion is 1 And From Sunset To Sunrise (next day) Then Set 'Backyard flood lights' Off $backyard_motion = 0 Using Control Switched, and getting rid of the Off command inside the MS is the usual method. The program, seeing the switched on will retrigger the Then section and also the Wait X hours. The Else section was added to catch the "Until sunrise", just in case the Wait X hours timer ever failed to turn the lights off. It's a backup control, saving potential energy waste. Now for your manual override, there are established methods to do this but with this - You can turn on the light from the switch - You can turn off the light from the switch. However, if you turn on the light from the switch during the night time frame the MS can still activate the program and turn the light off again. For the manual override (just a clue for you) think this way ... - Capture the On in a program and use Disable program "Turn on backyard floodlights when there is motion" - Capture the Off in a program and use Enable program "Turn on backyard floodlights when there is motion" Edited May 28, 2017 by larryllix
wrique Posted June 3, 2017 Author Posted June 3, 2017 Thanks so much, guys. I got it working great with your help! 1
Recommended Posts