[GOODIE] X10 CM11a interface

William E Harford seaside at harford.org
Thu Sep 22 01:10:13 UTC 2005


Below is a copy of an email sent to this lists a few years back
announcing a module to the CM11a X10 interface. 

I would like to rewrite my home automation server in Smalltalk using
Squeak the current perl code is a bit of a bear to work with and the
code for the interface to CM11a would give a huge boost to that
process. 


If you have any information on the whereabouts of the code or the author
please enlighten.


Thanks Will.

______________________________________________________________
A MESSAGE SENT TO Squeak-Dev on Thu Jan 24 16:52:45 CET 2002

Download it from: http://spair.swiki.net/X10

"Change Set:		X10-CM11a
Date:			24 January 2002
Author:			Stephen Pair

This change set provides a model of the X10 CM11A module.  It allows you
to use Squeak to send and receive X10 commands over your house
electrical wiring (you need the X10 CM11a module attached to a serial
port of course).  It also provides a model of the CM11a EEPROM memory to
allow you to download timers and macros to the module for disconnected
operation.

I have not documented this stuff in the slightest.  I wrote it to
program a CM11a module that I have because the X10.com ActiveHome
software would not install or run properly on my Win2k machine.  I use
this to program my CM11a (so I know it works...at least on some level).
There is no GUI interface...just the model.  I am releasing it in this
immature state mainly because I don't plan to spend any more time on it
anytime soon.  If you would like help getting this stuff to work, send
me an email: spair at acm.org.

The following is an example of the EEPROM memory setup:  Turns A2 lights
on at 5pm and off at midnight, also A4 on is a macro that dims A3 to 50%

-----
|memory macro1 timer1 macroInit1 |
memory := X10Memory new.

command1 := X10BrightnessCommand new
	houseCode: $A;
	addDevice: 3;
	function: #dim;
	brightness: 0.5;
	yourself.

command2 := X10BrightnessCommand new
	houseCode: $A;
	addDevice: 1;
	function: #dim;
	brightenFirst: true;
	brightness: 0;
	yourself.

command3 := X10BasicCommand new
	houseCode: $A;
	addDevice: 2;
	function: #on;
	yourself.

command4 := X10BasicCommand new
	houseCode: $A;
	addDevice: 2;
	function: #off;
	yourself.

macro1 := X10Macro new
	delay: 0;
	addCommand: command1;
	yourself.

macro2 := X10Macro new
	delay: 15;
	addCommand: command2;
	yourself.

macro3 := X10Macro new
	delay: 0;
	addCommand: command3;
	yourself.

macro4 := X10Macro new
	delay: 0;
	addCommand: command4;
	yourself.

timer1 := X10TimerInitiator new
	dayRange: (1 to: 366);
	days: #(Sunday Monday Tuesday Wednesday Thursday Friday
Saturday);
	startTime: (Time fromString: '17:00:00');
	stopTime: (Time fromString: '23:59:00');
	startMacro: macro3;
	stopMacro: macro4;
	yourself.

macroInit1 := X10MacroInitiator new
	houseCode: $A;
	deviceCode: 4;
	macro: macro1;
	yourself.

memory addMacro: macro1.
memory addMacro: macro2.
memory addMacro: macro3.
memory addMacro: macro4.
memory addTimerInitiator: timer1.
memory addMacroInitiator: macroInit1.
memory.

-------

And the following will download the memory to a CM11AModule (on serial
port 1):

(CM11AModule new: 1) writeEeprom: memory

You can also issue direct X10 commands:

(CM11AModule new: 1) 
	address: 'A2';
	function: #on;
	address: 'A3';
	function: #dim by: 1.

And, you may open the transcript to monitor any signals issued by other
X10 devices.

Note: You should not create a new CM11AModule every time you want to do
something with it (as I have shown in these examples), create one, then
keep it around for issue commands and configuring it.

"




More information about the Squeak-dev mailing list