🖥️ActiveHome Pro > User-Designed Working Macros

Motion sensor and lights on/off

(1/4) > >>

jarleifv:
I use 1 motion sensor in the bathroom.

Desired outcome:
Motion sensor detects motion and light comes on. Light stays on during my stay in bathroom. A few minutes after departure from room, light goes off.


Four macros take care of this, using two flags.


Flag 1 = Motion detected during delay
Flag 2 = 5 minute delay active


P1 - Motion triggered during dark
 Conditions:
  flag 1 off   
  AND
  flag 2 off
 Actions:
  Lights on
  set flag 2 on
  Delay 5 minutes
  P3 - ON


P1 - Motion triggered during light
 Conditions:
  flag 1 off
  AND
  flag 2 on
 Actions:
  set flag 1 on


P3 - Motion check - no motion during delay
 Conditions:
  flag 1 off
  AND
  flag 2 on
 Actions:
  set flag 2 off
  lights off


P3 - motion check - motion during delay
 Conditions:
  flag 1 on
  AND
  flag 2 on
 Actions:
  set flag 1 off
  set flag 2 off
  P1 - ON

bkenobi:
I've been playing with this code all day and can't figure out what P1 and P3 are.  I thought P1 was the motion sensor and P3 was a phantom module, but now I'm not sure.  In the 4th macro it says "P1 - ON", but I'm not sure how to set a motion sensor to ON.  I've set up all the conditions and code except for "P1 - ON" and "P3 - ON".  Anyone have any idea how to implement this code?

Noam:
It looks to me like "P1 On" and "P3 On" are macros. There are two sets for each, using the "else" functionality that is automatic with SmartMacros.
The motion sensor is set to P1.

so, if there is motion, and the light is off, then the light is turned on.
Every 5 minutes, the macro will check for additional motion. If there has been any, then it waits another 5 minutes.
If there hasn't been any motion in the last 5 minutes, then it turns the light off, and resets for the next time.

At least that's how I read it.

bkenobi:
That's what I was thinking too.  Here's my problem though: if "P1 On" and "P3 On" are macros, how do I call them from a macro?  I don't see any way to select a macro to call it recursively.  The only thing I can think of is that there are P1 and P3 phantom modules that are set to on which then trigger the "P1 On" and "P3 On" macros.  Sound right or am I completely confused still?

EDIT:  Now I'm not sure...  I just read a few more smart macro threads and the "P1 ON" command seems pretty common.  Is there a command I'm missing where I can send that command without having a module?  This must be a basic step that I'm missing since it's so common.  I'm going to feel really stupid when I figure out what I'm missing.   B:(

Noam:

--- Quote from: bkenobi on February 07, 2011, 10:41:44 AM ---... Is there a command I'm missing where I can send that command without having a module?  This must be a basic step that I'm missing since it's so common. 
--- End quote ---

You can do it by creating a "dummy" appliance module, and having the macro turn that on.
I suppose (I've never tried this), you could use the "advanced command" option in SmartMacros to send just the "P1 On". Not sure if that would work, though.

Navigation

[0] Message Index

[#] Next page

Go to full version