X10 Community Forum

🖥️ActiveHome Pro => Plug-ins => Smart Macros => Topic started by: PrimeGuild on March 31, 2008, 12:34:27 PM

Title: ELSE Macros...
Post by: PrimeGuild on March 31, 2008, 12:34:27 PM
Can someone enlighten me about the ELSE macros? From the interface they just appear like any other macros and don't really act as REAL ELSE Macros. People in here with programming knowledge might understand this better.

For example:

I design a Smart Macro to trigger between 1:00 PM and 3:00 PM (Condition 1) and only on Weekends (Condition 2). What I want to know is that if I design an ELSE Macro for the above Macro, then when will that ELSE Macro trigger?
Title: Re: ELSE Macros...
Post by: Puck on April 02, 2008, 11:20:40 AM
...when will that ELSE Macro trigger?

When any of the preceding macro conditions are not true.... theoretically. In some cases it can execute even if the preceding macro's conditions are true (SW bug); in these cases, the use of mutually exclusive conditions in all macros usually helps.
Title: Re: ELSE Macros...
Post by: martin on April 02, 2008, 05:20:58 PM
PrimeGuild,

If you have multiple "Elses", the macro will stop looking at alternative "Else" as soon as a condition is met. In your example, the macro would look for an "Else" option if it is not between 1:00 pm and 3:00pm during a weekday.

See one of my use of an "Else" macro where I toggle between my bed side lamp and read lamp with the same A15 On trigger. It does a full circle, same principle as a fan pull chain  :)

Title: Re: ELSE Macros...
Post by: Walt2 on April 02, 2008, 06:20:42 PM
Can someone enlighten me about the ELSE macros? From the interface they just appear like any other macros and don't really act as REAL ELSE Macros. People in here with programming knowledge might understand this better.

Yep, that has been exactly my experience.

One can't trust that they will only be executed if the "IF" is false.  So, all my "ESLE" macro re-check all conditions.  For example, if the "IF" executes when flag 1 is 'on',  I verify in the "ELSE" that flag 1 is indeed 'off'.

Maybe, someday, X10 will fix this bug.