In the process of automating parts of my home, I've written tools to control
these X10 "controllers" via their RS-232 (serial) interfaces:

  CP290 - Designed and documented to be controlled by user-written software.
  CM11  - Designed to be controlled by X10 provided software.
  HD11  - "" supplied in IBM "Home Director" package (appears same as CM11)

I started doing this "long ago" and these programs are DOS-16bit.
They ran fine at the time (XP) - but don't run in modern 64-bit Windows.
The good news is that they work well under DosBox (one on my site).

I've not written extensive documentation for these, however most command
options can be seen by running the command with no arguments.


-------------------------- CP290 ---------------------------
This was the first one I got, and as I was using X10 more at that time,
I included the ability to set up and use all of it's "timer" functions.

Command notes:

/D Displays detail messages about the data transfers with the CP290, used
   for diagnosing communications problems.

/N Causes the names you have assigned to modules to be saved to the CP290
   "graphic" memory during EDIT and PUT - this means the names will be
   retained if you EDIT or GET directly from the unit, however due to the
   way graphic memory is sent to the CP290, this operation is very slow -
   normally I do all my editing on a PC file (also save it in case the
   CP290 loses it) and PUT the file to the unit (without names).

/W Controls what the program does with the status report generated by the
   CP290 in response to an ON, OFF or DIM command:
     No option = Wait for response but do not display.
     /W        = Do not wait for response (faster, but CP290 will not
                 respond to other commands until the command finishes).
     /WS       = Wait for the response and show it.
   

Command notes:

INFO displays the CP290s time as determined by it's internal clock, as
well as the currently programmed base housecode.

BASE programs a new base housecode. X10 supports 16 houscodes (A-P). The
base housecode is the code used when X10 devices are turned ON/OFF by the
CP290s front panel buttons. Setting the base housecode also erases any
existing programming in the unit.

CLOCK sets the CP290s internal clock. If no operands are given, the clock
is set to the time indicated by the PC clock. Hour can be set in either
12 hour format (A1-12 or P1-12) or 24 hour format (0-23). Day of week is
set with 'MO', 'TU', 'WE', 'TH', 'FR', 'SA' or 'SU'.

ON, OFF and DIM turn modules ON, OFF or to a preset DIM setting (DIM applies
to incandecent modules only).

EDIT edits the CP290 programmed schedule. If a filename is given, the
schedule is read and re-written to that file. If no filename is given,
the schedule is read and re-written to the CP290 itself. When the editor
is active, the following keys can be used:
  Up/Down/Left/Right/PgUp/PgDn/Home/End/^Home/^End = Move selection
     F1 = Set base housecode
     F2 = Toggle module name display On/Off
     F3 = Edit table of module names
    DEL = Cut (delete) current selection
    INS = Paste cut item(s) at current selection
  ENTER = Modify currently selected item
    F10 = Save edited schedule & exit
    ESC = Exit without saving
The exact keys used when modifying specific fields varies, however the
following general rules apply:
  Up/Down = Toggle through available values
    ENTER = Save new value and exit.
      ESC = exit without changing the value.
Other keys such as Function keys, Left/Right arrows and some alphanumeric
keys are used when modifying some fields - see the status line at the
bottom of the screen for details on the keys available.

GET retrieves the programmed schedule from the CP290 unit, and places it
in the named file on the PC.

PUT reads a programmed schedule from the named file on the PC and sends
it to the CP290 unit.


- The format of the PC file used by the EDIT, GET and PUT commands is -
Offset  Size     Description
  0      1       Base housecode (same format as "Housecode" below)
  1     1024     Schedule block (128 entries as descrbed below)
-- The following block is repeated 128 times, offset are within block --
  0      1       Event "Mode"
  1      1       Days to activate
  2      1       Hour to activate
  3      1       Minite to activate
  4      2       Modules to activate
  6      1       Housecode
  7      1       Function to perform
-- End of schedule block --
 1025   512      Name block (64 entries as described below)
-- The following block is repeated 64 times, offsets are within block --
  0      1       House code/Module index
  1      7       7-character label for module
-- End of name block --

The Schedule block is in exactly the format that the CP290 uploads and
downloads each event, specifically:

Mode = 0000mmmm, where 'mmmm' is:
  0000 = No event set in this position
  0010 = Event triggers "Tomorrow" and is then erased.
  0100 = Event triggers "Today" and is then erased.
  1000 = "Normal" - event triggers same time on selected days.
  1001 = "Security" - event triggers randomly within 1-hour of time.

Days to activate = 0 SU SA FR TH WE TU MO  (01111111 = Everyday)

Hour to activate   = 0-23  (00000000 - 00010111)

Minite to activate = 0-59  (00000000 - 00111011)

Modules to activate =
  Low byte : 1  2  3  4  5  6  7  8  (00000001=Module8,  10000000=Module 1)
  High byte: 9 10 11 12 13 14 15 16  (00000001=Module16, 10000000=Module 9)

Housecode = hhhh0000, where 'hhhh' is:
  A=0110   E=0001   I=0111   M=0000
  B=1110   F=1001   J=1111   N=1000
  C=0010   G=0101   K=0011   O=0100
  D=1010   H=1101   L=1011   P=1100

Function = ddddffff, where 'ffff' is:
  ON=0010   OFF=0011   DIM=0101
 'dddd' is 0000 for ON/OFF, and the dim level (0-15) for DIM


--------------------------- CM11 ---------------------------
I got CM11 & HD11 later, at which point all of the timed operations were
done by my server. As the control protocol for these isn't documented nearly
as well, I've implemented only the ON/OFF functions that I use  ...  if you
wish to use more functions, please contact me and perhaps I can help.

use:    CM11    [file[.INI]] [options]

opts:   -C{1-4}     set COM port                [1]
        -Tn         ""  ""  timeout             (55ms ticks)
        -Kn         "" Key  ""                  (Seconds)
        -H{A-P}     "" Housecode                \   Must be supplied for
        -N{1-16}    turn oN unit                 >  -N or -F, if neither
        -F{0-16}    ""  oFf ""   (0=all)        /   assumes  interactive
        -E          "" ""   all units at Exit

If [file] is specified, CM11 loads house/units from it:
	; Blank lines and those beginning with ';' (comment) are ignored
	=(A-P)				sets House code 
	(1-16)				Unit description (for interactive)
	...
If neither -N or -F is specified, CM11 performs interactive session allowing
control of X10 devices with single keypresses. -K sets a key timeout which
cause CM11 to exit if no key pressed.


---------------------- Serial cables -----------------------
     _____
   /  |_|  \   CABLE ENDs (*NOT* CP290 itself or PC)
 /           \  x = Unconnected        /-------------------\
|             |       |^5^3^9^2^|      | 5   4   3   2   1 |
| x         x |        =========        \  9   8   7   6  /
 \  3     2  /            CM11            ---------------
   \   5   / CP290                            AT-9
     ----- 
    Signal name               Origin   25-Pin(PC)  9-Pin(AT)
    --------------------------------------------------------
    Protective Ground   (GND)   ---         1          -
    Transmit Data       (TXD)   DTE         2          3
    Receive Data        (RXD)   DCE         3          2
    Request To Send     (RTS)   DTE         4          7
    Clear To Send       (CTS)   DCE         5          8
    Data Set Ready      (DSR)   DCE         6          6
    Signal Ground       (GND)   ---         7          5
    Data Carrier Detect (DCD)   DCE         8          1
    Data Terminal Ready (DTR)   DTE        20          4
    Ring Indicator      (RI )   DCE        22          9


------------------------------------------------------------
Dave Dunfield   -   https://dunfield.themindfactory.com
