X10 Community Forum

🖥️ActiveHome Pro => ActiveHome Pro General => Topic started by: csnet on December 23, 2007, 09:52:12 PM

Title: Editing ahx files
Post by: csnet on December 23, 2007, 09:52:12 PM
I used advanced search to search for any existing topic about editing ahx files and could not find any.

Tonight I edited a backup copy of my main ahx file using NotePad by cutting and pasting to sort the rooms and macros in the order I want to see them displayed in the left pane of AHP.  That is, I cut and pasted XML tag thru XML end tag, such as <room> thru </room> and <macro> thru </macro>, making sure to keep the results within the existing <rooms> thru </rooms> and <macros> thru </macros> tags.

I opened the modified file with AHP and it did not seem to "mind" the edits and everything is sorted the way I want it to be.  Then I did some modifications and additions in AHP.  When I saved the changes, I noticed AHP had preserved the new order of the rooms and macros and assigned the next available ID numbers to the new modules and new room I had added, just as I had hoped.

So, while direct editing with NotePad on the XML ahx file seems to work fine so far and seems like a nice solution for anyone who has wanted a way to sort the left pane of AHP, does anyone know of any "gotchas" that happen when doing this kind of direct editing?

CAUTION:  If anyone wants to experiment with direct ahx file editing, be sure you do so on a COPY of your working and tested ahx file.  That way if anything goes wrong, you will always have the original file to fall back on.
Title: Re: Editing ahx files
Post by: Tuicemen on December 24, 2007, 09:04:26 AM
csnet:    There are other posts on editing AHX files with a text editor but they are usually buried deep in other threads( some very old)! I like the Idea of editing the rooms so they appear in order you wish as the first room I added has the least modules in it and AHP always defaults to that room!
I Gave you a helpful for that! Hopefully others will add their ideas here so all AHX edit ideas can be found in one thread!
Cheers & Happy Hollidays!
Title: Re: Editing ahx files
Post by: EL34 on December 24, 2007, 09:08:08 AM
I have edited my ahx file also.
It's nice to have the left pane in the order that you like.  ;D
Title: Re: Editing ahx files
Post by: csnet on December 24, 2007, 01:16:46 PM
Thanks for the kind words.

This morning I noticed in the interface that the irrigation timers that trigger L11 showed that they were triggering M3 instead.  They used to trigger M3, but I had edited the macro trigger in the interface a week ago to L11 and never noticed that the Timer section of the AHP interface never updated to reflect the change.  This trigger editing using the AHP interface was done before I started experimenting with editing the ahx file directly.

Showing M3 did not affect the CM15A operation because the timers did switch to triggering L11 when I changed the macro trigger, even though the interface states the timers are triggering M3. 

It looks like the trigger shown in parenthesis is cosmetic and does not affect operation, but it can be misleading.

I found the value behind the House Code/Unit Number shown in parenthesis is the integer value of 'timer address" in the <timers> section of the ahx file.  Starting at 0 for "A1", each house code is 16 digits and each unit number is a single digit, so to translate a house code to an timer address integer:

M is the 13th letter of the alphabet, so
M3 = (13 - 1) * 16 + (3 - 1) = 194

L is the 12th letter of the alphabet, so
L11 = (12 -1) * 16 + (11 - 1) = 186

One can add new timers using the interface and delete the old ones that show the wrong trigger, however, editing the "timer address" directly using NotePad will do the trick quickly.
Title: Re: Editing ahx files
Post by: EL34 on December 24, 2007, 04:47:02 PM
I have all my rooms nice and organized but I really would like to control the items under the rooms section in the left pane.

When I open AHP 3.204 the rooms, modules, macros, timer camera's and media section are all expanded.
I don't need the x10 modules, timers, camera and media sections expanded.

I only want my rooms and macros sections expanded and the rest of them colapsed.
Looked around for some sort of config file settings but couldn't find one.
Title: Re: Editing ahx files
Post by: csnet on December 24, 2007, 06:44:11 PM
I only want my rooms and macros sections expanded and the rest of them collapsed.
Looked around for some sort of config file settings but couldn't find one.

I couldn't find any config for that either.  Somehow, AHP remembers for the right pane the last room that was open or All Rooms if that was what was open.  Other than that, it seems to always open the same way, just as you say, with all items in the left pane expanded.
Title: Re: Editing ahx files
Post by: EL34 on December 25, 2007, 07:54:37 AM
Yeah, what a pain.  :D
I really don't need to see the x10 modules on the left pane.
Takes up way too much real estate and I have to colapse the left pane every time I open ahp
Title: Re: Editing ahx files
Post by: Dan Lawrence on December 25, 2007, 08:34:20 AM
I leave Active Home Pro the way it is.  The left pane is the room list the module list and the timer list, the right pane is where the modules appear in the rooms they are in. That's pretty much what Active Home did, and how most of the control software for the CP290 was.
Title: Re: Editing ahx files
Post by: EL34 on December 25, 2007, 09:20:45 AM
I am not trying to delete any left pane items.

I am just saying that there should be a way to save your screen display preferences.
If I want to have the left pane selections collapsed, AHP should remember the way I like my screen set up.
Title: Re: Editing ahx files
Post by: PierreP on January 04, 2008, 06:06:35 PM
Dear csnet and others
When I read this thread, I realized that I'm not alone to put order in macros(essential if macro call macro).
Then, I programmed a little utility software(48kb) that put order in rooms and macros.
I did it in the purpose to share it with you, but I don't know how to do.
If you have any suggestion, I will be glad to share it with you and I think you will appreciate.
Title: Re: Editing ahx files
Post by: Tuicemen on January 04, 2008, 06:50:10 PM
Dear csnet and others
When I read this thread, I realized that I'm not alone to put order in macros(essential if macro call macro).
Then, I programmed a little utility software(48kb) that put order in rooms and macros.
I did it in the purpose to share it with you, but I don't know how to do.
If you have any suggestion, I will be glad to share it with you and I think you will appreciate.
I always enjoy seeing other members creating programs for the others to use!
You could use one of the many free website hosting sites to make your program available!
I have limited space on mine at the moment but I might be able to host your program until you find a more permanent arrangement! ;) :D ;D
If you dig into my profile you'll find an e-mail address you can send the file to and I'll host it! ;)
Title: Re: Editing ahx files
Post by: csnet on January 04, 2008, 07:12:29 PM
Tuicemen, I have extra room and will be happy to host the file long term. 

Pierre, I have created a temporary email account that I will leave up until I receive your file or until it is found by spammers, whichever comes first   :)

PierreMail@csnetserver.com

I think your program will be a help to anyone who is not comfortable editing the file directly.
Title: Re: Editing ahx files
Post by: KDR on January 04, 2008, 08:50:29 PM
PierreP 2 thumbs up on your utility program  ;D

I also have space and would be happy to put a download link on my  Home Automation Chat Page    (http://www.bdshost.com/ac/)  (plug plug)

(http://www.bdshost.com/X10/lpup.gif)---(http://www.bdshost.com/X10/lpup.gif)---(http://www.bdshost.com/X10/lpup.gif)---(http://www.bdshost.com/X10/lpup.gif)---(http://www.bdshost.com/X10/lpup.gif)----KDR
Title: Re: Editing ahx files
Post by: csnet on January 05, 2008, 12:28:09 AM
Pierre, I got your email but only the readme.txt file was delivered, any exe was deleted by the mail server.  I replied to you, but I just got a delivery failure notice "Reason: Remote host said: 452 try later"

Please put all files needed in a zip file and try sending it again.   I will post a link to the zip file here after I move it to the web server. 

Thank-you!
Title: Re: Editing ahx files
Post by: PierreP on January 05, 2008, 10:46:26 AM
Link on EditAHX

http://pages.infinit.net/pppp/editahx.zip
Title: Re: Editing ahx files
Post by: Oldtimer on January 05, 2008, 11:44:31 AM
Link on EditAHX

http://pages.infinit.net/pppp/editahx.zip

I don't have the instruction file yet but I tried this on copies of my AHX files.

I get the following error:  "Runtime Error '91': Object variable or With Block variable not set" when I open them with the program.

This doesn't happen on the two sample files that came with AHP but only contain sample macros.
Title: Re: Editing ahx files
Post by: Tuicemen on January 05, 2008, 12:23:00 PM
I also get this error!
"Runtime Error '91': Object variable or With Block variable not set"
As soon as I try loading an ahx file!
I also found I could open a file if I had no macros which needed the iWitness, Myhouse or OnAlert Plug-ins so that may help narrow it down.
If I only had the SmartMacro plug-in utilized there was no problem loading the AHX file!
Title: Re: Editing ahx files
Post by: csnet on January 05, 2008, 12:56:04 PM
Thanks Pierre, great job! 

1/9/2008: To be sure the latest version is always downloaded, message edited to link EditAhx.zip file on Pierre's site only:

http://pages.infinit.net/pppp/editahx.zip

Title: Re: Editing ahx files
Post by: csnet on January 05, 2008, 01:17:30 PM
Pierre's program works with my AHX file.  I have all the plugins but I am only using smart macros with no references to the iWitness, Myhouse or OnAlert Plug-ins.

Tuicemen, Oldtimer, does manually sorting using NotePad a copy of the AHX file that references the iWitness, Myhouse or OnAlert Plug-ins work?

Title: Re: Editing ahx files
Post by: PierreP on January 05, 2008, 01:44:23 PM
Your comments are important
At this stage, bugs are normal
Everyone will edit AHX with EditAHX
Upgrades will coming soon
Title: Re: Editing ahx files
Post by: Tuicemen on January 05, 2008, 02:13:35 PM
csnet thanks for hosting PierrePs  program!
I haven't tested editing using note pad for one of the AHX files containing macros created with one of the other Plug-ins I just happened to notice that I could open and edit an old AHX file that I had used with only the SmartMacro Plug-in!
PierreP
Nice Job so Far! ;) You got a helpful from me, even with the minor bugs found!
I'll contine to play and see if I can narrow down whats causing the error.
It may only be only one plug-in that is messing things up! :(
Title: Re: Editing ahx files
Post by: Don N on January 05, 2008, 02:22:55 PM
csnet  ... I used Notepad to edit the placement of Rooms in the left pane of AHP.  I've been wanting to do that for some time.  Thanks for the encouragement to use Notepad.  I gave you a helpful.  Thanks.
Title: Re: Editing ahx files
Post by: Tuicemen on January 05, 2008, 03:07:51 PM
csnet: using Notepad to sort an AHX file which has macros created with all Plug-ins is not a problem!

PierreP I can  create simple macros with Iwitness and On Alert then use your program to
edit the AHX file. The problem seems to be the web plug-in MyHouse. I added a simple macro which started the server then tested and received the error "Runtime Error '91': Object variable or With Block variable not set" hope this help narrow things down! ;)
Title: Re: Editing ahx files
Post by: PierreP on January 05, 2008, 09:16:21 PM
Great thanks for Tuicemen
He helped me by sending a file.
I found that the using of some special sign like "&" causes trouble in XML file.

The first bug is fixed.

new version :  http://pages.infinit.net/pppp/editahx.zip

Who's next?
Title: Re: Editing ahx files
Post by: csnet on January 05, 2008, 09:36:47 PM
Thanks Pierre, links for the zip and exe in my message above now point to the new version.
Title: Re: Editing ahx files
Post by: Oldtimer on January 05, 2008, 10:57:18 PM
Great thanks for Tuicemen
He helped me by sending a file.
I found that the using of some special sign like "&" causes trouble in XML file.

The first bug is fixed.

new version :  http://pages.infinit.net/pppp/editahx.zip

Who's next?

Works fine now.  Thanks!

Gets a helpful from me.
Title: Re: Editing ahx files
Post by: Tuicemen on January 06, 2008, 09:07:48 AM

Great work PierreP!   ;)
Perhaps as users report what their doing (editing) with notepad and AHP you can add it to editahx! ;)
Keep Up the great work! ;) :D ;D
I've added a link to your program as well at my Active Home Pro Addons (http://www.angelfire.com/in2/ontkoi/X10AHP/index.html) page!
Title: Re: Editing ahx files
Post by: JMac on January 07, 2008, 05:03:44 PM
Merci, Pierre - this is a real help in room and macro organization !
Title: Re: Editing ahx files
Post by: steven r on January 07, 2008, 06:38:47 PM
Thanks PierreP for the very useful program!

I just added an 8th helpful to your score.
Title: Re: Editing ahx files
Post by: PierreP on January 09, 2008, 09:33:06 AM
ahx editor : editahx new release v1.1

http://pages.infinit.net/pppp/editahx.zip

Title: Re: Editing ahx files
Post by: Oldtimer on January 09, 2008, 04:58:13 PM
Pierre:

You ask what else you could add to your program.  You've done such a great job so far I hate to ask for anything more but, since you are really skilled with HTML coding, could you add a function that extracts the "Notes" from the AHX file,  strips off the HTML and puts them into a simple TXT file so we'd have them as part of our regular documentation.

The format would be simple.  Just a separate paragraph for each note with the name, house code and unit code for each note at the beginning of the paragraph in whatever order they already are in the note section of the AHX file.

Best,

Oldtimer
Title: Re: Editing ahx files
Post by: csnet on January 09, 2008, 05:26:53 PM
...the "Notes" from the AHX file...
I have seen references in other posts to "notes" and "macro notes" in regard to AHP but I have not found anywhere in AHP 3.206 to enter notes.

Are notes an option in another version of AHP or am I missing where they can be entered in AHP 3.206?
Title: Re: Editing ahx files
Post by: Tuicemen on January 09, 2008, 06:04:35 PM
...the "Notes" from the AHX file...
I have seen references in other posts to "notes" and "macro notes" in regard to AHP but I have not found anywhere in AHP 3.206 to enter notes.

Are notes an option in another version of AHP or am I missing where they can be entered in AHP 3.206?
In order to add notes in AHP click:
[/color][/b]
Title: Re: Editing ahx files
Post by: csnet on January 09, 2008, 06:25:56 PM
Thanks Tuiceman, those yellow stickys have been staring me in the face since day 1. 

Now I know they are not just decorations like the opening and closing door.  :)
Title: Re: Editing ahx files
Post by: Tuicemen on January 09, 2008, 07:01:49 PM
I had though there was a link posted for this in my Read Me First thread or Hints & Tips threads but it looks like I missed(forgot) this ! :-[
I'll get it added with a link to this thread! ;)
Title: Re: Editing ahx files
Post by: PierreP on January 09, 2008, 08:17:30 PM
editahx:
Timers list is a Tuicemen's suggestion
Extract notes is a Oldtimer's suggestion

Thanks guys for those great ideas.

new release again
editahx v1.2: http://pages.infinit.net/pppp/editahx.zip
Title: Re: Editing ahx files
Post by: Oldtimer on January 09, 2008, 09:40:19 PM
editahx:
Timers list is a Tuicemen's suggestion
Extract notes is a Oldtimer's suggestion

Thanks guys for those great ideas.

new release again
editahx v1.2: http://pages.infinit.net/pppp/editahx.zip


Both work fine!  The "Extract Notes" function is perfect.  Ever since I got AHP when it first came out I've used Notes but have always been frustrated there was no easy way to print them so they could be part of my overall documentation.  Now you've solved that problem and in a matter of hours!  Thank you!

Here are some hints for anyone new to using Notes in AHP.  Entering and editing the Notes requires some care.  If you type in too many characters or do too much editing inside AHP you risk bombing out AHP and losing what you've entered.  The trick is to copy and paste your text to and from Notepad and do all your editing in Notepad.  When you're done save your AHP file before going on to work on the next Note.  This allows you to enter and edit verbose notes.  Also, don't use quotation marks in your Notes.  Your Note text is already inside quotation marks in the AHX file and your additional quotation marks cause the AHP HTML validator to delete some of the text you enter as being invalid.

P.S. See PierreP's post below for other HTML reserved characters that you should avoid in your Notes.
Title: Re: Editing ahx files
Post by: steven r on January 09, 2008, 10:12:12 PM
...Thanks guys for those great ideas....
Thank you for such a great program. Being able to pull out the notes is a great feature.
Title: Re: Editing ahx files
Post by: PierreP on January 12, 2008, 02:50:21 PM
In XML protocol, 5 signs are reserved

' apostroph
" double quote
< little than
> greater than
& amperstand

We should avoid to use it in module names and notes.
Normally a program knows to deal with, but AHP didn't.
This was the cause of the first error on editahx.

I project to work on module notes editing for editahx. (Oldtimer will be happy)
One information is missing, maximum lenght accepted.
Oldtimer: What is the maximum characters number(approx), you put for one note?
Title: Re: Editing ahx files
Post by: Oldtimer on January 12, 2008, 08:54:47 PM

I project to work on module notes editing for editahx. (Oldtimer will be happy)
One information is missing, maximum lenght accepted.
Oldtimer: What is the maximum characters number(approx), you put for one note?


PierreP: I checked my Notes print out from your program and my longest note was 1100 characters although I might very well enter a longer one in the future now that your program is available.  Directly editing Notes in your program sounds like a lot of work to implement.  It is an interesting idea though and might be useful to a lot of people.  The problem I see is that it was very natural for me to add the notes to a module inside the context of AHP while I was doing program maintenance , even though I had to use NotePad, but it might not be so nautural to have to exit AHP to work on the notes and then restart AHP to go back and work on the program.
Title: Re: Editing ahx files
Post by: PierreP on January 16, 2008, 12:37:10 PM
I understand the Oldtimer's point of view,
but if someone needs to modify notes by editahx, it's now possible.
Create a notes report in HTML is an interesting feature too.

new version 1.3: http://pages.infinit.net/pppp/editahx.zip
Title: Re: Editing ahx files
Post by: steven r on January 16, 2008, 02:45:07 PM
..new version 1.3...
Wow it just get better & better. I am hoping that you settle on a format soon as I have to figure out the new layout each time.  ;) I do like having the link addresses listed in the about tab.

Now the "bad news". I found a bug. Version 1.3 copied the note comments from one module to another. In my case, one example was a comment I had for H14 also showed up for H5. My H5 doesn't have a comment in AHP.

I'll be glad to send you my ahx file if it will help in the debugging.
Title: Re: Editing ahx files
Post by: PierreP on January 16, 2008, 09:25:46 PM
Thank you to steven r for his collaboration.

The bug is fixed.
Title: Re: Editing ahx files
Post by: Oldtimer on January 16, 2008, 11:03:08 PM
Thank you to steven r for his collaboration.

The bug is fixed.

Pierre:

Your program continues to amaze me!  Using it I have now cleaned up my AHX file so it is professionaly organized and documented.  It's really great.  And, yes, I did use your Notes editor in a couple of places.  Came in very handy.  This is really a neat piece of work.

Now, one more thing in the Notes extracts, but only if it's really as straight forward as I think it is.  I believe as you read the file from top to bottom to produce the Notes, you pass the room names on your way.  As you do so could you add them to the extracts with a blank line before and after.  This would make the extracted Notes files much easier to read and understand.  Needless to say this is not a high priority.  What you've given us so far is quite useable.

Thanks very much for your hard, timely and creative efforts.
Title: Re: Editing ahx files
Post by: PierreP on January 17, 2008, 09:00:33 AM
Oldtimer:

It's more difficult for me to read and understand english that write program coding.
I have made some changes and I hope that this match your query.
If not, just to tell me and I will be glad to make other changes.

I need to know if you use text format for notes report,
if not, I will eliminate it, and just keep html format.
Title: Re: Editing ahx files
Post by: steven r on January 17, 2008, 10:23:07 AM
...It's more difficult for me to read and understand english that write program coding....
While it is apparent that English isn't your 1st language  ;) , I think you are doing a remarkable job. Definitely better than I could ever do with French. That said, if you would be open to some constructive criticism, in a couple places your program says "... was create". The correct way to express the past tense of "create" in English is "created" so from an English point of view it would be more correct to say "...was created". Personally I could care less and wouldn't of even mentioned it if you hadn't brought up the English topic.

By the way, I think you have set a forum record of having more "helpfuls" than posts.

Keep up the great work!
Title: Re: Editing ahx files
Post by: steven r on January 17, 2008, 10:26:29 AM
...I need to know if you use text format for notes report, if not, I will eliminate it, and just keep html format.
Html is easier to read but there are times when a text format is more useful for documentation.
Title: Re: Editing ahx files
Post by: PierreP on January 17, 2008, 01:58:14 PM
A new revision was created

Thanks Steven
Title: Re: Editing ahx files
Post by: Oldtimer on January 17, 2008, 03:22:32 PM
A new version was created

Thanks Steven

Pierre:

Works great with Room Names.  Much easier to read and comprehend.  Thank you.

I agree with Steven r that the TXT file is the more useful of the two.

Title: Re: Editing ahx files
Post by: Knightrider on January 20, 2008, 09:22:26 PM
Pierre,
something to think about.  this program would be cool if you added a feature that allowed you to extract module histories to a document.  I would love to record how long my furnace (H16) runs on a daily basis.
Title: Re: Editing ahx files
Post by: PierreP on January 21, 2008, 08:01:52 AM
Knightrider:
Unfortunately, this information is not in the AHX file. Sorry.
For the moment, the only way I know to consult history is to press F2 (activity monitor).
I admit you had a good suggestion.