Author |
|
NorthernAl Groupie
Joined: March 19 2006
Online Status: Offline Posts: 48
|
Posted: February 24 2007 at 13:27 | IP Logged
|
|
|
I have seen a similar topic on this board a while ago but wonder if anybody has more thoughts on this or if there is a better way to do it.
I have one of those keyboards with dedicated buttons to open web browser, open mail, etc. The buttons can be reprogrammed to run an exe (and perhaps a batch file,etc.).
I'd like to program one of these buttons to run a macro in PH. Even if PH is not the active window. Has anybody done anything like this? Do I have to write an application to use Windows messaging? Has anybody done that in a flexible way that I can borrow?
Thanks
Al
|
Back to Top |
|
|
cmhardwick Senior Member
Joined: July 08 2006 Location: United States
Online Status: Offline Posts: 290
|
Posted: February 24 2007 at 14:50 | IP Logged
|
|
|
If it will run an exe, you could use the phsscmd.exe (socket server command). I use this between to PCs, but it can be used on an individual PC as well. The program is included, I believe, in the PH directory. You have to start the socket server in power home, then edit the ini file for phsscmd to included you ID and password (the port at IP should be OK if you're on the local pc)
A sample command, to turn a PLC group on:
C:\Program Files\PHSSCMD\phsscmd.exe ph_insteonrawgroup("INSTEON",202,ion,255)
This will send the ph_insteonrawgroup command to PH to turn on group 202. You have access to all the PH functions, so running a macro is a definite posibility.
__________________ Cicero, Enjoying automation!
|
Back to Top |
|
|
NorthernAl Groupie
Joined: March 19 2006
Online Status: Offline Posts: 48
|
Posted: February 24 2007 at 19:02 | IP Logged
|
|
|
Thanks. I should have looked further. There is also the phwmcmd command. I downloaded from the PowerHome downloads section.
I could not figure out how to put quotes in the command for the key short cut so I created a batch file. The batch file is ToggleDenLight.bat that has just one line:
C:\phwmcmd.exe ph_macro("TOGGLE DEN LIGHT")
That is a macro I set up in PH.
Then the command I set up for the key mapping (in the software that came with the Microsoft Multimedia keyboard) was "ToggleDenLight.bat".
Now when I press one of the special keys on that keyboard it toggles the den light on and off (regardless of the state of PH - ie if active or not).
Dave, thanks for phwmcmd.exe. Very useful!
|
Back to Top |
|
|