ISY-99i/ISY-26 INSTEON:Using X-10 Motion Sensors

From Universal Devices, Inc. Wiki

Small, inexpensive motion sensors have long been a popular part of the X-10 world, and in the absense of an INSTEON equivalent, they are being put to good use in conjunction with ISY for control of INSTEON lighting. This article discusses the use of X-10 motion sensors with ISY, and provides examples of ISY programming for X-10.

The simplest such program would simply have ISY turn on an INSTEON light when an X-10 motion sensor's On command is received, and turn the light back off when the sensor's Off command is received (in this example, the X-10 motion sensor is set to House/Unit code M1):

If
        X10 'M1/On (3)' is Received
    And X10 'M1/Off (11)' is not Received

Then
        Set 'Hall Light' On

Else
        Set 'Hall Light' Off


The program could alternatively turn on/off an X-10 light in response to the motion commands (in this example, the X-10 light has House/Unit code L1):

If
        X10 'M1/On (3)' is Received
    And X10 'M1/Off (11)' is not Received

Then
        Send X10 'L1/On (3)'

Else
        Send X10 'L1/Off (11)'


One problem with this simple approach is that the On time (the time the light remains on after the last motion is detected) is determined entirely by the motion sensor itself. X-10 motion sensors do not provide particularly fine control of the On time, which ISY can handle with much more flexibility. But of greater concern is the fact that many X-10 motion sensors do not properly re-trigger, i.e. they do not properly restart the internal timer when additional motion is detected. The result is that the sensor sends On when the first motion is detected, and after its preset delay (e.g. 3 minutes) it sends Off, no matter how many times additional motion was detected during that period. The motion sensor does properly send an On command for each additional detection, but it does not restart its timer. This leaves the user in the dark until additional motion is detected, which causes the sensor to once again send On.

The solution is to listen only for the motion sensor's On command, and completely ignore its Off command, allowing ISY to do the timing and re-triggering:

If
        X10 'M1/On (3)' is Received

Then
        Set 'Hall Light' On
        Wait  3 minutes 
        Set 'Hall Light' Off

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

Each time motion is detected, the program will restart, so the light will not be turned off until the programmed amount of time has elapsed after the last motion was detected.

An additional benefit of allowing ISY to do the timing, is that should the On time need to be changed for a number of sensors, it becomes simply a matter of altering the program lines, rather than going around to each sensor and physically changing its programmed On time.

It should be noted that the motion sensor itself will continue to send an Off command each time its timer expires (every three minutes in the above example), causing unnecessary RF and power-line traffic, with the attendant possiblity of collisions. Therefore when allowing ISY to do the timing, the motion sensor's timer should be set to its longest possible value. For many X-10 motion sensors this is 256 minutes, or approximately four and a quarter hours.


Speaking of unnecessary power-line traffic, the previous example will send the INSTEON On command every time motion is detected, which is very undesirable. This can be avoided by the use of two small programs:

Program Motion Detect

If
        X10 'M1/On (3)' is Received

Then
        Run Program 'Motion Turn On' (If)
        Wait  3 minutes 
        Set 'Hall Light' Off

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

Program Motion Turn On

If
        Status  'Hall Light' is Off

Then
        Set 'Hall Light' On

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

Each time motion is detected, program Motion Detect is restarted, retriggering the timer and calling program Motion Turn On. The latter program turns on the light, but only if it is off.


The same functionality can be acheived with the two programs reconfigured this way:

Program Motion Turn On

If
        X10 'M1/On (3)' is Received
    And Status  'Hall Light' is Off

Then
        Set 'Hall Light' On

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

Program Motion Timer

If
        X10 'M1/On (3)' is Received

Then
        Wait  3 minutes 
        Set 'Hall Light' Off

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

Each time motion is detected, both programs run. The first turns the light on, but only if it is off. The second starts or restarts the timer. This example executes slightly faster than the previous one, because in the previous example an additional program call is made, which adds a slight latency, before the light is turned on. This delay is small (subjectively, somewhere in the neighborhood of one-half to one second), but is nevertheless observable. For motion sensing applications, obviously quicker is better.


Many times it is desirable to limit the period during which the motion sensor controls the light. The simplest example of this might be to have the sensor control the light only between sunset and sunrise:

Program Motion Turn On

If
        From    Sunset 
        To      Sunrise (next day)
    And X10 'M1/On (3)' is Received
    And Status  'Rear Floods' is Off

Then
        Set 'Rear Floods' On

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

Program Motion Timer

If
        From    Sunset 
        To      Sunrise (next day)
    And X10 'M1/On (3)' is Received

Then
        Wait  3 minutes 
        Set 'Rear Floods' Off

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


Another common example would be to disable the motion control when the light is manually turned on:

Program Motion Turn On

If
        Program 'Motion Disable' is False
    And X10 'M1/On (3)' is Received
    And Status  'Rear Floods' is Off

Then
        Set 'Rear Floods' On

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

Program Motion Timer

If
        Program 'Motion Disable' is False
    And X10 'M1/On (3)' is Received

Then
        Wait  3 minutes 
        Set 'Rear Floods' Off

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

Program Motion Disable

If
        Control 'Rear Floods' is switched On
    And Control 'Rear Floods' is not switched Off

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

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

When the light is manually switched on, the program Motion Disable becomes True, and as a result the other two programs will not turn the light on or off. When the light is manually switched off, Motion Disable becomes False, and the other two programs resume operation.

Note that if the light is switched Fast On rather than On, the motion sensing will not be disabled, which may be a desirable feature. This can be changed to have Fast On disable motion sensing and regular On not disable it, by changing the Motion Disable program to sense Fast On and Fast Off rather than On and Off. Or, Motion Disable can be configured to sense both the regular and the Fast presses of On and Off to disable motion control when either manual control is used. Furthermore, multiple conditions can be used so, for example the schedule condition of the previous example can be combined with the manual disable example, so motion control is in effect from sunset to sunrise, but disabled by manual control:

Program Motion Turn On

If
        From    Sunset 
        To      Sunrise (next day)
    And Program 'Motion Disable' is False
    And X10 'M1/On (3)' is Received
    And Status  'Rear Floods' is Off

Then
        Set 'Rear Floods' On

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

Program Motion Timer

If
        From    Sunset 
        To      Sunrise (next day)
    And Program 'Motion Disable' is False
    And X10 'M1/On (3)' is Received

Then
        Wait  3 minutes 
        Set 'Rear Floods' Off

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

Program Motion Disable

If
        (
             Control 'Rear Floods' is switched On
          Or Control 'Rear Floods' is switched Fast On
        )
    And Control 'Rear Floods' is not switched Off
    And Control 'Rear Floods' is not switched Fast Off

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

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


As a final example, a set of conditions may be monitored which when active will prevent the motion timer from turning the light off, but not prevent motion detection from turning it on:

Program Stairway Motion Turn On

If
        (
             X10 'M1/On (3)' is Received
          Or X10 'M3/On (3)' is Received
        )
    And Status  'Stairway Light (Load)' is not On

Then
        Set Scene 'sStairway Light' On

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

Program Stairway Motion Timer

If
        Program 'Stairway Motion Enable' is True
    And (
             X10 'M1/On (3)' is Received
          Or X10 'M3/On (3)' is Received
        )

Then
        Wait  3 minutes 
        Set Scene 'sStairway Light' Off

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

Program Stairway Motion Enable

If
        Status  List...
    And Status  of...
    And Status  basement...
    And Status  'Lights' is Off

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

Else
        Stop program 'Stairway Motion Timer'

In this example, motion at either the top (X-10 M1) or the bottom (X-10 M3) of the stairs will turn the stairway light on. When the timer expires, the stairway light will be turned off, but only if all basement lights are off. If any basement lights are on, the stairway light will not be turned off, though it will still turn on in response to motion (for example, if someone starts down the stairs).

This example shows several additional things. First, the load may be a scene rather than just an individual light in order, for example, to keep all the controllers in sync, such as switches at the top and the bottom of the stairs. It also shows how the enabling/disabling of motion control can be effected by other than just manual control; in the above example all of the basement lights are automatically monitored by ISY to determine whether or not to allow the motion timer to turn the stairway scene off. And one more very important feature is shown: when the motion control becomes disabled, the timer program is stopped, just in case it was already running. For example, someone starts down the stairs and the motion turns the scene on and starts the timer. The occupant reaches the lower level and turns on some basement lights, which disables further motion control. But the timer is already running, and would turn the stairway scene off if it were not stopped.

All of these features may be combined with any of the previous examples, and this just scratches the surface. The possibilities are practically endless, if a little imagination is used.




ISY-26 INSTEON / ISY-99i Series INSTEON : How-To Guide