Restoring X-10 Lights To Their Prior Level 


Introduction

Many people like to use their home automation system to temporarily turn lights on or off, then return them to their prior level. Here are some common uses:

bulletHave an "All Lights On" command which you run if you hear a noise and want to scare off a potential intruder. But later, you'll want to put the lights back where they were. You probably don't want to just do "All Lights Off", as that will turn everything off.
bulletA porch light is left on at a dim level throughout the night. But when a motion sensor detects motion, the light goes to full brightness. After a few minutes, the light should return to the previous level (not just be turned off).

Both of these scenarios require the automation system to store the initial level of the light(s), then later return the lights to the same level. HomeVision is one of the very few systems that provide this capability. Most other systems would, at best, require you to use flags to keep track of the on/off state of each light, then turn the light on or off based on these flags. You could never keep track of the level of a dimmed light and restore it with such systems.

 

HomeVision Commands

HomeVision has two primary commands to implement this feature:

     X-10 Module ## - Put Current Level Into Variable ##
     X-10 Module ## - Set To Level In Variable ##        

The first command puts the X-10 light's current level into the specified variable. Use it to store the light level prior to changing it. The second command sets the light to the level contained in the specified variable. Use it to restore the light to the previous level.

 

Example

Here's an example of how to use these commands. It shows how to implement a simple "All Lights On" macro and a "Cancel All Lights On" macro.

Assume you have three X-10 light modules:

     A-1 = Family Room Light
     A-2 = Dining Room Light
     A-3 = Bedroom Light
          

First, create three variables to temporarily hold the light levels:

     Variable #1 = Family Room Level
     Variable #2 = Dining Room Level
     Variable #3 = Bedroom Level
          

Next, create the "All Lights On" macro with these commands in it:

     X-10 A-1 (Family Room Light) - Put Current Level Into Variable #1 (Family Room Level)   
     X-10 A-2 (Dining Room Light) - Put Current Level Into Variable #2 (Dining Room Level)   
     X-10 A-3 (Bedroom Light) - Put Current Level Into Variable #3 (Bedroom Level)   
     X-10: Transmit House Code 'A' ALL LIGHTS ON   
          

Finally, create the "Cancel All Lights On" macro with these commands:

     X-10 A-1 (Family Room Light) - Set To Level In Variable #1 (Family Room Level)  
     X-10 A-2 (Dining Room Light) - Set To Level In Variable #2 (Dining Room Level)  
     X-10 A-3 (Bedroom Light) - Set To Level In Variable #3 (Bedroom Level)
          

Here's how this works. The "All Lights On" macro first stores the initial light levels into the three variables, then turns them all on. When you later run the "Cancel All Lights On" macro, it will set the lights to the levels specified in the three variables, thereby putting them back where they were.

 

Technical Note

Different variable values are used to indicate the module's current state (On, Off, or Neutral), as follows:

bulletOff = 255
bulletNeutral = 254
bulletOn = 0 to 16 (depending on the light's level)

You don't have to be concerned with this if you use the "Put Current Level Into Variable ##" to get the current level and then use the "Set To Level In Variable ##" command.

 

Conclusion

As you expand your home's lighting system controls, you'll run into many other cases where you want to restore a light to a previous level. HomeVision provides this ability, allowing you to develop an elegant, professional lighting system.

 

Back Up Next

Last updated:
09 March 2012

Copyright 1996-2012, all rights reserved, by:
Custom Solutions, Inc.
1705 Canterbury Drive, Indialantic, FL 32903

HomeVision is a registered trademark of Custom Solutions, Inc.