X10(4)                                                     X10(4)

          x10 - X10 CM11 controller

          x10/fs [ -Diq ] [ -d dev ] [ -f conf ] [ -h hc ]

          X10 is a network for house automation that uses the electri-
          cal 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 per-
          missions. However, the owner can be changed just once, fur-
          ther 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

     X10(4)                                                     X10(4)

          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

          Flag -i makes the program accept commands like a shell,
          instead of servicing its file tree. This is useful to diag-
          nose 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

          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
               turns on the lights.

          on hc dc
               switches the device on.

          off hc dc
               switches the device off.

          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
               turns off the lights.

     X10(4)                                                     X10(4)

          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
               perm HD user group mode
          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
               name HD name
          would make the file name for device HD to be the given one.
          Comments are allowed using rc(1) syntax.

          With this configuration file
               # house a serviced by victim
               # cm11, victim
               perm a0 nemo planb 0660

               # power source
               on a 1
               perm a1 nemo nemo 0664
               name a1 pwr:136term

               # motion detector
               off a 5
               perm a5 nemo planb 0444
               name a5 who:136
          This can start and mount the service, and switch the a1 and
          a3 devices off.
               ; x10/fs
               ; 9fs tcp!localhost!x10
               ; echo off > /n/x10/pwr:136term
               ; echo off a 3 > /n/x10/cm11



     X10(4)                                                     X10(4)

          x10(1) and www.x10.com.

          X10 is not reliable since commands may be silently ignored
          by devices, and it provides no means for authentication, as
          far as we know.  Some CM11 functions, not mentioned here,
          are either unimplemented or untested. Only house code A has
          been thoroughly exercised, using other house codes may be