Below are the X10 and relay control commands.


x10on

Syntax: x10on

This command initiates communication with X10 type devices. If this operation is successful, the variable X10CONNECTED is set to "true". All commands that require communication with X10 devices must be preceded by this command.

x10off

Syntax: x10off

This command terminates communication with X10 type devices and sets the variable X10CONNECTED to "false".

x10deviceon

Syntax: x10deviceon house device

This command turns on the power to a device connected to an X10 switch configured as "house" and "device". Both parameters accept a range of 1 to 16. Note that X10 house codes are usually labeled "A" to "P" which must be converted to a range of 1 to 16. The variable X10ERROR is set accordingly.

x10deviceoff

Syntax: x10deviceoff house device

This command turns off the power to a device connected to an X10 switch configured as "house" and "device". Both parameters accept a range of 1 to 16. Note that X10 house codes are usually labeled "A" to "P" which must be converted to a range of 1 to 16. The variable X10ERROR is set accordingly.

x10devicebright

Syntax: x10devicebright house device percent

This command increases the brightness, by the specified "percent", of a lamp connected to an X10 switch configured as "house" and "device". Both the "house" and "device" parameters accept a range of 1 to 16. The variable X10ERROR is set accordingly.

x10devicedim

Syntax: x10devicedim house device percent

This command decreases the brightness, by the specified "percent", of a lamp connected to an X10 switch configured as "house" and "device". Both the "house" and "device" parameters accept a range of 1 to 16. The variable X10ERROR is set accordingly.

relay

Syntax: relay comport state1 state2

This command sets the state (true is on) of the two relays ("state1" is relay 1 and "state2" is relay 2) of the B&B Electronics Model 232DRIO dual serial relay controller. Note that this device has been discontinued. The COM port "comport" is used. The variable COMPORTERROR is set accordingly.

getrelay

Syntax: getrelay comport

This command queries the state of the two relays of the B&B Electronics Model 232DRIO dual serial relay controller. Note that this device has been discontinued by its manufacturer. The COM port "comport" is used. The result is stored in the variable RELAYS. Binary bit 0 is the state of relay 1 and bit 1 is the state of relay 2 . The variable COMPORTERROR is set accordingly.