Introduction to Scripting ActiveHome Pro

The ActiveHome Pro Scripting Interface allows you to create software, web pages, and other tools that use the USB ActiveHome Pro Interface to control and interact with X10 modules, sensors, and remote controls. Using the ActiveHome Pro Scripting Interface requires that ActiveHome Pro software and hardware be installed on the computer where your program will run.

This help file will describe the different ways to access the ActiveHome Pro Scripting Interface, list the commands that are available to use, and give samples for using the scripting interface in your own programs.

See Also

ActiveHome Scripting SDK Components

Using the Scripting Interface

Radio Frequency Command Reference

Code Samples


ActiveHome Scripting SDK Components

The ActiveHome Scripting SDK includes everything you need to start writing programs to control X10 products. The parts of the SDK install are put into four folders:

  • bin: The DLLs and executables that make up the ActiveHome Scripting package. These are also installed on your system, and all ActiveHome users systems', in the Program Files\Common Files\X10\Common directory.
  • help: Contains this help file.
  • samples: Code samples in a number of different languages, including C++, Java, VisualBasic, JavaScript, VBScript. These samples show different ways to send and receive commands using the scripting interface.
  • setup: installation files you can use to install the scripting components on other computers.

See Also

Introduction to Scripting ActiveHome Pro

Using the Scripting Interface

Radio Frequency Command Reference

Code Samples


Using the Scripting Interface

In general, communication with the ActiveHome Scripting Interface is done through the scripting object, an ActiveX object that communicates with the general X10 device service.

Creating the Scripting Object

Transmitting Commands

The ActiveHome Scripting Object has one basic function for sending all X10 commands, both powerline and radio-frequency: SendAction. All of your transmit commands are done using this function, with parameters to specify the type of command, address, and additional values. All parameters are specified as string values.

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.

Radio Frequency Commands

Radio-frequency (RF) commands are sent by specifying "sendrf" as the action parameter for the SendAction function, plus parameters to specify the address, command, and transmission length of the command. These are structured as follows:

  • <X10 addresss> <command>

The value for <command> must be one of the command constants listed in the Radio Frequency Command Reference.

Example (turn module A1 on):

"sendrf", "a1 On"

Checking Status

The X10 device service keeps track of the status of modules in the system by logging incoming and outgoing commands. You can ask the X10 service the status of any address by using the "queryplc" parameter of the SendAction function. There are two kinds of status to check:

  • On status: <X10 address> on
  • Dim level: <X10 address> dim

Specifying the "on" parameter returns 0 if off, 1 if on. Dim returns the dim level as a percentage of full brightness.. Both functions return -1 if the current status is not known.

Example (check if A1 is on or off):

"queryplc", "a1 on"

Receive Notifications

The X10 device service reports command reception through the function RecvAction, with parameters indicating the data received. All parameters are strings.

Powerline Commands

When a powerline command is received, RecvAction will have "recvplc" as the action parameter, and other parameters indicating the details, as follows:

"<X10 address>", "<PLC command>", "<additional data>"

The additional data is will only be sent if the command received requires it. Examples:

  • A1 On received: "recvplc", "a1", "on"
  • B3 dimmmed 30%: "recvplc", "e1", "dim", "30"

RF Commands

When RF commands are received, RecvAction returns "recvrf" as the action parameter, with additional data beyond the command and address:

"<X10 address>", "<RF command>", "<keydata>", "<timestamp>"

These paramers are:

  • X10 Address: A1-P16
  • RF Command: string constant, as described in the RF Command Reference.
  • Key Data returns three possible pieces of data: 0 (indicates key pressed, or key down); -1 (key released, or key up); 1...n (repeat sequence indicating how long remote key is pressed).
  • Timestamp: in UTC.

An RF command from a remote control is always received as a key down/key up pair, optionally with a key repeat sequence in between (if the key on the remote is held down).

If you just want recognize when a RF command has been received, look for key downs -- that tells you when a key has been pressed.

For example, a user presses A2 On with a PalmPad. RecvAction returns: "recvrf", "a2", "On", "0", "1435145145"; followed by "recrf", "a2", "On, "-1", "1435145146".

See Also

Introduction to Scripting ActiveHome Pro

ActiveHome Scripting SDK Components

Radio Frequency Command Reference

Code Samples


Radio Frequency Command Reference

X10 Home Control Commands | Comment
AllOn | All Lights On
AllOff | All Units Off
AllLightsOff | All Lights Off
On |
Off |
Bright |
Dim |

X10 Camera Controls | Comment
AutoFocus | For Vanguard cameras
Input |
Zoom |
PTZOn | To turn Vanguard cameras on
PTZOff | To turn Vanguard cameras off
ZoomIn | Vanguard: zoom in
ZoomOut | Vanguard: zoom out
CamGoPosition5 | For Vanguard presets
CamSetPosition5 | For Vanguard presets
CamGoPosition6 | For Vanguard presets
CamSetPosition6 | For Vanguard presets
CamGoPosition7 | For Vanguard presets
CamSetPosition7 | For Vanguard presets
CamGoPosition8 | For Vanguard presets
CamSetPosition8 | For Vanguard presets
CamGoPosition9 | For Vanguard presets
CamSetPosition9 | For Vanguard presets
FocusUp | Vanguard manual focus
FocusDown | Vanguard manual focus
IrisUp | Vanguard iris control
IrisDown | Vanguard iris control
FilledHand |
PanLeft | For Vanguard or Ninja
PanRight | For Vanguard or Ninja
PanUp | For Vanguard or Ninja
PanDown | For Vanguard or Ninja
CamGoPosition1 | For Vanguard or Ninja presets
CamSetPosition1 | For Vanguard or Ninja presets
CamGoPosition2 | For Vanguard or Ninja presets
CamSetPosition2 | For Vanguard or Ninja presets
CamGoPosition3 | For Vanguard or Ninja presets
CamSetPosition3 | For Vanguard or Ninja presets
CamGoPosition4 | For Vanguard or Ninja presets
CamSetPosition4 | For Vanguard or Ninja presets
CamCenter | For Vanguard or Ninja presets
CamSweep | For Vanguard or Ninja presets
CamClearAllPositions | For Vanguard or Ninja presets
CamEnterSweepTestMode | For Vanguard or Ninja presets

RF Remote Commands | Comment
LButtonDoubleClick |
RButtonDoubleClick |
One |
Two |
Three |
Four |
Five |
Six |
Seven |
Eight |
Nine |
Zero |
Power |
VolumeUp |
VolumeDown |
ChannelUp |
ChannelDown |
Left |
Up |
Right |
Down |
Ok |
Menu |
Play |
Stop |
Pause |
Record |
Rewind |
Forward |
Mute |
A |
B |
C |
D |
E |
F |
TV |
DVD |
Web |
Book |
Hand |
LButtonDown |
LButtonUp |
RButtonDown |
RButtonUp |
MouseRight |
MouseUp |
MouseLeft |
MouseDown |
MouseRightUp |
MouseRightDown |
MouseLeftDown |
MouseLeftUp |
Bookmark |
Resize |
Check |
Power |
PC |
SubTitle |
Title |
Display |
Return |
Menu |
Exit |
Left |
Up |
Right |
Down |
Enter |
Ok |
Play |
Stop |
Rewind |
Forward |
Pause |
Record |
Recall |
One |
Two |
Three |
Four |
Five |
Six |
Seven |
Eight |
Nine |
Zero |
ABSwitch |
ChannelUp |
SkipNext |
ChannelDown |
SkipPrev |
VolumeUp |
VolumeDown |
Mute |

Lola and Newer Remote Commands | Comment
MousePadRightUp |
MousePadUp |
MousePadLeftUp |
MousePadLeft |
MousePadRight |
MousePadLeftDown |
MousePadDown |
MousePadRightDown |
MousePadLButton |
ScrollUp8 |
MTAlbum |
MTArtist |
MTGenre |
MTTrack |
MTPlaylist |
MTPC |
MTLeft |
MTRight |
MTUp |
MTDown |
MTEnter |
MTAddDelete |
MTAB |
MTTV |
MTVCR |
MTRadio |
MTChannelList |

Old RF Remote Commands | Comment
00TV |
01Mute |
02ChannelDown |
03Power |
04ChannelUp |
05Backlight1 |
06VCRAux11 |
07VolumeDown |
08Rewind |
09Play |
10FastForward |
11VCRAuxA |
12CabAuxB |
13VolumnUp |
14Record |
15Stop |
16Pause |
17Aux8 |
18SatAuxC |
19SetupAndShift |
20One |
21Two |
22Three |
23Setup |
24X10AuxA |
25Display |
26Four |
27Five |
28Six |
29MenuToggle |
30MouseAuxB |
31RecallOrLast |
32DVDAuxD |
33SatAuxC |
34CabAuxB |
35VolumeUp |
36AudAuxE |
37VolumeDown |
38Seven |
39Eight |
40Nine |
41Sleep1 |
42CDAux4 |
43Aux10 |
44ABSwitch |
45Zero |
46Enter |
47TVOrVCR |
48Backlight2 |
49Up |
50Left |
51Okey |
52Right |
53Shift |
54X10FourOn |
55X10FourOff |
56Menu |
57Down |
58Exit |
59Unknown |
60X10OneOn |
61X10TwoOn |
62X10ThreeOn |
63Release |

See Also

Introduction to Scripting ActiveHome Pro

ActiveHome Scripting SDK Components

Using the Scripting Interface

Code Samples


Code Samples

The code samples included with the ActiveHome Pro Scripting SDK show several different ways of accessing and using the ActiveHome Scripting Interface to send and receive commands. You should be able to use some of the samples in your own projects, or to give you hints on how to do different things.

See Also

Introduction to Scripting ActiveHome Pro

ActiveHome Scripting SDK Components

Using the Scripting Interface

Radio Frequency Command Reference