Motion Sensor (Security light) with latch

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

As asked by CPRail1, how do we make a motion controlled light that can be latched on?

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.

[x] Sensing Mode
[ ] On Only Mode
[x] Night mode
Jumpers;  The only one that matters is #5
1 [Open]   Sensitivity
2 [Open]   Disable LED
3 [Open]   Night-Only mode
4 [Open]   On-Only mode
5 [Closed] Remote management

First, I got mine working with a program.

Motion Detection;


   Control  'Motion-Sensor' is switched On


   Set Scene 'MotionResponder On
   Wait 10 seconds
   Set Scene 'MotionResponder Off


   - 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.

First, make a variable "Ignore_Motion_Detection". Leave it zero, it will be modified under program control.

Program 1: Watch the switch


If    ;If switch is turned on WHILE the light is already on...

       Control 'Security Switch' is switched On
   And Status  'Security Switch' is not Off


   $Ignore_Motion_Detection = 1


   - No Actions - (To add one, press 'Action')

Program 2: Start motion activity

Motion Detection Entry;

If    ;What to do when motion is detected

       Control 'Security Switch' is switched On


   Set Scene 'Security Light' On
   Wait 3 minutes
   Run Program 'Motion Detection Exit' (If)


   - No Actions - (To add one, press 'Action')

Program 3: Start motion cleanup

Motion Detection Exit;


   $Ignore_Motion_Detection is 0


   Set Scene 'Security Light' Off

Else  ;Leave light on, but reset the flag so it turns off next time.
   $Ignore_Motion_Detection = 0

Please let me know if you find any anomalies or can improve functionality.

Cheers, --BitSmith (talk)

ISY-99i Series INSTEON : How-To Guide