Motion Sensor (Security light) with latch

From Universal Devices, Inc. Wiki
Revision as of 04:36, 2 July 2013 by BitSmith (talk | contribs)
Jump to navigation Jump to search

DRAFT: EDITING RIGHT NOW, PLEASE CHECK BACK IN A FEW MINUTES...


As asked by CPRail1, how do we make a motion controlled light that can be latched on? http://forum.universal-devices.com/viewtopic.php?f=27&t=11795

Here's how. While there may be several ways to do this, first let's confirm a few things in the Motion Sensor, Item #2842-222. Note that this code can be similarly used with the Wireless Open/Close Sensor Item# 2843-222.


Settings; [x] Sensing Mode [ ] On Only Mode [x] Night mode

Jumpers; 1 [Open] 2 [Open] 3 [Open] 4 [Open] 5 [Closed] Remote management

First, I got mine working with a program. Motion Detection;

If
   Control  'Motion-Sensor' is switched On
Then
   Set Scene 'MotionResponder On
   Wait 10 seconds
   Set Scene 'MotionResponder Off
Else
   - No Actions - (To add one, press 'Action')

Now we'll break it up so that a variable (controlled by a button) determines whether the light stays or times out.

Here are the rules;

  • If person has moved into the area, the light will turn on.
  • If a switch is turned on when it is already on, stay on. To do this, set a variable [Ignore_Motion_Detection] to 1.
  • When the motion program times out, check the variable to see whether to leave the light on or not. Then reset the variable.

This takes three programs. One to watch the switch, one for motion startup rules and one for motion timeout rules.