X10 Community Forum

🖥️ActiveHome Pro => Plug-ins => Smart Macros => Topic started by: Jordi on March 04, 2006, 04:16:17 PM

Title: Copying macros
Post by: Jordi on March 04, 2006, 04:16:17 PM
I have several long macros that are very similar with only one or two items that have changed.  So far, I have not found a way to copy a macro and change only the modules that need to be changed, I have to recreate them from scratch.

Is there a way to copy a macro?

Thanks,
  Jordi
Title: Re: Copying macros
Post by: popnowlin on March 04, 2006, 10:49:09 PM
As far as I can tell there's no way to do this in the activehome program.  However your activehome definitions are in a .ahx file.  This is simply XML.  If you can read HTML you can read XML.

WARNING: please make a backup copy of your main .ahx file before trying to edit it.  If you're not sure how to make a backup, and then use it if something goes wrong with your editing, then don't try this.

I've been able to copy and rearrange the macros and rooms in my activehome .ahx file with a simple text editor like wordpad or my favorite vim (http://www.vim.org/).  You have to do some mapping of ID's defined in the file to make sure you get what you want but if you have a macro that is almost exactly like what you want you have a template to start from.

I've only manipulated macros and rooms with a text editor but I've had no problems.  It would be nice if I could find a copy of the DTD file to go with the XML in the .ahx file, and in the XML files used to save configuration information.  That would make editing them easier.  The configuration file is particularly frustrating since some of the configuration values don't stick and I suspect a DTD problem.  The haven't touched the .ahx sections on timers and other properties.  Without the DTD as a road map it would be too easy to mess things up.

Mostly I've used this to rearrange the order of things in my system.  Macros and rooms are always in the order you create them and I have 44 macros in 10 rooms in my house.  When I add something new I like to rearrange things to be in a logical order rather than the order in which I thought of them, which is not necessarily logical :-)
Title: Re: Copying macros
Post by: Tony Olson on March 05, 2006, 07:31:23 AM
This is just the type of feature (copying macros) that should be added to future releases. I  would think this could apply to (detailed) Timers as well as macros.

Tony
Title: Re: Copying macros
Post by: Jordi on March 05, 2006, 07:45:41 PM
Thanks for the info popnowlin.  I will take a look at the xml file.  It does seem that copying macros would be a standard feature.
Title: Re: Copying macros
Post by: X10 Pro on March 06, 2006, 12:23:45 PM
I'll add this to our list of requested features.
Title: Re: Copying macros
Post by: Tony Olson on March 06, 2006, 04:33:17 PM
Thanks X10 Pro!
Title: Re: Copying macros
Post by: hostilejava on December 21, 2006, 01:48:45 AM
This still would be a great feature to have  ;)  I have 5 KR10A's all that I'd like to assign the same two macro's to for the Lights On and Lights Off commands.  I'm sure I"ll end up doing it by hand for now, but it would be nice to just be able to copy and past these macro's then assign the proper security trigger.
Title: Re: Copying macros
Post by: JMac on December 21, 2006, 08:26:49 AM
It also would be nice to be able to add comments to the macro report.  ie, explanations of just what the macros do!
Title: Re: Copying macros
Post by: steven r on December 21, 2006, 10:42:01 AM
I too think this would be a useful feature. It would be good if it copied / opened the macro into edit mode forcing you to save the new macro and hopefully making changes first. I can forsee a lot of potential problems if AHP just let you make identical macro copies at the click of a button. Maybe the easiest way to handle it would be a "save as new macro" option when editing a macro.
Title: Re: Copying macros
Post by: steven r on December 21, 2006, 10:45:45 AM
It also would be nice to be able to add comments to the macro report.  ie, explanations of just what the macros do!
Descriptive flag comments would be nice also.

Should this topic be split / moved to a suggestion forum?