X10 Community Forum

🖥️ActiveHome Pro => Plug-ins => Smart Macros => Topic started by: narinesa on July 01, 2008, 11:12:32 AM

Title: Basic Macro
Post by: narinesa on July 01, 2008, 11:12:32 AM
I am using active home pro.
I am looking for A1 to control A2.
New at this. Can't get it to work.
I want a basic macro.

When A1 is ON
Turn ON A2
Wait 1 minute
Turn OFF A2 OR Turn OFF A2 when A1 is off.

Any suggestions in laymans terms ?
Title: Re: Basic Macro
Post by: steven r on July 01, 2008, 11:49:45 AM
You pretty much drop and drag the commands to create the macros. You may need more than 1 macro to do what you want to do.
Let's see if I understand what you want to do.
Do you pretty much want A2 to act as a slave to A1?
i.e. When A1 comes on A2 comes on as well as when A1 goes off A2 goes off. In addition you want A2 to turn off a minute after it comes on from an A2 on trigger.
Sounds like 2 simple macros but that could change based on how you answer these questions.

Title: Re: Basic Macro
Post by: narinesa on July 02, 2008, 08:48:01 PM
Yes, I want A2 to act as a slave for A1.

A1 is an outdoor Light PR511? So is A2 (but only A1 will have movement).

I would like to see the actual text macro statement so that I can compare same with my design.

I want to make 2 changes.
When A1 comes on, check if A2 is already on, if on ignore.
Also send the off signal when A1 is off.

(In summary, I want A2 to act as a slave for A1 but check if A2 is already on. Remove 1 minute off timer).
Title: Re: Basic Macro
Post by: steven r on July 12, 2008, 04:58:46 PM
Sorry to leave you hanging.

...I want to make 2 changes.
When A1 comes on, check if A2 is already on, if on ignore.
Also send the off signal when A1 is off....
It would actually be redundant and possibly unreliable to set up else programing to check the A2 status for your application.
As I understand you want your A2 to be the same status as the PR511. On if On and Off if Off, right?
If the PR511 is on then you want the A2 on and visa-versa so why bother checking the status of A2 just send an ON when the PR511 turns ON and visa-versa.
The ability to use macros for this also depends on whether an A1 line signal is actually sent by the PR511.

Also there is a much easier approach to your problem that doesn't even use macros! Let the PR511 do it for you!
Looking at page 11 of the online manual shows how to slave up to 4 other devices to the PR511 by just flipping a few switches.
Title: Re: Basic Macro
Post by: narinesa on July 13, 2008, 10:54:09 AM
OK, Can we start over ?

I have 2 PR511 - A1 and A2
They are both at different locations.
I want each to control the other.

Based upon the instructions in the PR511 booklet, I can set the switches for A1 to control A2 BUT NOT VISA VERSA.

I understand that I need a macro for A2 to control A1.

Again, I already 1 half working - A1 is controlling the A2 - now I need the A2 to control A1 .
Title: Re: Basic Macro
Post by: steven r on July 13, 2008, 01:46:54 PM
Ok that adds a dangerous twist to things. While basic macros would be simple it would create an endless loop of A1 turning on A2 turning on A1... etc. I see now why you wanted to test the lighting state.
Let me give this some thought and see if I can think of a way to use flags and/or elses to keep from getting locked in an endless loop.
Are you sure can't just wait till your potential burglar walks around to the next light.  :)

I have an idea as to how I'd do it but give me a bit of time to write it up. (I'm headed to a meeting now.) We may need to use a flag or two.
PM me again if I let it slip.

In the meantime, let me know if an A1 signal is sent from the A1 PR511 when it is triggered and what your time out is for your lights. Also is HC "A" your monitored code? Might be able to avoid using flags if it is. Do any other devices use the HC "A"? If not, I might have an easy solution.
Title: Re: Basic Macro
Post by: narinesa on July 13, 2008, 08:04:06 PM
Currently, A1 is sending an ON and OFF signal to A2 as per PR511 settings - perfect slave.
A3 is a bell (is always goes into alarm when I start up Active HomePro)
Too bad that the bell works nights only because I have shut off the lights in the day.
Just 3 devices on code "A" (Can be moved if necessary)
Primary HC is "D"
Title: Re: Basic Macro
Post by: steven r on July 14, 2008, 01:07:09 AM
If the two lights can be the only lights or appliances on the HC A the easiest thing would be to have macros that sent an All Lights ON for HC A anytime "A1 ON" or "A2 ON" is sent and a All Units OFF anytime "A1 OFF" or "A2 OFF" is sent.
Title: Re: Basic Macro
Post by: steven r on July 14, 2008, 02:08:41 PM
If your PR511 that is set to A2 sends an "A2 ON" and an "A2 OFF"* when triggered, then these two one line macros are the easiest way to do what you want top do.

A2 ON
House Code A All Lights On**

A2 OFF
House Code A All Units Off

Note: You may need to create a dummy appliance module set as A2. Just having the PR511 device may eliminate the need but it doesn't hurt to set up dummy module for any macros that you want to call.

Since this turns on all the lights that are on HC A, you could also have other lights indoors that are triggered also. The macros could also be enhanced to flash the lights also.

You can make a similar pair for A1 also or let the hardware do it for you.

*If not, then we'll need to modify them slightly.
**DO NOT USE AN "A1 ON" HERE. If could start an endless macro loop.
Title: Re: Basic Macro
Post by: narinesa on July 23, 2008, 03:13:01 PM
I have to give it up.
I could not compare my macro text with your text.
I don't know what I am doing.
Thanks for you assistance.
Title: Re: Basic Macro
Post by: steven r on July 23, 2008, 05:35:07 PM
I'm working on a sample ahx file for you. If I succeed, I'll need a way to send you the file. PM me an email (don't post it here) where I can send it.

I don't have a PR511 myself and assumed it would respond to an All Lights On. At least in my virtual world of AHP that doesn't seem to be the case. Do you have a way to send an All Lights On for HC A? How about an All Units Off for HC A? I'd be interested in how a real world PR511 responds.

If they don't respond to an All Lights On, it will complicate things a bit but not make them impossible. Most likely we'll have to use flags.

I also need to know if the A1 PR511 sends an "A1 On" when triggered and like wise for the A2 PR511. Again for the simple  approach, I'm hoping they do but I think I have a way around that obstacle if it presents itself.
Title: Re: Basic Macro
Post by: HA Dave on July 23, 2008, 06:58:51 PM

I don't have a PR511 myself and assumed it would respond to an All Lights On. At least in my virtual world of AHP that doesn't seem to be the case. Do you have a way to send an All Lights On for HC A? How about an All Units Off for HC A? I'd be interested in how a real world PR511 responds.


They do respond to the all lights ON / Off. I was pleasantly surprised when I found out I could flash the outside flood with my DS7000.


I also need to know if the A1 PR511 sends an "A1 On" when triggered and like wise for the A2 PR511. Again for the simple  approach, I'm hoping they do but I think I have a way around that obstacle if it presents itself.

No..... if by triggered you mean... will an All Lights ON cause a floodlight (addressed at H/U A-1) to do anything OTHER than turn on.... it won't. When trigger with MOTION the floodlight can trigger up to 4 other units (on the same house code) but not on it's OWN H/U code.
Title: Re: Basic Macro
Post by: steven r on July 23, 2008, 07:52:19 PM
Thanks Dave.

In my sample ahx file the PR511 module I programed is not switching on when my macro sends an "All Lights On". My idea is to turn on the other light with the All Light On command and avoid a possible macro loop that could be caused by an the On command.

In his situation, if you sent an A1 On command would the A1 PR511 send back a hardware signal to turn A2 on or does this only happen when A1 is triggered? Also does the PR511 send it's HC when triggered? i.e. When his A2 PR511 is triggered does it send an "A2 ON" signal. Likewise an "A2 OFF" when it times out?

I'm trying to solve his problem in the simplest manor posible, ideally without complicated macros. While they're fun to build, it's better to KISS when possible.

Title: Re: Basic Macro
Post by: HA Dave on July 23, 2008, 07:58:59 PM

In his situation, if you sent an A1 On command would the A1 PR511 send back a hardware signal to turn A2 on or does this only happen when A1 is triggered?


When the PR511 is turned ON by a X10 PLC the light will turn ON ONLY.... NO additional unit code signals (programed to be sent when motion is detected) will be sent.
Title: Re: Basic Macro
Post by: steven r on July 23, 2008, 08:11:57 PM
When the PR511 is turned ON by a X10 PLC the light will turn ON ONLY.... NO additional unit code signals (programed to be sent when motion is detected) will be sent.
That could make things even easier.
He could let his A1 PR511 do a hardware trigger to turn on his A2 PR511 and use an "A2 ON" macro* to turn on A1. Of course it gets a bit more confusing when you want to make sure they turn off.  :)

*This of course depends on the A2 PR511 sending an "A2 ON" when triggered. Otherwise it gets a bit more tricky.

Went back and reread your post. So it doesn't send a code for itself. Well I guess I have to go with plan B. If I understand correctly, his A2 PR511 can only send signals to A3, A4, A5, & A6. Right?
Title: Re: Basic Macro
Post by: HA Dave on July 23, 2008, 08:33:02 PM
Went back and reread your post. So it doesn't send a code for itself. Well I guess I have to go with plan B. If I understand correctly, his A2 PR511 can only send signals to A3, A4, A5, & A6. Right?

Correct sorta... the motion will cause up to +4 unit codes. DUSK also will allow 4 codes... +4 through +8.

If I was writting the macro (and setting up the floodlights) I wouldn't  (would NOT) put them on the same house code at all. Those codes are handy... but for an AHP macro... they just confuse things.
Title: Re: Basic Macro
Post by: narinesa on July 23, 2008, 08:49:19 PM
A1 will triger itself plus 4 other devices below A1. That is it can trigger A2,A3,A4,A5 via hardware switches.
It will also triger A2 on and off - perfect.

A2 will triger itself plus 4 other devices below A2. That is it can trigger A3,A4,A5,A6 via hardware switches.

A2 cannot trigger A1. It cannot go backward - only forward.

I want A2 to trigger A1 - which has to be done via a macro.
I am new to the macro.
Title: Re: Basic Macro
Post by: HA Dave on July 23, 2008, 09:24:43 PM

I want A2 to trigger A1 - which has to be done via a macro.
I am new to the macro.


Don't forget.... for every macro ON... you will likely need a macro OFF.
Title: Re: Basic Macro
Post by: spam4us on July 24, 2008, 12:27:05 AM
You guys give me a headache. :o LOL
Here's my version without using any macros at all.

Get 1 WS467

Hardwire both the floodlights to it. (or get 2 ws467 and hardwire each floodlight to it's own ws467) Take the "eye" off of the PR511 and have it wired into an electric box as a stand alone sensor.  Set the WS467 to A1.  Set the PR511 to A16 and then set the +1 switch to the "in" position. 

When motion is detected, the PR511 will send an on command to A1 and your lights will come on.  When the off command is sent, your light (A1) go off.

Just to answer the anticipated question.......Yes this works because the PR511 has enough logic built in so that it will add +1 to 16 to get 1. you can even have lights 2,3,4 come on as well.

Here's a PR511 pic
http://kbase.x10.com/images/5/5c/PR511A.jpg

Now if you want to write a macro, you could put the ws467s on lets say g1.  Then the "a1 on" triggered by the Pr511 sensor would trigger a macro that turned on G1 (WS467).



Title: Re: Basic Macro
Post by: HA Dave on July 24, 2008, 09:30:23 AM
...... Here's my version without using any macros at all.

Or a even simpler way is use the Leviton brand (X10) floodlights (http://www.smarthome.com/4082.html). Multiple units can operate as one system, when one unit detects motion all units on same code turn on at the same time.