Executing X10 Commands via Email
I use Outlook (2010), but any email program that allows RULES which will execute an external application should work.
You need to download the X10 SDK, and extract the AHCMD.exe program from it.
In the DOS days, I just added the location of AHCMD.exe to my PATH, but now I explitcitly call it.
On my D: drive I have D:\ActiveHome\Scripts and I put AHCMD.exe in there along with the associated batch files (*.bat)
The HELP file within the SDK lists the commands – both PLC and RF.
Powerline Commands
Powerline commands are specified with the "sendplc" parameter, and take several different forms. Each requires that you specify an X10 address (A1-P16), plus additional command parameters structured as follows:
• On: <X10 address> on
• Off: <X10 address> off
• Dim: <X10 address> dim <dim percentage (of 100%)>
• Bright: <X10 address> bright <bright percentage (of 100%)>
• All Lights On: <X10 address (must include Unit Code)> alllightson
• All Units Offn: <X10 address (must include Unit Code)> allunitsoff
• Extended Code Command: <X10 address> <command> <value> (command and value are specified in hex).
This list containts all of the powerline commands used by the Scripting Interface.
Example of complete powerline transmission command:
"sendplc", "a3 dim 75"
This would tell the interface to send address module A3, and then send a dim command of sufficient duration to dim the module 75% of full brightness.
I only use the “SendPLC” commands.
A simple batch file might be:
ArmStat.bat
D:
CD \ActiveHome\Scripts
AHCMD.exe “sendplc” “M5 ON”
So I create a RULE in Outlook that looks at the subject line of all messages.
If it “sees” the string, “X10:ArmStat” it runs the application “ArmStat.bat”
ArmStat.bat runs, sends M5 ON as a PLC which flips a Phantom AM466 M5 to the on position. Macro M5 is triggered by the M5=ON and does it’s thing.
That’s really all there is to it. You can make it as complex or as simple as you like.
Since I haven’t found a way to pass parameters, I have a batch file for every action I want to trigger via email. Most of the associated macros send me a return email confirming the action happened.
Confirmation is importand because Outlook has a nasty habit of hanging when an account doesn’t connect with the email host – just sitting there with a dialog box open waiting for you to click “OK”
This is a hurried explanation, and I apologize for it being so – if you’d like more, send me a message and I’ll work up more detail this weekend –
Dave