X10 Community Forum

🖥️ActiveHome Pro => Plug-ins => Smart Macros => Topic started by: bitman on February 26, 2009, 10:24:36 AM

Title: More than one "AND" condition?
Post by: bitman on February 26, 2009, 10:24:36 AM
In a smart macro, I am testing these conditions:

IF The day of the week is Thursday *AND* the time is between 5:00am and 11:00am
Execute statements.....


I need to add another AND like so:

IF The day of the week is Thursday *AND* the time is between 5:00am and 11:00am *AND* module D1 is OFF
Execute statements.....

How can I do this?

It looks like the GUI in AHP will only permit 1 AND. Can I edit the XML to make it happen? (Seems dangerous and klugy to do so.)

Thanks in advance,

:Ron



Title: Re: More than one "AND" condition?
Post by: Puck on February 26, 2009, 02:22:33 PM
It looks like the GUI in AHP will only permit 1 AND.

AHP will allow two ANDs (I.E. 3 conditions). Unfortunately the time condition you are applying uses up 2 conditions (internally); this is why you can only see one AND.

One method would be to set up a timer to turn a status flag on during that time frame each day (or just on the Thursday). Then you can use that flag as one of the conditions along with the D1 module status (assuming D is your monitored house code).
Title: Re: More than one "AND" condition?
Post by: bitman on February 26, 2009, 02:29:48 PM
Seems pretty prehistoric BUT, it's better than the way we had.  :'
Title: Re: More than one "AND" condition?
Post by: Puck on February 26, 2009, 02:55:24 PM
Seems pretty prehistoric...

Not sure what you mean by prehistoric. Work arounds are never the ideal solution, but they are sometimes necessary when you have no control over the hardware and software you use. I'm sure there are other work arounds to accomplish the same task; there may even be a 21st century one out there.  ;)
Title: Re: More than one "AND" condition?
Post by: steven r on February 26, 2009, 03:11:44 PM
I suppose if you had to have 3 "AND" conditions or some other multiple condition situation take didn't have another work around, you could chain a couple macros. i.e. If the conditions were met in the first macro, it could "call" a 2nd conditional macro.
Title: Re: More than one "AND" condition?
Post by: bitman on February 26, 2009, 04:25:49 PM
Seems pretty prehistoric...

Not sure what you mean by prehistoric. Work arounds are never the ideal solution, but they are sometimes necessary when you have no control over the hardware and software you use. I'm sure there are other work arounds to accomplish the same task; there may even be a 21st century one out there.  ;)


Oh thier silly limited "Advanced Macros".
Coming from the C lanuage where I can make whatever spaghetti code I want to, this coding style and limitations seems older than BASIC. 
Title: Re: More than one "AND" condition?
Post by: bitman on February 26, 2009, 08:25:22 PM
Lost in all my frustration with being limited to any amount of conditions is:

Thank you all for your help!  >!
Title: Re: More than one "AND" condition?
Post by: bitman on February 26, 2009, 08:37:35 PM
Wow.

Now I think I understand what the "Monitored House Code" is. And why if the cm15a can address all house codes, are we limited to testing the state of a module on just one house code? That doesn't seem right.

I was able to overcome the AND problem by changing the time range to Thursday before 10:00am.
And now I see whay we are warned about the fact that some of the conditions we can pick say (requires two steps). I shoulda known something was up.  ::)

Title: Re: More than one "AND" condition?
Post by: Knightrider on February 26, 2009, 08:53:14 PM
Ron,
You could always download the SDK and write your own app with as many "and"s as you want.
Title: Re: More than one "AND" condition?
Post by: bitman on February 26, 2009, 09:48:06 PM
Ron,
You could always download the SDK and write your own app with as many "and"s as you want.

That seems a little smart alecky.
I'm not used to that from you Knight.  ;D

I'm sorry if I was out of line. I did acknowledge that it is better than before.
If we don't whine at least a little bit , AHP won't improve.

 
Title: Re: More than one "AND" condition?
Post by: Knightrider on February 26, 2009, 09:55:05 PM

I'm sorry if I was out of line. I did acknowledge that it is better than before.
If we don't whine at least a little bit , AHP won't improve.

 

Nope, not out of line at all.  I'm just now making progress with the SDK myself and realizing that the possibilities are endless.
Sad, but true,  I foresee X10 totally revamping (maybe I'm dreaming) the software.  Maybe some issues on the "Wish List" will be resolved.
Title: Re: More than one "AND" condition?
Post by: HA Dave on February 26, 2009, 10:09:47 PM
.......... I'm just now making progress with the SDK myself and realizing that the possibilities are endless.

I've been saying that for some time now! [see below]