X10 Community Forum

🖥️ActiveHome Pro => Plug-ins => Smart Macros => Topic started by: djsdjs on September 06, 2007, 03:23:22 PM

Title: Trigger X10 Commands remotely over your LAN with no special software
Post by: djsdjs on September 06, 2007, 03:23:22 PM

I have the CM15A attached to computer in the house near the best location to send x10 commands.  Sometimes I would just like shortcut on another computer that turns a specific code on or off - but without installing server software and other things.

I work with WMI and vbscript so I have worked out what appears to be the simpliest approach.  The three lines of code below simply use WMI to start ahcmd.exe on the computer where it is installed (also attached):

Set objProcess = GetObject("winmgmts:{impersonationLevel=impersonate}!\\YOUR_CM15A_COMPUTERNAME_HERE\root\cimv2:Win32_Process")

errReturn = objProcess.Create ("C:\Program Files\Common Files\X10\Common\ahcmd.exe sendplc m4 off", null, null, intProcessID)

if errReturn <> 0 Then wscript.echo "Couldn't execute the command."

I had been testing VBScript built in remote capabilities as well, but got this working first.  VBScript remoting also requires a registry key be changed for it to be enabled.
Title: Re: Trigger X10 Commands remotely over your LAN with no special software
Post by: -Bill- (of wgjohns.com) on September 07, 2007, 12:00:39 AM
Neat idea!   8)

I clicked you a "Helpful".  ;)