Please login or register.

Login with username, password and session length

Author Topic: [TIP] Multiple Motion Sensors To Cover One Room  (Read 26731 times)

RebHawk

  • Full Member
  • ***
  • Helpful Post Rating: 6
  • Posts: 60
[TIP] Multiple Motion Sensors To Cover One Room
« on: March 13, 2008, 05:33:03 PM »

Narrative:
This set of macros turn on my bathroom lights when someone enters the bathroom.  However, due to the layout of the bathroom, there is no way to place one motion sensor such that it can see someone at the sink or someone in the shower.  Thus, I use two motion sensors.  The one by the sink turns on the lights fully if it is daylight, or dims them down to 45% if it is after midnight but before 7:05 AM.  The second motion sensor overwatches the shower, and simply sets a flag in AHP.  These two sensors are positioned such that the sensor by the door will always be the last one triggered.  Thus, my bathroom lights off macro checks to see if the shower motion flag is cleared, then turns the lights off.  If the flag is not cleared, then the lights stay on.  Presumably if the lights stay on, someone will at a later time get out of the shower, which will trigger the motion sensor by the sink, and then when it sends the off signal once again, the shower flag will be checked and if off the lights will go off.  If not, repeat.  I've been running this for a while, and it has performed flawlessly.


Flags:
2: SET when Master Bath lights go ON
   CLEARED when Master Bath lights are turned OFF
   Purpose: Keep multiple trips of Master Bath motion sensor from
         brightening/dimming lights multiple times per occupancy.

3: Goes ON (SET) at 0001
   Goes OFF (CLEARED) at 0705
   Purpose: Allows a way to turn bathroom lights on at a lower level in
            the middle of the night, to help from disturbing sleep.


Modules:

MS14A Base Address M13 (Sink Motion Sensor)
MS14A Base Address M15 (Shower Motion Sensor)
Decora Wall Switch Address M5

Macro Name:
MBath Motion Set

Trigger & Conditions:
   M15 On

Actions:
   Set Flag 7 (Motion present in shower)

Macro Name:
MBath Motion Clear

Trigger & Conditions:
   M15 Off

Actions:
   Clear Flag 7 (No motion present in shower)

Macro Name:
MBath Lights ON DAY

Trigger & Conditions:
   M13 ON
   Flag 2 OFF (Lights are not already on)

Actions:
Set Flag 2 (Prevents multiple triggers)
M5 ON (Turn on bathroom lights)

Macro Name:
MBath Lights ON NIGHT
Trigger & Conditions:
   M13 ON
   Flag 2 OFF (Lights are not already on)
   Flag 3 ON (Between Midnight and 0705)

Actions:
Set Flag 2 (Prevents multiple triggers)
M5 ON (Turn on bathroom lights)
M5 Absolute Dim 45% (Dim bathroom lights to 45%)

Macro Name:
MBath Lights OFF
Trigger & Conditions:
   M13 OFF
   Flag 7 OFF (No motion in shower)

Actions:
Clear Flag 2 (Turn off multiple trigger prevention flag)
M5 OFF (Turn off bathroom lights)

Hope this helps someone else.  It isn't limited to bathrooms, but would be useful for any sort of room where there are areas that one motion sensor can't see all of.  The only problem is that it is a flag hog.

Cheers,
--Lee
Logged

Puck

  • Advanced Member
  • Hero Member
  • ******
  • Helpful Post Rating: 171
  • Posts: 1799
Re: [TIP] Multiple Motion Sensors To Cover One Room
« Reply #1 on: March 13, 2008, 09:02:41 PM »

RebHawk: Thanks for sharing your macro. I do have one question that I think might have been just a miss during typing:

Quote
MBath Lights ON DAY

Trigger & Conditions:
   M13 ON
   Flag 2 OFF (Lights are not already on)

Since this macro has the same M13 ON trigger as this one:

Quote
MBath Lights ON NIGHT
Trigger & Conditions:
   M13 ON
   Flag 2 OFF (Lights are not already on)
   Flag 3 ON (Between Midnight and 0705)

.. then they make up an ELSE; so the "MBath Lights ON DAY" should have the "Flag 3 OFF" condition to prevent it from executing when Flag 3 is ON.
Logged

RebHawk

  • Full Member
  • ***
  • Helpful Post Rating: 6
  • Posts: 60
Re: [TIP] Multiple Motion Sensors To Cover One Room
« Reply #2 on: March 13, 2008, 11:28:21 PM »

RebHawk: Thanks for sharing your macro. I do have one question that I think might have been just a miss during typing:

Quote
MBath Lights ON DAY

Trigger & Conditions:
   M13 ON
   Flag 2 OFF (Lights are not already on)

Since this macro has the same M13 ON trigger as this one:

Quote
MBath Lights ON NIGHT
Trigger & Conditions:
   M13 ON
   Flag 2 OFF (Lights are not already on)
   Flag 3 ON (Between Midnight and 0705)

.. then they make up an ELSE; so the "MBath Lights ON DAY" should have the "Flag 3 OFF" condition to prevent it from executing when Flag 3 is ON.


Yes, they do make up an ELSE.  No, having the "Flag 3 OFF" condition for "MBath Lights ON DAY" is not required, because "MBath Lights ON NIGHT" is the "IF" of the "IF...ELSE" pair.  In other words, when M13 is triggered, AHP runs the macro pair.  First it checks to see if flag 3 is ON.  If it is, the lights come on and then dim.  If not, the macro falls through to the ELSE part, which is "MBath Lights ON DAY", which turns the lights on full bright.  "MBath Lights ON DAY" will never execute when Flag 3 is ON, since the macro will never get to that condition.  This wasn't a lucky happenstance... I designed the macro this way so that if for any reason my macro that sets Flag 3 ON fails, the lights will come on at full bright.  This would indicate to me that there was some problem with the "Midnight" macro.  If the macros were, however, in the opposite order, the extra condition you mention would be needed, otherwise the lights would always come on full bright and the NIGHT condition would never be seen.

Regards,
--Lee
Logged

Puck

  • Advanced Member
  • Hero Member
  • ******
  • Helpful Post Rating: 171
  • Posts: 1799
Re: [TIP] Multiple Motion Sensors To Cover One Room
« Reply #3 on: March 14, 2008, 03:07:07 AM »

Yes, they do make up an ELSE.  No, having the "Flag 3 OFF" condition for "MBath Lights ON DAY" is not required, because "MBath Lights ON NIGHT" is the "IF" of the "IF...ELSE" pair.

When the order is given, it is clear. For users who are not familiar with how AHP macros execute and just copy from examples, they could end up entering them in a different order and run into a situation where the else macro never gets reached. Having else macro conditions mutually exclusive prevents any potential ordering confusion.

Thanks for replying with the intended order.  ;)
Logged

PrimeGuild

  • Full Member
  • ***
  • Helpful Post Rating: 0
  • Posts: 44
    • Software Solutions
Re: [TIP] Multiple Motion Sensors To Cover One Room
« Reply #4 on: March 31, 2008, 12:43:43 PM »

@
Quote
The one by the sink turns on the lights fully if it is daylight

What modules are you using for your lights? If you are using Socket Rockets, then I don't think they allow dimming capability.
Logged

Puck

  • Advanced Member
  • Hero Member
  • ******
  • Helpful Post Rating: 171
  • Posts: 1799
Re: [TIP] Multiple Motion Sensors To Cover One Room
« Reply #5 on: March 31, 2008, 01:32:08 PM »

What modules are you using for your lights? If you are using Socket Rockets, then I don't think they allow dimming capability.

Modules:

MS14A Base Address M13 (Sink Motion Sensor)
MS14A Base Address M15 (Shower Motion Sensor)
Decora Wall Switch Address M5
Logged

Nishant Pant

  • Newbie
  • Helpful Post Rating: 0
  • Posts: 5
Re: [TIP] Multiple Motion Sensors To Cover One Room
« Reply #6 on: January 02, 2009, 03:33:21 PM »

Hi,

Thanks for taking the time for writing your bathroom setup. My bathroom is exactly like yours. Here is a visual (see attachment).
The problem is that if I use your setup, what will happen is when I walk out of the bathroom after a shower...
1. Stepping out of the shower will set up flag 7 since the motion sensor will get triggered
2. When I pass the door motion sensor at this time, the flag 7 would not have cleared because I will reach the door in 2 seconds...so the door sensor macro will leave the lights on and they will never turn off.

Also, even if it does work, what if my wife is near the sink and I am in the shower ...one person walking out of the bathroom will cause the other person to be left in darkness !!
Any ideas solutions will be highly appreciated :)
Logged
 

X10.com | About X10 | X10 Security Systems | Cameras| Package Deals
© Copyright 2014-2016 X10.com All rights reserved.