Active TopicsActive Topics  Display List of Forum MembersMemberlist  Search The ForumSearch  HelpHelp
  RegisterRegister  LoginLogin
PowerHome Programming
 PowerHome Messageboard : PowerHome Programming
Subject Topic: PH Macros from fancy keyboard key press? Post ReplyPost New Topic
Author
Message << Prev Topic | Next Topic >>
NorthernAl
Groupie
Groupie


Joined: March 19 2006
Online Status: Offline
Posts: 48
Posted: February 24 2007 at 13:27 | IP Logged Quote NorthernAl

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 View NorthernAl's Profile Search for other posts by NorthernAl
 
cmhardwick
Senior Member
Senior Member
Avatar

Joined: July 08 2006
Location: United States
Online Status: Offline
Posts: 290
Posted: February 24 2007 at 14:50 | IP Logged Quote cmhardwick

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 View cmhardwick's Profile Search for other posts by cmhardwick Visit cmhardwick's Homepage
 
NorthernAl
Groupie
Groupie


Joined: March 19 2006
Online Status: Offline
Posts: 48
Posted: February 24 2007 at 19:02 | IP Logged Quote NorthernAl

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 View NorthernAl's Profile Search for other posts by NorthernAl
 

If you wish to post a reply to this topic you must first login
If you are not already registered you must first register

  Post ReplyPost New Topic
Printable version Printable version

Forum Jump
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot delete your posts in this forum
You cannot edit your posts in this forum
You cannot create polls in this forum
You cannot vote in polls in this forum