Please login or register.

Login with username, password and session length

Author Topic: Auto occupancy light turn off Macro  (Read 7488 times)


  • Sr. Member
  • ****
  • Helpful Post Rating: 11
  • Posts: 132
Auto occupancy light turn off Macro
« on: June 10, 2011, 05:02:57 PM »

I had a situation where I did not want a motion sensor to turn a light ON, I wanted a human to decide that, but I did want the lights to go off if no one was in the room for a predetermined time. A timer would not work, sinec I would turn off after the pre set time regardless of occupancy, and, for the reason mentioned, a motion sensor would not work either. Here was my solution:


Problem to be solved:  When a room light is turned on by an occupant and the occupant vacates the room without turning off the light and is gone for a specified time (e.g.  10 minutes) without any return to the room at all during that time, I want the light to be turned OFF.
X-10 Devices involved in room :  (1) In wall transmitter on Address X and  (2) Motion detector with 5 minute delay from detection trigger until “OFF” command sent.   Also, there is a “Phantom Module” I created in AHP to act as a trigger.

MACRO 1  -  Flag 1 set macro

Trigger:  X ON (X can be any one of several devices, so I actually have this macro for any of them)
 NOTE: The devices are all turned on by an in wall transmitter or a palmpad, so AHP knows when they are turned on.
Actions:  Set Flag 1
Comments:  This is a one time macro in this set, used to set an “ON”  flag used by other Macros at the time the light is first turned on.

MACRO 2 -  Possible turn off commander

Trigger:  Motion sensor sends an “off” command
Actions:   Set Flag 2
               Clear Flag 1
   Delay 5 minutes
     Call Macro 4 (P8 “ON”)
Comments: This macro is used to set up flags for a possible shut off under Macro 4. The 5 minute delay is there so that of someone leaves and after the Motion detector delay an “OFF” is sent, that delay plus an additional 5 minutes will prevent unnecessary “OFF” actions should they re-enter during this time period. This way someone “coming and going” will not be required to repetitively turn on the light – in other words this is an “anti annoyance” feature.

MACRO 3 -  “ON” flag maintenance

Condition:  Flag 2 is Set
Trigger:  Motion Sensor sends an “ON” command
Actions:  Clear Flag 2
     Set Flag 1
Comments: This macro is designed to run when there has been an “off” command from the Motion Sensor, but then there is a subsequent “ON” command received within 5 minutes. This resets the flags preventing a shutoff of the light due to temporarily being out of the room.  As there will likely be many “motion detected”  - “ON” commands sent from an occupied room, I only run this macro when there has been an intervening “OFF”  command which set flag 2, hence the condition of flag 2 set.

MACRO 4 – Light Shutoff

Trigger:  P8 ON
Conditions:  Flag 1 is clear and Flag 2 is set.
Action:  Turn off Light X
Comment: Pretty straightforward, “turn off the light” command – conditions are used to check for specified flag settings prior to turning off the light. In my case I have multiple lights in an area that I wanted to turn off all together, and so grouped them on a separate housecode, and have the last Macro turn off everything on that housecode, but this would work for individual lighting situations as well.

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