What Are Flags?

From X10Wiki
Revision as of 22:09, 23 March 2006 by Ericb (Talk | contribs)

(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to: navigation, search


What do Flags do in SmartMacros?


Problems running macros in X10 SmartMacros Software are often related to transceived house codes. Go into Tools-->Hardware Configuration, and make sure that the House Code for the motion sensor or remote control in question is checked in the lower right corner of the screen. Also ensure that you run the Tools-->Download Timers and Macros command whenever you are done changing macros.

SmartMacros adds two features to ActiveHome Pro: macro conditions and flags. Without conditions, macros always run when the interface receives the macro’s On or Off command. Some sample conditions are:

"It`s Nighttime" or "It`s Daytime AND It`s Friday."

Flags add global variables into your macro set-up. In computer programming, a global variable is one that can be accessed from any context in a program. Basically, flags let macros communicate with each other.


Bob has a motion sensor that is programmed for B1. When he is home, he wants it to sound a chime whose house and unit code are A4. When he is away, he wants lights A5 and A6 to come on. Bob sets a Slimline Switch to B2-B4 and puts it near his door. He will press B2 On when he leaves and B2 Off when he gets back.

First, Bob goes into the Tools menu and selects Preferences. In the SmartMacros tab, he makes sure that Simple or Advanced is checked, not Wizard. Then Bob makes five macros:

Trigger // Condition(s) //==> Action(s)

B2 On // None //==> Set Flag 4 On B2 Off // None //==> Set Flag 4 Off

B1 On // If Flag 4 Is Off //==> Sound A4 Chime B1 On // If Flag 4 Is On //==> A5 Light On, A6 Light On B1 Off // If Flag 4 Is On //==> A5 Light Off, A6 Light Off

In this example, Bob has assigned a "meaning" to Flag 4: if flag 4 is on, Bob is away; if flag 4 is off, Bob is home.

Here is a more complex script to automatically record 3 cameras based on motion sensors and not stop until motion ceases on all three cameras:

A5 On // None //==> Set Flag 5 On, Start Video Recording, Switch to Cam B5 A6 On // None //==> Set Flag 6 On, Start Video Recording, Switch to Cam B6 A7 On // None //==> Set Flag 7 On, Start Video Recording, Switch to Cam B7

A5 Off // If Flags 6 and 7 are Off //==> Stop Video Recording, Set Flag 5 Off // ELSE If Flag 5 Is On// Set Flag 5 Off

A6 Off // If Flags 5 and 7 are Off //==> Stop Video Recording, Set Flag 6 Off // ELSE If Flag 6 Is On// Set Flag 6 Off

A7 Off // If Flags 5 and 6 are Off //==> Stop Video Recording, Set Flag 7 Off // ELSE If Flag 7 Is On// Set Flag 7 Off