Jump to content

Motion Program Help


Go to solution Solved by kclenden,

Recommended Posts

Posted

EISY 5.5.5

Motion program help.  So I have a motion sensor in my bathroom.  Goal is to turn off light after five minutes of inactivity, unless activity is sensed again.

 

 

Bath Motion - [ID 0025][Parent 0001]

If
        'Master Bath / Andrew Vanity' Status is not Off
    And 'AA-Insteon Motion Sensors / Motion Sensor Bathroom / Bath Motion' is switched Off
 
Then
        Wait  4 minutes and 25 seconds
        Set 'Master Bath / Andrew Vanity' Off
 
Else
   - No Actions - (To add one, press 'Action')

 

problem with above is turns off lights even if I walk back into bathroom.  I can't seem to think through programming to not run if motion is starting during "wait" period.

 

Any ideas would be appreciated.

 

Thanks,

 

Andrew
 

 

Posted

If
        'AA-Insteon Motion Sensors / Motion Sensor Bathroom / Bath Motion' is switched ON
 
Then
        Wait  4 minutes and 25 seconds
        Set 'Master Bath / Andrew Vanity' Off
 
Else
   - No Actions - (To add one, press 'Action')

 

Seems to me this is what you're looking for.  Each time the motion sends On the delay will restart.  Remember that when an IF statement is re-triggered the program is re-triggered, which in this case effectively restarts the wait.

Is it an original Insteon motion or an MS-II?   they behave a little bit differently.

Posted
10 hours ago, MrBill said:

If
        'AA-Insteon Motion Sensors / Motion Sensor Bathroom / Bath Motion' is switched ON
 
Then
        Wait  4 minutes and 25 seconds
        Set 'Master Bath / Andrew Vanity' Off
 
Else
   - No Actions - (To add one, press 'Action')

 

Seems to me this is what you're looking for.  Each time the motion sends On the delay will restart.  Remember that when an IF statement is re-triggered the program is re-triggered, which in this case effectively restarts the wait.

Is it an original Insteon motion or an MS-II?   they behave a little bit differently.

@MrBill I assume your program will work with both motion sensors, though?  Thanks.

Posted

@Ross they should, you may not be able to program all the options on an MS-II via the ISY tho.  The important one is "on only" where the motion uses links to turn of the lights but uses a program on a controller such as above to turn off the lights.

  • Like 1
Posted

I separate my on programs from my off when it comes to my sensors for a variety of reasons. I use 

If motion is switched off and not switched on 

Then wait 5 minutes switch off

 

 

 

  • Like 1
Posted (edited)

@andrewhermanSee my other thread, inspired by this one, regarding GE in-Wall Smart Motion switch.and

May I ask what you are using to detect motion? After my troubles I think I am going to eventually toss these GE switches.

 

 

Edited by brians
Posted
7 hours ago, lilyoyo1 said:

If motion is switched off and not switched on 

Then wait 5 minutes switch off

I would have said you only need the "not switched on" if you have something in the ELSE clause.

  • Like 1
  • Solution
Posted (edited)
On 2/5/2023 at 1:09 PM, andrewherman said:

It is the II.  Thanks.

There are two settings that you can alter via the Admin Console that greatly affect how the MS-II works, "Motion Report" and "Motion Timeout".

"Motion Report" controls whether the motion sensor sends both an ON command when it detects motion and an OFF command when motion has ceased.  "Motion Timeout" controls how long there must be no motion before the motion sensor decides that motion has ceased.

Out of the box, I believe the MS-II has "Motion Report" set to "ON and OFF".  If you plan to use a program to turn OFF the device you're controlling with the motion sensor, then you'll want to change "Motion Report" to "ON Only"

Also out of the box, I believe that "Motion Timeout" is set to 30 seconds.  This means that there must be at least 30 seconds of no motion before the motion sensor sends an OFF command.  Now here's where things will get confusing.  If you're going to use a program to control turning a device off, you don't want the motion sensor to send an OFF command and so you think the "Motion Timeout" doesn't matter.  Unfortunately, the way Insteon implemented the motion sensor code, the "Motion Timeout" also controls the time period during which the motion sensor won't send another ON command.

At this point, an example is probably called for:

Say you have the motion sensor set to only send ON commands and you have the timeout set to 1 minute:

  • You walk into the room and the motion sensor sends an ON command, it also starts a one minute countdown
  • 15 seconds later, you leave the room
  • 15 seconds later, you reenter the room - since you're still within 1 minute countdown, the motion sensor does not send another ON command, but it does restart it's own 1 minute countdown
  • 15 seconds later, you leave the room,
  • 15 seconds later, you reenter the room - (see above)

So long as the motion sensor detects your movement within its timeout period, it restarts its internal timer.  This means that you can go long periods without the motion sensor ever sending another ON command even though there is motion.  So any program that executes a countdown based on no motion gets starved of the knowledge that motion is actually happening.

The best you can do is set the "Motion Timeout" to the shortest period allowed (10 seconds), and hope that sometime during the program countdown period (in your case 4 minutes and 25 seconds) there is at least 10 seconds of no motion so that the motion sensor countdown will finish and it will send another ON command which will restart your program countdown period.

There is an alternative, but it's often one people don't find acceptable.  That is to set the motion sensor up to send both ON and OFF commands, but don't add the motion sensor as a controller in a scene to control the device.  Instead use a program to both turn the device ON and OFF.  This way the motion sensor does what it does best, reports both the presence as well as the absence of motion.  There are at least two downsides though:

  • Using a program to turn ON a device after it receives an ON command from the motion sensor adds a lag to the device actually being turned on.  Usually at least a second, and sometimes more
  • Device to device communication (i.e. motion sensor to light) is more reliable than program to device communication.  For two reasons: device to device uses acknowledgements and retries, while program to device does not; and device to device only needs one command to succeed (ms to device) while program to device needs two commands to succeed (ms to program followed by program to device).
Edited by kclenden
  • Like 2
Posted
2 hours ago, kclenden said:

I would have said you only need the "not switched on" if you have something in the ELSE clause.

the not switched on stops the timer. If you just use the switched off, then the timer would continue to run once triggered.

Posted
1 hour ago, lilyoyo1 said:

the not switched on stops the timer. If you just use the switched off, then the timer would continue to run once triggered.

How so?  Once triggered the WAIT will count down and then perform the OFF statement that follows it.  The WAIT will only restart the count down if the IF is retriggered.

Let's analyze two different programs.  One with the "not switched on" and one without.

If motion is switched off 
   and not switched on 

Then wait 5 minutes
     switch off

State: Program Not running

Motion is switched OFF
  start timer
Motion is switched ON
  no effect because there is no code in ELSE

State: Program running and in middle of WAIT countdown

Motion is switched OFF
  restart timer
Motion is switched ON
  no effect because there is no code in ELSE

If motion is switched off 

Then wait 5 minutes
     switch off

State: Program Not running

Motion is switched OFF
  start timer
Motion is switched ON
  no effect because ON not a trigger in IF

State: Program running and in middle of WAIT countdown

Motion is switched OFF
  restart timer
Motion is switched ON
  no effect because ON not a trigger in IF

Wouldn't both programs result in exactly the same code execution?  What am I missing?

  • Like 1
Posted
8 minutes ago, kclenden said:

How so?  Once triggered the WAIT will count down and then perform the OFF statement that follows it.  The WAIT will only restart the count down if the IF is retriggered.

Let's analyze two different programs.  One with the "not switched on" and one without.

If motion is switched off 
   and not switched on 

Then wait 5 minutes
     switch off

State: Program Not running

Motion is switched OFF
  start timer
Motion is switched ON
  no effect because there is no code in ELSE

State: Program running and in middle of WAIT countdown

Motion is switched OFF
  restart timer
Motion is switched ON
  no effect because there is no code in ELSE

If motion is switched off 

Then wait 5 minutes
     switch off

State: Program Not running

Motion is switched OFF
  start timer
Motion is switched ON
  no effect because ON not a trigger in IF

State: Program running and in middle of WAIT countdown

Motion is switched OFF
  restart timer
Motion is switched ON
  no effect because ON not a trigger in IF

Wouldn't both programs result in exactly the same code execution?  What am I missing?

The second line isn't just for or else commands. It also allows programs to reevaluate. 

If you just have switched off, once it triggers, the countdown will start and continue since there is nothing to stop the trigger and cause it to reevaluate. 

By adding the switched on, the program reevaluates and stops the countdown. 

  • Like 1
Posted (edited)
3 hours ago, lilyoyo1 said:

The second line isn't just for or else commands. It also allows programs to reevaluate. 

If you just have switched off, once it triggers, the countdown will start and continue since there is nothing to stop the trigger and cause it to reevaluate. 

By adding the switched on, the program reevaluates and stops the countdown. 

I disagree.  The WAIT will count down 5 minutes and then move onto the next line below the WAIT.  After executing the next line, in this case sending an OFF to some device, the program will run out of lines to execute and then stop.  By your logic, if a "switched OFF " was received, but a "switched ON" was never received then the program would just keep running forever.

If you don't believe me, how about the "ISY994i Series User Guide".  Here's a screen shot from a description of "WAIT" on page 39:

image.png.eb433980c032c40861f56aa85b628719.png

Edit: Why doesn't that program need a "not switched ON"?

Edited by kclenden
  • Like 1
Posted
3 hours ago, kclenden said:

I disagree.  The WAIT will count down 5 minutes and then move onto the next line below the WAIT.  After executing the next line, in this case sending an OFF to some device, the program will run out of lines to execute and then stop.  By your logic, if a "switched OFF " was received, but a "switched ON" was never received then the program would just keep running forever.

If you don't believe me, how about the "ISY994i Series User Guide".  Here's a screen shot from a description of "WAIT" on page 39:

image.png.eb433980c032c40861f56aa85b628719.png

Edit: Why doesn't that program need a "not switched ON"?

Your method is fine if you just want the lights to turn off which is what the program you linked to is designed to do. It doesn't need anything else. My method keeps the lights from turning off if someone is still using the bathroom. Yes, you can use other programs to prevent the lights from turning off by why use 2 when it can be accomplished in 1?

For example, if a person is in the bathroom doing their business, they may not be picked up by the sensor. Using your methodology, the lights would turn off on them because they were still too long. 

Another situation would be getting ready in the morning and a person is in and out of the bathroom. 

Another reason is the op clearly stated that he wants the lights to stay on if the bathroom is being used. As you stated in your argument (as well as program linked), once the switched off command is received, the system will go line by line. What are you using to stop the lights from turning off?

My method will cause the a reevaluation during the wait. 

If motion is switched off>wait. If motion is switched on during that time, the isy will reevaluate the system and stop the program during the wait which stops the lights from turning off.

Should no motion happen, no reevaluation takes place and lights continue to go off. 

  • Like 1
Posted
9 hours ago, kclenden said:

State: Program running and in middle of WAIT countdown

Motion is switched OFF
  restart timer
Motion is switched ON
  no effect because there is no code in ELSE

No effect?  Are you sure?  Will "switched on" not halt the WAIT state?

9 hours ago, kclenden said:

Wouldn't both programs result in exactly the same code execution?  What am I missing?

Perhaps this is the difference that you are missing?

Posted

Not sure if this is directly related but I noticed something about the Zooz ZSE40 - I recently took my Insteon MDs out of service and have 5 ZSE40's controlling lights in various locations using the scheme where the MDs do not directly control a scene, they just report motion On and Off to IoX:

If
        'Motion Detectors / LR ZW037-MD' is switched Off
    And 'Motion Detectors / LR ZW037-MD' is not switched On
 
Then
        Wait  5 minutes 
        Set 'LR-Coffee Room / LR Ctr Lts' Off
 

The above program works fine to turn off the lights as discussed - the lights stay on as long as someone triggers motion within the MD timeout + 5 minutes

If
        'Motion Detectors / MBath ZW050-MD' is switched Off
     Or 'Motion Detectors / MBath ZW050-MD' Status is Off
 
Then
        Wait  25 minutes 
        Set 'Master Bath / Master Bath Lt' Off
 

But the above also works - I noticed that the above program becomes false when the MD is switched ON and also refreshes the MD timeout - note no AND clause for not switched On

Is this normal behavior or unique for the ZSE40?

Posted
42 minutes ago, JTsao said:

Not sure if this is directly related but I noticed something about the Zooz ZSE40 - I recently took my Insteon MDs out of service and have 5 ZSE40's controlling lights in various locations using the scheme where the MDs do not directly control a scene, they just report motion On and Off to IoX:

If
        'Motion Detectors / LR ZW037-MD' is switched Off
    And 'Motion Detectors / LR ZW037-MD' is not switched On
 
Then
        Wait  5 minutes 
        Set 'LR-Coffee Room / LR Ctr Lts' Off
 

The above program works fine to turn off the lights as discussed - the lights stay on as long as someone triggers motion within the MD timeout + 5 minutes

If
        'Motion Detectors / MBath ZW050-MD' is switched Off
     Or 'Motion Detectors / MBath ZW050-MD' Status is Off
 
Then
        Wait  25 minutes 
        Set 'Master Bath / Master Bath Lt' Off
 

But the above also works - I noticed that the above program becomes false when the MD is switched ON and also refreshes the MD timeout - note no AND clause for not switched On

Is this normal behavior or unique for the ZSE40?

You use status which accomplishes the same thing. I don't use status for mine as I've found the system doesn't always update the state of devices during a reboot

Posted
4 hours ago, oberkc said:

No effect?  Are you sure?  Will "switched on" not halt the WAIT state?

Your are correct.  That is what I was missing.  While there is no code to execute in the ELSE, it does switch the execution from the THEN to the ELSE, thus halting the WAIT state.

Posted
5 hours ago, lilyoyo1 said:

My method keeps the lights from turning off if someone is still using the bathroom.

Yes it does.  My mistake.  That's the clarity I was looking for.

  • Like 2
Posted (edited)
On 2/7/2023 at 8:31 AM, kclenden said:

Yes it does.  My mistake.  That's the clarity I was looking for.

Also, not to push anyone to update right now to 5.5.5 but more Z-Wave functionality was added. You should be able to send parameters to that sensor where you can set the sensor "trigger Interval" from 15 (default) to 255 seconds till it will trigger an event. In a lot of cases this is the BEST way to go on any Battery Operated Sensor so that it will increase battery life. Telling eisy to look if the motion sensor every 5 minutes does not stop the internal motion sensors setting to let say every 15 seconds where you could set that 1-2 minutes internally to save battery consumption. I believe the Perimeter for that is #5 with 1 byte. You have a Maximum with that Zooz Multi Model of 4.25 Minutes. 

I do set some of my Zooz ZSE18. For example my Garage. If the garage light is on and motion is detected it will reset the counter for 30 minutes but with the "trigger interval" set to 15 minutes (900 seconds). That means the sensor will not check for motion again till 15 minutes has elapsed then this will trigger the reset to the 30 minutes eisy program. This in the long run will save battery life. The Zooz ZSE18 has a Triger Interval range from 3 to 65535 seconds (@ 18.2 hours).

With the need to have the type you are using or monitor temp/humidity, light and motion you might want to toy your interval a little to help reduce activity that isn't needed.

 

Cheers,

TRI0N

Edited by TRI0N
Guest
This topic is now closed to further replies.

×
×
  • Create New...