Hotkeys for activehome? and batchfiles

Started by Chargin, November 10, 2010, 07:55:40 PM

Previous topic - Next topic

Chargin

2 part question.
Firstly is there any sort of inbuilt hotkey setup in activehome?

Secondly how do I get batchfiles to work?

I made a bat with this

START "C:\Documents and Settings\SS\Desktop\lamps.EXE"

Lamps exe is just a shortcut a la

"C:\Program Files\Home Control\x10comm.EXE" a3 on

The shortcut works fine when I click it but when its called via a bat file it doesnt work.
Would a better way be to make a bat file that looks like this

"C:\Program Files\Home Control\x10comm.EXE" a3 on (I tried this but windows doesnt like the a3 on bit on the end?)

anthonylavado

@Chargin:

I've never used ActiveHome, so I can't comment on it for sure.
One thing I can suggest is that instead of:
"C:\Program Files\Home Control\x10comm.EXE" a3 on
in a Batch file, try this instead:
"C:\Program Files\Home Control\x10comm.EXE a3 on"

Let us know how it goes!  :)
Follow me on Twitter: @anthonylavado
Now making guest appearances in the Home Automation Chat Room

Chargin

yes I did try that but it didnt work, no error or anything and no lights either..
I read about batch files today and I think I understood the writeup to say I had to have a % before an argument, is that right? I tried %a3 on at the end but that didnt work either...

hawk1

This is how I made a batch file for my camera software:

@echo
cd\
cd c:\program files\blue iris
ahcmd sendplc c1 on

Just an example you could go by.
koopr@sstelco.com, I don't know what I'm doin but I'm havin fun doin it!

jrwhit

May we assume you have downloaded the ActivehomePro SDK?
This software interface allows you to use commands to interact with AHP and your CM15A via scripts.
I find this method of control works well sending all sorts of commands to my home automation PC from other PC's on my network.
Here is a typical command to make this work:

Set objProcess = GetObject("winmgmts:{impersonationLevel=impersonate}!\YourPCNameHere\root\cimv2:Win32_Process")
result = objProcess.Create ("C:\Program Files\Common Files\X10\Common\ahcmd.exe sendplc d11 on", null, null, intProcessID)

This is a visual basic scripting file which I saved as D11On.vbs. A simple shortcut on the desktop of a networked PC, when double-clicked, turns the D11 module on.
There are more examples in the SDK documentation for other programming languages.

Chargin

Ok I should have said, this is just activehome not pro, no sdk and its a cm12AU (same as cm11)

Chargin

Tried this

@echo
cd\
cd c:\Program Files\Home Control\x10comm.exe a3 on

Didnt work.

Quote from: hawk1 on November 11, 2010, 10:10:26 AM
This is how I made a batch file for my camera software:

@echo
cd\
cd c:\program files\blue iris
ahcmd sendplc c1 on

Just an example you could go by.

hawk1

Put the command on a different line, like the example and try.
koopr@sstelco.com, I don't know what I'm doin but I'm havin fun doin it!

Chargin

Still nothing.

@echo
cd\
cd c:\Program Files\Home Control\x10comm.exe
a3 on

ITguy

Looks like you have an extra "CD" in there!  You show:

@echo
cd\
cd c:\Program Files\Home Control\x10comm.exe
a3 on

It should probably be:

@echo
cd \
c:\Program Files\Home Control\x10comm.exe a3 on

ITguy

hawk1

koopr@sstelco.com, I don't know what I'm doin but I'm havin fun doin it!

Chargin

Ok tried that still nothing

@echo
cd \
c:\Program Files\Home Control\x10comm.exe
a3 on

hawk1

Okay, how about this:

@echo
cd \
"c:\Program Files\Home Control\x10comm.exe"
a3 on


The other thing you can do is put a pause at the end, that way you might be able to see what the problem is.
If this doesn't work you might want to try a AutoHotKey script instead of a batch file.
koopr@sstelco.com, I don't know what I'm doin but I'm havin fun doin it!

Chargin

OK IT WORKS!

@echo
cd \
"c:\Program Files\Home Control\x10comm.exe" a3 on

I tried adding the pause and then it worked, I took the pause out and it still works...
Maybe there was a space or something somewhere, I dont know if that would cause a problem.

Thanks all.

-Bill- (of wgjohns.com)

Since the path to the executable; c:\Program Files\Home Control\x10comm.exe contains a space, you must surround the whole thing in quotes, or Windows gets confused and stops at the space.  ;)
>!
-Bill- (of wgjohns.com)
bill@wgjohns.com

In the real world, the only constant is change.

When I'm online you can find me in the Home Automation Chat Room!

SMF spam blocked by CleanTalk