X10 Community Forum

🖥️ActiveHome Pro => Smart Macros => Plug-ins => User-Designed Working Macros => Topic started by: BernieB on November 28, 2010, 09:28:46 AM

Title: Need Help with Active home used in a model railraod
Post by: BernieB on November 28, 2010, 09:28:46 AM
I just bought the active home software and the PC interface. I have a model railroad and have 8 units that are in a group of 5 and a group of 3. I want to run 1 unit from each group for 1 minute and then go the next unit in the group. This will only work when power is applied to each unit. Is there an easy way to program this or do I need to program each group using a giant macro for an entire 24 hour time?
Title: Re: Need Help with Active home used in a model railraod
Post by: Brian H on November 28, 2010, 09:37:09 AM
What X10 modules are you using to control the railroad setup?
Title: Re: Need Help with Active home used in a model railraod
Post by: BernieB on November 28, 2010, 10:29:32 AM
All appliance modules. Only off and on- no dimming
Title: Re: Need Help with Active home used in a model railraod
Post by: Tuicemen on November 28, 2010, 11:24:55 AM
Do you want this to run  24 /7 ?
You may need to create a looping macro.
 >!
Title: Re: Need Help with Active home used in a model railraod
Post by: BernieB on November 28, 2010, 11:49:05 AM
The lamp modules will be plugged into outlets that only will be powered when the set is on. The contoller will be powered 24/7. Can I do it with an on off-on off-on off repeat?
Title: Re: Need Help with Active home used in a model railraod
Post by: BernieB on November 28, 2010, 11:49:41 AM
I meant applicance module.
Title: Re: Need Help with Active home used in a model railraod
Post by: Tuicemen on November 28, 2010, 12:32:46 PM
Macros can run for a 4 & 1/2 hour time span if you wish your set to run longer then that you may need it to loop.
However you'll need the smartmacro plug-in so you can set some conditions to stop the looping.
Either way it is possible!
You would want to use a Phantom module as the macro trigger, not one of the modules in your railroad set up.
Title: Re: Need Help with Active home used in a model railraod
Post by: BernieB on November 28, 2010, 12:49:50 PM
The time limit isn't an issue. I assume I have to send some signal from a remote to start everything and then would have a macro like:

Macro for unit #1:
Start appliance #1
Delay 1 minute
Off Appliance #1
Delay 5 seconds
Off Appliance #1
Run unit #2

After they all run, the last line of the last macro would call Macro #1.


If that is all correct, how do I do what I want. I'm a newbee and have no idea as the software instructions are awful
Title: Re: Need Help with Active home used in a model railraod
Post by: Tuicemen on November 28, 2010, 01:02:20 PM
You don't want to call macro as the last part of the macro that turns it into a looping macro which would require flags or other conditions.
Do you have the SmartMacro  Plug-in?
Title: Re: Need Help with Active home used in a model railraod
Post by: BernieB on November 28, 2010, 01:49:29 PM
I have the smart macro plug in.
Title: Re: Need Help with Active home used in a model railraod
Post by: Tuicemen on November 28, 2010, 05:33:37 PM
I have the smart macro plug in.
Ok read this Thread (http://forums.x10.com/index.php?topic=14912.0) by steven r it explains how to setup a looping macro.
 >!
Title: Re: Need Help with Active home used in a model railraod
Post by: Noam on November 29, 2010, 10:12:38 AM
Here's a basic way to do it, using a few macros that call each other:

This is the setup for one of the groups, but you would set the other one up the same way.
In this example, the trains are on modules L1 to L5, and the macros are on M1-M5.

Macro M1 On:
    If Flag 2 is on then (Allows for breaking out of the macro loop - explained below)
        L1 On (turns train on)
        Delay 1 minute
        L1 Off (turns train off)
        M2 On (calls next macro)
   End of Macro

Macro M2 On:
    If Flag 2 is on then
        L2 On
        Delay 1 minute
        L2 Off
        M3 On
   End of Macro

Macro M3 On:
    If Flag 2 is on then
        L3 On
        Delay 1 minute
        L3 Off
        M4 On
   End of Macro

Macro M4 On:
    If Flag 2 is on then
        L4 On
        Delay 1 minute
        L4 Off
        M5 On
   End of Macro

Macro M5 On:
    If Flag 2 is on then
        L5 On
        Delay 1 minute
        L5 Off
        M1 On (calls first macro in the sequence, starting the loop over again)
   End of Macro

You can create separate macros to turn on and off Flag 2 (It has been suggested to avoid using Flag 1 as it has been unreliable in the past). Turning off Flag 2 will stop the sequence when the currently running macro ends (since the next one will start, see the flag is off, and stop). You can restart the chain at any point by turning the flag back on, and starting any one of the 5 macros. You can also run each train manually using their L# addresses.

You can add a condition (such as time of day or day of the week), if you want.

The other set would be done the same way, just using a different flag (if you want to operate them independently of each other - so stopping one doesn't stop the other one), and a different set of macros (L6-L8 and M6-M8, for example).

I hope that was pretty clear.