Monday, September 3, 2007

Misterhouse Insteon PLM Configuration

Although X10 supposedly works very well in Misterhouse it seems that X10 is falling out of favour mostly for reliability and marketing reasons. I made a conscious decision to go with Insteon technology instead of X10 for lighting control in Misterhouse even though Insteon compatibilty in Misterhouse is in its early stages.

So, last week I received the Insteon devices that I ordered and I could hardly wait to start playing with them. This is what I got:

2412S INSTEON PowerLinc Modem, Serial
2456D3 INSTEON LampLinc Dimmer (3-Pin)
2476S INSTEON SwitchLinc Relay (Non-dimming)

I did a fair bit of research on the forums etc. before I decided to buy these. From what I understand the USB version of the PowerLinc isn’t quite ready for prime time in Misterhouse although there are people working on that. The 2412S INSTEON PowerLinc Serial Modem (PLM) is a dumb controller that connects to a serial port on the computer. I figured that since I have an available serial port I might as well go for this one.

I started to try and get the devices working with Misterhouse right away. That was actually a big mistake. I still have so much to learn about Misterhouse itself that trying to understand how Insteon and Misterhouse work together at this point is just too onerous. What I needed to do was learn how the Insteon technology works first before I can even think about integrating it into Misterhouse. So, I found a number of documents on the web that have proved to be very helpful for a start.

http://www.simplehomenet.com/Downloads/EZBridge%20Manual.pdf

http://www.smarthome.com/manuals/2412sdevguide.pdf

http://www.insteon.net/pdf/insteondetails.pdf

At the back of the EZBridge document is an appendix with Insteon Commands.

After reading this material over a couple days my first step was to play with the PLM and a LampLinc to see if I could turn a lamp on and off. I have a Windows PC that I work on and Misterhouse is installed on a Linux server in another room. So to experiment and learn how Insteon commands work I downloaded and installed a recommended software program called Docklight.

http://www.docklight.de/

This is trial version that gives you enough functionality to experiment with Insteon commands on a Windows PC. What this program lets you do is send commands to the PLM through the COM port on your PC. There’s a screen shot of Docklight on page 9 of the Modem Developer’s Guide. I learned a great deal just from studying that screen shot. Once I got a basic understanding of how Insteon commands work I was able to turn my lamp on and off using my Windows PC.

Now that I had a basic understanding of how to communicate with the PLM using the serial port I needed a way to do the same thing on my Linux server. After hours of futzing around with programs like Minicomm and others I discovered this great little utility, S-Jinn.

http://sjinn.sourceforge.net/

This is a neat little command line program that lets you communicate through a RS232 com port. I connected my PLM to a free serial port on the linux server and after a couple hours of learning the program and experimentation I came up with these commands that turns the lamp on and off using S-Jinn.

Here’s an explanation:

------1------ ---2--- --------------3-------------- --4-- ----5---- -5- ----6----
$: rs232 -d /dev/ttyS6 -b 19200 -s "\h02 62 FF FF FF 0F 11 FF" --hex --verbose -r9 --wait .4
$: rs232 -d /dev/ttyS6 -b 19200 -s "\h02 62 FF FF FF 0F 13\n" --hex --verbose -r9 --wait .4

1. Device (-d /dev/ttyS6): on my system the PLM is connected to /dev/ttyS6

2. Baud rate (-b 19200): I read in some places that the baud rate should be set to 4800 but that didn’t work for me. 19,200 was the only rate that gave me joy.

3. Send string (-s "\h02 62 FF FF FF 0F 11 FF"): This is the hexadecimal Insteon command that gets sent to the PLM. The \h is a hex toggle. The “02” is the ‘start of text’. The ‘62’ tells the PLM an Insteon command is coming. The next three bytes ‘FF FF FF’ is the Insteon ID. I got this off the label on the back of the device itself. The ‘0F’ is a flag indicator. The next two bytes are the Insteon command that gets passed to the LampLinc. The ’11 FF’ is ON with full brightness. The ‘13’ is OFF. I had to put a \n at the end to get the command to work.

4. Display in Hex (--hex): Displays the out put in hex.

5. Verbose output (--verbose): Self explanatory

6. Wait 0.4 seconds (--wait .4): This setting seems to work.

Now that I have a really super basic understanding of Insteon technology and the commands required to make it work. My next step is to figure out how to get Misterhouse turning the lamp on and off.

I'm off to study Neil Cherry's work on this page...

http://www.linuxha.com/athome/common/iplcd/

Hopefully this will help someone.

Garry

No comments: