X10 Community Forum

🖥️ActiveHome Pro => Plug-ins => Smart Macros => Topic started by: JJtech on April 15, 2009, 08:19:27 PM

Title: Very basic else is not working.
Post by: JJtech on April 15, 2009, 08:19:27 PM
After more years of programming than I care to admit, X10 seems to have done me in.  I canít for the life of me see why this isnít working.

Very simple:

If trigger L8 is on as well as flag 5, then clear flag 5 and turn on K9 else set flag 5 on and turn on K6. 

JPEGs attached.

Results:  First time (with flag 5 off), K6 turns on and flag 5 is set to on.  That part works as it should but from then on, both K6 and K9 turn on every time.

Am I going crazy here???

JJ

P.S.  I must be jinxed, now the forum is telling me my attachment is too large.  My jpeg is only 114 and 121 KB.  I will try to post the two jpegs separately.
Title: Re: Very basic else is not working.
Post by: JJtech on April 15, 2009, 08:20:03 PM
Here is the second screen shot.

JJ
Title: Re: Very basic else is not working.
Post by: Kramer Chins on April 15, 2009, 08:47:28 PM
Here is the second screen shot.

JJ


From what I see in your "Else Conditions" you have it set "If Flag 5 is OFF" and in your "Falg" settings you have it under "Set Flag" instead of "Clear Flag Set"....
Title: Re: Very basic else is not working.
Post by: JJtech on April 15, 2009, 09:24:20 PM
In the "else Turn on K6" macro, I only want to execute that macro if flag 5 under the conditions test is off.  If that is so, then I want to turn flag 5 on so that the next time the "Turn on K9" will execute.

The way it is written, it should flip flop from one to the other.  At least that is what I am shooting for.
Title: Re: Very basic else is not working.
Post by: Puck on April 16, 2009, 12:15:50 AM
Am I going crazy here???

Nope.

Move the set & clear flag statements so they occur after the Kx ON in each macro (IE make the set & clear the last thing you do in each macro). I have seen this before. "Smart" macros execute all elses if their conditions are satisfied; and sometimes one else macro starts to execute before it checks the conditions of other else macro, and sometimes the previous can set the conditions right for the latter.

Title: Re: Very basic else is not working.
Post by: -Bill- (of wgjohns.com) on April 16, 2009, 12:53:38 AM
JJtech,

May or may not apply, but since nobody else has mentioned it...

When testing macros, if you click on the macro in AHP, trigger conditions are ignored!

 >!
Title: Re: Very basic else is not working.
Post by: JJtech on April 16, 2009, 09:15:57 AM
Puck,

YOU ARE THE MAN!  That did it!  Is there some logical reason behind this that I missed or just a case of the high quality standard of the X10 code?

Thanks much!  I feel I have regained a small bit of my sanity back this morning!

Bill,

Thanks for you input.  No, I am executing the macro via a mini controller trip.

JJ
Title: Re: Very basic else is not working.
Post by: steven r on April 17, 2009, 02:37:03 PM
...Is there some logical reason behind this that I missed or just a case of the high quality standard of the X10 code?...
I'm don't see any logical reason so I suppose we have to attribute it to the high quality X10 programing code.

Personally I'd like to call it as I see it. A bug.  B:(