Differences

This shows you the differences between two versions of the page.

Link to this comparison view

ms_overriding_with_switch [2014/05/28 16:15]
ms_overriding_with_switch [2019/01/26 00:10] (current)
Line 1: Line 1:
 +====== Overriding a Motion Sensor OFF when a switch is pressed ======
  
 +Here's a scenario that comes up from time to time: you have a motion sensor that turns on/off a light, but you want it to NOT turn off the light when you turn the light on via the switch. There are many ways to accomplish this and we'll walk you through one example here. The [[wiki:​how-to_level_of_difficulty|level of difficulty]] of this how-to is **moderate** because of the number of parts that make up the solution. ​
 +
 +**Note**: you can't use [[insteon_links|INSTEON links]] for this solution, so if you have your motion sensor linked directly to the switch controlling the light, you should remove those links before you get started. ​
 +
 +==== What's Needed ====
 +
 +  * A motion sensor - any type will do
 +  * A switch that controls the light - any INSTEON switch or any 2-way X10 switch will work
 +
 +==== Configure the Motion Sensor ====
 +
 +First thing we want to do is configure the motion sensor correctly. In this case, we want Indigo to maintain an ON/OFF state for it. Select the [[motion_sensor_basics|Auto-Off duration]] accordingly:​
 +
 +  * For an INSTEON motion sensor: "After a delay of X minutes from when the module last sent OFF"
 +  * For an X10 motion sensor: "After delay of X minutes from when the module last sent ON"
 +
 +Obviously, set X to be the number of minutes you want the delay to be. For an INSTEON motion sensor, you may also use the first option ("​Immediately when OFF is received from module"​) if you already have your motion sensor set up to do the appropriate delay.
 +
 +==== Create an override Variable ====
 +
 +The next thing you'll do is create a variable that will help you determine whether the switch was used manually to turn on the light. This will be used later when determining whether to turn the light off when the motion sensor goes off.
 +
 +  - Select ''​**Variable List**''​ from the ''​**Window**''​ menu
 +  - Press the ''​**New...**''​ button at the top of the Variable List window
 +  - Name the variable "​MotionSensorOverride"​
 +  - Set the value of the "​MotionSensorOverride"​ to "​false"​
 +
 +==== Create the Trigger Events ====
 +
 +Now, we want to create several triggers: one that changes the value of the variable "​MotionSensorOverride"​ to "​true"​ when the light switch is turned ON manually, one that changes the value of the variable "​MotionSensorOverride"​ to "​false"​ when the light switch is turned OFF manually, one that triggers when the motion sensor goes ON and another that triggers when the motion sensor goes off.
 +
 +=== Defining the Light Turned ON trigger ===
 +
 +  - Select ''​**Trigger Action List**''​ from the ''​**View**''​ menu
 +  - Press the ''​**New...**''​ button at the top of the main window
 +  - Name the trigger ''​**Light Turned ON**''​
 +  - If you are using an INSTEON switch:
 +    - Select ''​**INSTEON Command Received**''​ from the trigger ''​**Type**''​ popup
 +    - Select your switch'​s name from the ''​**Device**''​ popup
 +    - Select ''​**On**''​ from the ''​**Received:​**''​ popup
 +  - If you are using an X10 switch:
 +    - Select ''​**X10 Command Received**''​ from the trigger ''​**Type**''​ popup
 +    - Select your switch'​s name from the ''​**Device**''​ popup
 +    - Select ''​**On**''​ from the ''​**Received:​**''​ popup
 +  - Choose the ''​**Action**''​ tab
 +  - Select ''​**Modify Variable**''​ from the action ''​**Type**''​ popup
 +  - Select "​MotionSensorOverride"​ from the ''​**Variable**''​ popup
 +  - Select the ''​**Set to true**''​ radio button
 +  - Click the ''​**OK**''​ button
 +
 +=== Defining the Light Turned OFF trigger ===
 +
 +  - Select ''​**Trigger Action List**''​ from the ''​**View**''​ menu
 +  - Press the ''​**New...**''​ button at the top of the main window
 +  - Name the trigger ''​**Light Turned OFF**''​
 +  - If you are using an INSTEON switch:
 +    - Select ''​**INSTEON Command Received**''​ from the trigger ''​**Type**''​ popup
 +    - Select your switch'​s name from the ''​**Device**''​ popup
 +    - Select ''​**Off**''​ from the ''​**Received:​**''​ popup
 +  - If you are using an X10 switch:
 +    - Select ''​**X10 Command Received**''​ from the trigger ''​**Type**''​ popup
 +    - Select your switch'​s name from the ''​**Device**''​ popup
 +    - Select ''​**Off**''​ from the ''​**Received:​**''​ popup
 +  - Choose the ''​**Action**''​ tab
 +  - Select ''​**Modify Variable**''​ from the action ''​**Type**''​ popup
 +  - Select "​MotionSensorOverride"​ from the ''​**Variable**''​ popup
 +  - Select the ''​**Set to false**''​ radio button
 +  - Click the ''​**OK**''​ button
 +
 +=== Defining the Motion Detected trigger ===
 +
 +  - Select ''​**Trigger Action List**''​ from the ''​**View**''​ menu
 +  - Press the ''​**New...**''​ button at the top of the main window
 +  - Name the trigger ''​**Motion Detected**''​
 +  - Select ''​**Device State Changed**''​ from the trigger ''​**Type**''​ popup
 +  - Select your motion sensor'​s Device name from the ''​**Device**''​ popup
 +  - Select ''​**Becomes On**''​ from the popup below the Device'​s name.
 +  - Choose the ''​**Action**''​ tab
 +  - Select ''​**Control Light / Appliance**''​ from the action ''​**Type**''​ popup
 +  - Select ''​**Turn On**''​ from the ''​**Action**''​ popup
 +  - Select the name of your switch from the ''​**Device**''​ popup
 +  - Click the ''​**OK**''​ button
 +
 +=== Defining the Motion Stopped trigger ===
 +  - Press the ''​**New...**''​ button at the top of the main window
 +  - Name the trigger ''​**Motion Stopped**''​
 +  - Select ''​**Device State Changed**''​ from the trigger ''​**Type**''​ popup
 +  - Select your motion sensor'​s Device name from the ''​**Device**''​ popup
 +  - Select ''​**Becomes Off**''​ from the popup below the Device'​s name.
 +  - Choose the ''​**Condition**''​ tab
 +  - Select the ''​**if variable**''​ radio button
 +  - Select "​MotionSensorOverride"​ from the popup of variable names
 +  - Select the "is false" radio button
 +  - Choose the ''​**Action**''​ tab
 +  - Select ''​**Control Light / Appliance**''​ from the action ''​**Type**''​ popup
 +  - Select ''​**Turn Off**''​ from the ''​**Action**''​ popup
 +  - Select the name of your switch from the ''​**Device**''​ popup
 +  - Click the ''​**OK**''​ button
 +\\
 +That's it. So, let's review what this solution does. If you turn the light on via the switch, it sets "​MotionSensorOverride"​ to true, signaling that the switch turned the light on (regardless of whether the light was already on). If you turn the light off, it sets MotionSensorOverride"​ to false, signaling that the switch hasn't turned the light on. When Indigo sees that the motion sensor is detecting motion, it turns the light on. Here's the crucial step: when Indigo sees that motion is no longer being detected, it turns the light off **only if** the light wasn't turned on by the switch (by checking MotionSensorOverride"​). Otherwise it just skips turning the light off.
 +
 +One point about this solution: you **must** turn the light OFF via the switch if you turned it on via the switch. Otherwise, the motion sensor will never turn it back off.
 

© Perceptive Automation, LLC. · Privacy