X10 Community Forum

🖥️ActiveHome Pro => Plug-ins => Smart Macros => Topic started by: dave w on November 08, 2004, 09:51:16 AM

Title: Conditionals
Post by: dave w on November 08, 2004, 09:51:16 AM
Howdy
FYI
"ahp_conditions.exe" has problems. I can not
get it to run. It would not run at all on a
Sony Vaio running XP Home, and ran only once
on work machine running Windows 2000 Pro. On
subsequent openings of AHP
the "conditionals" plug in would not load.
Title: Re: Conditionals
Post by: dave w on November 10, 2004, 11:42:12 AM
Pay no attention to the man behind the
curtain, or in the previous post. Smartmacro
works well.
Title: Re: Conditionals
Post by: Mr. Automation on November 12, 2004, 02:25:59 PM
I'll second that! The Smart Macro plugin is
wonderful. Thanks X10!
Title: Re: Conditionals
Post by: ken on November 13, 2004, 10:24:00 AM
Mr. Automation exclaimed: "The Smart Macro
plugin is wonderful."

Can you please tell us how you insert a
conditional branch into a macro?

Many thanks.
Title: Re: Conditionals
Post by: mike on November 13, 2004, 10:42:52 AM
Did yooou have to purchase the smart macro
package?
Title: Re: Conditionals
Post by: ken on November 13, 2004, 02:03:50 PM
Mike; it depends.
Title: Re: Conditionals
Post by: mike on November 13, 2004, 02:36:48 PM
depends? on what?
Title: Re: Conditionals
Post by: ken on November 13, 2004, 02:52:59 PM
Mike; it depends on whether X10 send it to
you free or not.  I'm not trying to be
facetious.  There is a great deal of
conjecture going on about X10's criteria when
selecting who gets the freebie plug-in and
who doesn't.   I have no clue what that might
be.
Title: Re: Conditionals
Post by: nikko on November 13, 2004, 10:14:44 PM
Maybe I should go get a lotto ticket too?
I am beginning to feel the utter
frustration of a kid who's new toy came
without batteries...  (buy the way, someone
should tell us we need piles of AAA
batteries to get up and running...)

Or is that a plug-in too? (hee hee) I'm
trying to stay on the upbeat side of
this... but the macro thing has beaten me
with a stick. No OFF time for macros,
sheesh...?
Now I'm looking at the boxes and
considering how much effort to put
everything back... hmmmm... does the return
policy say everything has to be "in" its
original packaging, or "with" its original
packaging?
Title: Re: Conditionals
Post by: ken on November 14, 2004, 09:12:31 AM
Nikko wrote: "No OFF time for macros,
sheesh...?"

You need to create a second macro that is
triggered when you want the OFF sequence to
initiate.

For example, I have "Homelate" to turn on the
outside lights, delay, turn on hallway,
delay, turn on bedroom.  Then I have a 2nd
macro to reverse all that except without
delay because there would be no point.   They
are separate macros.  Each runs to completion
when it's triggered.  Macros do not keep
running after the final step is executed, nor
can you pass them parameters such as "Run
using ON command" and "Run using OFF command."

Hope that helps.
Title: Re: Conditionals
Post by: nikko on November 14, 2004, 04:00:25 PM
Let me try to clarify.. I want the Macro to
only operate between XX time and XX time.
The timer setting for the macro itself
allows me to start the macro at any givin
time, but neglects to allow me a time to
stop the macros from running. i.e a 5 step
macro (from on to off) that runs at any
time it is triggered between -say- dusk and
10:00. The program allows me to start it at
dusk +/- XX time, but there is no way to
set a cease macro at -say- 10:00.

Does that clarify what I'm talking about?
Title: Re: Conditionals
Post by: ken on November 14, 2004, 04:19:04 PM
Nikko wrote: "I want the Macro to only
operate between XX time and XX time."

The macro runs when triggered and exits or halts.

A2 ON
Delay 2 minute
A3 ON
Delay 5 minutes
A4 ON
Delay 3 minutes

Means the macro runs for 10 minutes, then
ends.  You cannot stop it while it's running.
Simply because the lights remain on does not
mean the macro is still running.  It means
the macro ended leaving them on.

Hope that helps.
Title: Re: Conditionals
Post by: nikko on November 15, 2004, 02:13:29 AM
I had intended to run another "mini timer
command" or simply an "Off" command for all
units (A1 and A2 in this case) at the "off
time" mentioned to insure any incomplete
macro sequences would not leave the lights
on.

B1 is my motion detector on front patio.
A1 is my patio light.
A2 is the entry hall light.

At dusk turn A1 ON; at 10:00pm turn A1 OFF -
(simple timer control for patio light)

Now I have created a macro that I want B1
to act as a motion detector activating A1
and A2 in following sequence (simplified):

B1 is trigger.
Turn On A1.
15 second delay.
Turn ON A2.
2 minute delay.
Turn OFF A1.
15 second delay.
Turn OFF A2.
{This Macro complete}

[Next B1 input will trigger same sequence
of events.]
Title: Re: Conditionals
Post by: nikko on November 15, 2004, 02:13:42 AM
Now this is where my problem is...

I want this macro to run from 10:00pm
(after dusk to 10:00 timer has completed
it's cycle) to dawn and not during the day.
The macro has a clock button which allows
you to "turn on" the macro at whatever time
you choose BUT there is no "turn off" macro
input, seems someone forgot to put in
the "off time" or even better "Do not run
this macro after XX time" selection... thus
eliminating the need for the "mini macro"
mentioned above.
Does that clarify what I'm talking about?

OK - now I know you are going to say - B1's
light sensor will prevent the macro from
being running after dawn; well, I have
disabled that feature because I want B1 to
transmit 24/7 to use the signal to also
sound a chime during the day (probably
another macro utilizing a different set of
parameters and time constraints)and
possibly other devices; i.e. camera,
backyard chime during certain hours, etc.

Didn't think it would be this hard to get
the problem solved, probably shouldn't have
posted the blasted thing to begin with...
Title: Re: Conditionals
Post by: ken on November 15, 2004, 09:02:33 AM
Nikko, I regret that I don't have the time to
do a full analysis of your programming
requirements.  But at first glace, can you
not simply code put a conditional in your B1
macro (triggered by the motion sensor) to
light A1 if it's between dawn&dusk, and to
chime otherwise?  Your motion sensor will be
active all the time, but it's triggering will
perform different functions depending on time
of day.

That basically exhausts the amount of time I
have for this.  Sorry.
Title: Re: Conditionals
Post by: Noam on November 15, 2004, 09:38:30 AM
Nikko -
The timer on the macros is used for setting
what time to run the macro (what time you
want to execute that sequence of events).
I think what you are trying to do is ENABLE
the macro during certain hours (ALLOW it ti
run if triggered during those hours).
Since the macro is just a list of commands,
the timer simply says "I want to run these
commands at this time"
Title: Re: Conditionals
Post by: mikeg on November 15, 2004, 02:16:46 PM
I hear what you are saying and I think I
know exactly what you are trying to do. I am
using the AHP software out of the box, and
am not at all successful at this either. I
am trying to accomplish the exact same thing
that you are trying. After reading some of
these posts, I have figured out that if you
buy a $49 plugin from X-10, you will have
the ability to program conditional macros.
IE... If it is between 6:00pm and 10:00pm
and motion is sensed, then turn on the light
for 10 minutes. If it is not between 6:00pn
and 10:00 pm then don't turn on the light at
all, regardless of motion sensing or not.
Here is what I am going to do. When I was
way younger, I was pretty good with basic. I
have found a book at Barnes and Noble
called "Learn Visual Basic in 24 hours". It
even comes with a limited version of the
visual basic program (you can also hit shift
F11 when in Microsoft word to start VB).
This way I will just write my own programs
and not be forced by X10 to pay extra for
products that should have come with the
package anyway.
Title: Re: Conditionals
Post by: nikko on November 15, 2004, 04:02:56 PM
Many thanks to all of you for your input!

I have ordered the conditional plug-in, and
hope that this is where my final solution
lies without the necessity of learning a
whole new language.
Title: Re: Conditionals
Post by: nikko on November 15, 2004, 04:02:56 PM
Many thanks to all of you for your input!

I have ordered the conditional plug-in, and
hope that this is where my final solution
lies without the necessity of learning a
whole new language.
Title: Re: Conditionals
Post by: paul warshawsky on November 15, 2004, 07:01:36 PM
MikeG:

The SDK works ONLY with VB .NET 2003
(several hundred dollars...)  It will not
work with a limited VB version (presumably
a student version for learning how to write
code.)  Furthermore the "VB" that opens
from Microsoft Office is VBA - Visual Basic
for Applications.  This allows you to write
code to work in Office Applications (i.e.
to automate process or perform complex
calculations.)  This will NOT run the SDK.

BTW: VB.NET is not anything like old
fashioned Basic - it really is a whole new
language.  I would not plan on being able
to be independant from AHP anytime soon.
Title: Re: Conditionals
Post by: nikko on November 16, 2004, 01:20:13 AM
Being a MAPS subscriber I have the latest
and greatest; and you are right.
I will use the add-on and let them do the
hard work for me.
I was very happy to see the latest update
fixed several of my other beefs too.

These guys are more on the ball than I
initially gave them credit for and I am
slowly becoming a X-10 appreciando....
Title: Re: Conditionals
Post by: mikeywebs on November 22, 2004, 09:02:20 PM
MikeG:

I am a programmer by profession, and I am
interested in what you find.  Right now, I
don't have the time to play, but if things
go well for others, I'll be jumping on your
bandwagon!
Title: Re: Conditionals
Post by: mikeywebs on November 22, 2004, 09:03:23 PM
MikeG:

I am a programmer by profession, and I am
interested in what you find.  Right now, I
don't have the time to play, but if things
go well for others, I'll be jumping on your
bandwagon!
Title: Re: Conditionals
Post by: mikeywebs on November 22, 2004, 09:03:32 PM
MikeG:

I am a programmer by profession, and I am
interested in what you find.  Right now, I
don't have the time to play, but if things
go well for others, I'll be jumping on your
bandwagon!