|
X10 is a network for house automation that uses the electrical
wiring of the house. The network is made of several house areas,
identified by a house code (hc). Each house code has several devices,
identified by a device code (dc). House codes go from a to p.
Device codes go from 1 to 16.
This program is a file system (and a shell) to talk to X10 CM11
controllers. It can be used to request status for the X10 devices
controlled, and also to issue commands to the devices. By default
it services all devices with house code a; option –h can be used
to service a different house. The program services its file
system at network address tcp!*!x10 and accepts multiple concurrent
clients mounting the X10 services.
The file tree serviced is a single directory with a cm11 file
that represents the controller, plus one extra file per device
controlled. Device file names are made out of the house and device
names. For example, the file a1 represents a device using 1 as
the device code and a as the house code. As the controller sees
devices (for example, due to commands from the remote control),
it adds the corresponding files to the directory.
A write(2) to the cm11 file can be used to execute any of the
commands listed below that refer to a house or a device. A read(2)
on a device file returns any of the strings on and off depending
on the device status. A write(2) to a device file executes the
command supplied using as the house and device codes those
of the device. For example, a write with the string on to the
file a1 would execute the command on a 1 (which turns the device
on).
Permission checking is implemented. Both the cm11 and device files
accept wstat(2) requests to change the owner and permissions.
However, the owner can be changed just once, further attempts
are refused. Permissions can be changed too. This can be used
to assign ownership of x10 switches to their legitimate
owners and to prevent accidental power offs. Users are authenticated
using factotum(4) prior to granting access to the file system,
but note that any x10 controller plugged in a wall could command
devices at will. The user who started the program is always considered
as a file owner, regarding permission checking..
By default, x10 uses /dev/eia0 as the serial device to reach the
CM11 controller. Option –d can be used to use another device.
Flag –i makes the program accept commands like a shell, instead
of servicing its file tree. This is useful to diagnose problems.
Option –q makes x10 quiet, and combined with –i can be used to pipe
commands from standard input. Option –D on the other hand, makes
it verbose, for debugging. By supplying this
option more than once, extra diagnostics may be enabled. The program
logs events and diagnostics to the /sys/log/x10H file, where H
is the house code.
The following commands are available:
s loads the CM11 status information (only available in interactive
mode).
d dumps the loaded status (only available in interactive mode).
q quits (only available in interactive mode).
p prints the set of devices known, and their status (only available
in interactive mode).
alloff hc
| |
switches off all devices with the same house code.
|
lightson hc
on hc dc
off hc dc
dim hc dc dim
| |
sets up a dim ammount (from 0 to 100%) for the device. This is
dangerous, since the device controlled might be a terminal (despite
using an X10 light switch).
|
bright hc dc dim
| |
sets up a bright ammount (from 0 to 100%) for the device. This
is dangerous, for the same reason.
|
lightsoff hc
stson hc
| |
sends a status on to the CM11. This and the next two commands
are implemented for debugging purposes, the file system already
issues status requests to maintain an updated view of the X10
world.
|
stsoff hc
| |
sends a status off to the CM11.
|
stsreq hc
| |
issues a status request to the CM11.
|
Upon starting, this program reads command lines from the file
/sys/lib/x10conf (or conf if given) that are executed as if sent
to the cm11 file. This can be used to switch on certain devices
after a power failure. Besides, a line with format
would setup permissions for the device with house and device code
HD to the given user, group and mode. The device code 0 can be
used to refer to the cm11 file. A line of the format
would make the file name for device HD to be the given one. Comments
are allowed using rc(1) syntax.
|