X10 Community Forum

🖥️ActiveHome Pro => SDK => Topic started by: mrhoaf on May 12, 2006, 12:31:40 PM

Title: Command Line control with activehome PRO and CM15A
Post by: mrhoaf on May 12, 2006, 12:31:40 PM
I need to control 4 appliance modules from another program.  Is there any way I can turn a module on and off with a command line command?  I know this was possible with the older activehome, but I haven't found anything about this option in Pro.

heck, any way to control modules through the CM15A without the activehome pro interface would be a step in the right direction...
Title: Re: Command Line control with activehome PRO and CM15A
Post by: Dan Lawrence on May 12, 2006, 01:12:24 PM
Bill's X10 Voice Commander (http://www.wgjohns.com/bxvc.htm) allows voice control though AHP, but AHP doesn't have to be open.  It's freeware and pretty neat.
Title: Re: Command Line control with activehome PRO and CM15A
Post by: billy on May 12, 2006, 01:14:18 PM
Check out the SDK.
http://www.activehomepro.com/sdk/sdk-info.html


Title: Re: Command Line control with activehome PRO and CM15A
Post by: Tuicemen on May 12, 2006, 03:20:56 PM
As billy stated
QuoteCheck out the SDK.
http://www.activehomepro.com/sdk/sdk-info.html
syntax is <ahcmd><sendplc or sendrf><housecode & unitcode><ON or OFF>
Title: Re: Command Line control with activehome PRO and CM15A
Post by: mrhoaf on May 12, 2006, 04:53:51 PM
Quote from: Tuicemen on May 12, 2006, 03:20:56 PM
As billy stated
QuoteCheck out the SDK.
http://www.activehomepro.com/sdk/sdk-info.html
syntax is <ahcmd><sendplc or sendrf><housecode & unitcode><ON or OFF>

thanks!  That's exactly what I needed!
Title: Re: Command Line control with activehome PRO and CM15A
Post by: Tuicemen on May 12, 2006, 04:58:52 PM
Your welcome! ;) If you just want to turn off/on then you may not need the SDK ahcmd.exe is shipped and instaled with AHP in C:\Program Files\Common Files\X10\Common ;) :)
Title: Re: Command Line control with activehome PRO and CM15A
Post by: Dan Lawrence on May 12, 2006, 05:20:21 PM
Error: ahcmd.exe cannot be used as a command line program in XP. It does not recogize it, even with the syntax Billy posted.
Title: Re: Command Line control with activehome PRO and CM15A
Post by: Tuicemen on May 12, 2006, 05:24:52 PM
I have no problem using it! ;) :) Open a doss window in the folder AHCMD.exe is located then type the Syntax above It will work! or if your trying from a batch file make sure you point to the folder AHCMD is in. :)
Title: Re: Command Line control with activehome PRO and CM15A
Post by: Dan Lawrence on May 12, 2006, 10:23:55 PM
Still nothing, except "achmd is not recognized as a program, execuctable or batch file".
Title: Re: Command Line control with activehome PRO and CM15A
Post by: billy on May 12, 2006, 11:56:43 PM
Quote from: Dan Lawrence on May 12, 2006, 10:23:55 PM
Still nothing, except "achmd is not recognized as a program, execuctable or batch file".

Dan,

It should "ahcmd.exe" not achmd.exe", just remember Active Home Command.
Title: Re: Command Line control with activehome PRO and CM15A
Post by: Dan Lawrence on May 13, 2006, 09:04:44 AM
Same error message: "Ahcmd is not recognized as a program, executable, or batch file". It occors in both a command window or a full command screen.

O/S is XP Home SR2
Title: Re: Command Line control with activehome PRO and CM15A
Post by: billy on May 13, 2006, 10:09:32 AM
Dan,

1. Create a new folder "C:Test' or whatever name.
2. Goto C:Program FilesCommon FilesX10Common
3. Right click on the file "ahcmd.exe", select "Copy" from the menu.
4. Back in the "C:Test" window, right click in the open area of the window and select "Paste" NOT "Paste Shortcut".
5. Open a Command Prompt window. ( Start - Programs - Accessories - Command Prompt)
6. In the Command Prompt window type cd c:   est press (enter).
7. Type dir press (enter)
8. You should see ahcmd.exe with a size of 61,440.
9. Type ahcmd press (enter)  you should see expecting: {sendplc | sendrawplc | sendrf | queryplc}
10. Try a command.    ahcmd sendplc a1 on

Caution: queryplc does not work!

Good Luck!


Title: Re: Command Line control with activehome PRO and CM15A
Post by: specter333 on May 13, 2006, 05:18:02 PM
THANK YOU!  I finally figured out how to u se Realize Voice to control my X10 products.  Iââ,¬â,,¢ve read a lot of post and tried a lot of things over the past couple of weeks but I guess I was looking in the wrong place.

One question if you donââ,¬â,,¢t mind.  I understand that sendplc is send power line command,  sendrf is send radio frequency command but what is sendrawplc?

Thanks again.
Title: Re: Command Line control with activehome PRO and CM15A
Post by: Dan Lawrence on May 13, 2006, 06:09:56 PM
Quote from: billy on May 13, 2006, 10:09:32 AM
Dan,

1. Create a new folder "C:\Test' or whatever name.
2. Goto C:\Program Files\Common Files\X10\Common
3. Right click on the file "ahcmd.exe", select "Copy" from the menu.
4. Back in the "C:\Test" window, right click in the open area of the window and select "Paste" NOT "Paste Shortcut".
5. Open a Command Prompt window. ( Start - Programs - Accessories - Command Prompt)
6. In the Command Prompt window type cd c:\test press (enter).
7. Type dir press (enter)
8. You should see ahcmd.exe with a size of 61,440.
9. Type ahcmd press (enter)  you should see expecting: {sendplc | sendrawplc | sendrf | queryplc}
10. Try a command.    ahcmd sendplc a1 on




Caution: queryplc does not work!

Good Luck!





THAT WORKED!!!!!

I  presume that will also work with ahcmd in it's regular location, since it worked fine in the C:/Test location.
Title: Re: Command Line control with activehome PRO and CM15A
Post by: specter333 on May 14, 2006, 01:13:59 AM
I'm understanding the on, off, dim and bright commands but I'm not understading the presetdim command.  For instance what would be the presetdim command for a1 to 50%?

Thanks
Title: Re: Command Line control with activehome PRO and CM15A
Post by: Tuicemen on May 14, 2006, 04:04:54 PM
Quote from: Dan Lawrence on May 13, 2006, 06:09:56 PM

THAT WORKED!!!!!

I  presume that will also work with ahcmd in it's regular location, since it worked fine in the C:/Test location.
Yes! you have to tell the command prompt to go to the folder location where ahcmd.exe is Guess I wasn't clear enough about that! :-[
Title: Re: Command Line control with activehome PRO and CM15A
Post by: roger1818 on May 15, 2006, 04:19:14 PM
Quote from: specter333 on May 13, 2006, 05:18:02 PM
One question if you donââ,¬â,,¢t mind.  I understand that sendplc is send power line command,  sendrf is send radio frequency command but what is sendrawplc?

The thread Powerline Commands Applied to Many X10 Addresses!? (http://www.x10community.com/forums/index.php?topic=7860.msg48827#msg48827) gives a brief description of this command.

Quote from: specter333 on May 14, 2006, 01:13:59 AM
I'm understanding the on, off, dim and bright commands but I'm not understading the presetdim command.  For instance what would be the presetdim command for a1 to 50%?

Check out Using Pre-Set Dim (http://kbase.x10.com/wiki/Using_Pre-Set_Dim).  X10 never supported this command in any of their modules.  The 2-way lamp module uses an Extended Dim instead.
Title: Re: Command Line control with activehome PRO and CM15A
Post by: specter333 on May 15, 2006, 10:37:11 PM
Ok maybe Iââ,¬â,,¢m not looking at this the correct way.  As I understand it the dim (or bright) command dims by what percentage you assign it.  So if the command is dim 25% and the light is on full then it will dim to 75%.  If you use the command again the light will dim to 50% and so on. 


How do you send a command to dim or bright the light to 50% regardless of the current value?   So if the light is at 20% percent it brights to 50% or if the light is at 90 percent it dims to 50%.  Or do I have to set a relative value of 0% or 100% first in order to get the light to go to exactly 50% every time?

I've tried sending the code sendplc A3 ExtCode 31 1F to a lamp module but it does nothing.

I hope I'm making sense, i'm new to the programing side of this.  Thanks for the help.
Title: Re: Command Line control with activehome PRO and CM15A
Post by: billy on May 15, 2006, 11:26:20 PM

specter333,

You are correct the % is incremental from the current level. So my guess is you turn the light on to 100% then dim to 50%.
So your application would have to keep track of the light level.

Lamp modules do not use extended codes.


Title: Re: Command Line control with activehome PRO and CM15A
Post by: billy on May 15, 2006, 11:30:32 PM
Also the Dim ??% seems to be a PLC command only.
Light does not change using sendrf A1 Dim 50
Probably the same with the Bright command.
Title: Re: Command Line control with activehome PRO and CM15A
Post by: specter333 on May 16, 2006, 12:39:47 AM
Thatââ,¬â,,¢s disappointing but not the worst thing.  Weird thing I have noticed with what I hoped would be a temporary work around. 

I set my lights off command to dim 100% instead of off so it will fade up to 50% instead of going full and then dimming down.  Then if I want my lights at 50% I say lights to half when they are off and dim lights when they are on.  When I fade up from 0% to 50% my lights are quite a bit brighter than when I fade down from 100%.   To counter this I just dim up to 40%. 

Thanks for your help.
Title: Re: Command Line control with activehome PRO and CM15A
Post by: specter333 on May 16, 2006, 12:42:37 AM
Something I just thought of, does Billââ,¬â,,¢s X10 voice command do the dim/bright to 50% like weââ,¬â,,¢ve been discussing?
Title: Re: Command Line control with activehome PRO and CM15A
Post by: roger1818 on May 16, 2006, 09:44:42 AM
Quote from: billy on May 15, 2006, 11:26:20 PM
You are correct the % is incremental from the current level. So my guess is you turn the light on to 100% then dim to 50%.
So your application would have to keep track of the light level.

Lamp modules do not use extended codes.

Billy is correct on both accounts.  It is a limitation of the cheap lamp modules (you get what you pay for).  That is why ActiveHome Pro will brighten the module to 100% first and then dim by the appropriate amount.  Most other brands of lamp modules will support either the old PresetDim or the new Extended Dim (and as I said earlier the X10 brand 2-way modules support the Extended Dim).
Title: Re: Command Line control with activehome PRO and CM15A
Post by: -Bill- (of wgjohns.com) on June 09, 2006, 12:36:57 AM
Quote from: specter333 on May 16, 2006, 12:42:37 AM
Something I just thought of, does Billââ,¬â,,¢s X10 voice command do the dim/bright to 50% like weââ,¬â,,¢ve been discussing?
Yes, BXVC does.  The way I chose to do it is as follows:
1) Always issue dim 100
2) If the requested level is 0 (zero) you're done
3) If the requested level is greater than 0 (zero) issue bright (requested level)

So to set module A1 to 50% brightness, issue:
A1 dim 100
A1 bright 50

Hope that helps;
-Bill-