Eeberfest døt net
ELECTRONIC STUFF
X10 serial plugin info

 

Using the Plugin:

First of all, make sure the Web Server in AbelCam is configured, running and accessible. Refer to the AbelCam documentation if you are not sure how to do this. To confirm that the Web Server is set up right, point your browser at hostname:port/index.html (where hostname is your machine's network name and port is the Server Port you set in AbelCam). If the Web Server is working you will see an AbelCam page.

If you plan to start out by using the included sample web pages to test (recommended) you should set your X10 devices to House Code A. Plug your CM11a (or equivalent) into a serial port or USB to Serial adapter, and make sure you know which COM Port number it is assigned to. Then start the plugin by clicking Activate on the AbelCam plugins dialog. Next, click Configure and then set the appropriate COM Port in the drop-down box. Check the Can Dim checkboxes on all channels that correspond to Lamp or Wall Switch modules. Leave the Off Delay times at zero for now. Also, it is recommended that you unplug any other X10 controllers (keypads, timers, etc.) in the house while testing initially.

To control and monitor your X10 devices in House Code A using the included sample web page, simply point your web browser at: hostname:port/X10/x10_sample.html Or, if you use the webcam pages that come with AbelCam you can just open your webcam home page and click the Plugins button at the top.

 

Creating Web Pages:

Some knowledge of HTML is required. Use the included sample pages x10_sample.html and x10status_sample.html as a starting point, and take a minute to read the extensive comments contained in each of those files. Actually, you can find everything you really need to know about using the plugin in the comments.

In order to be served properly, you custom pages must be located in the same directory as the sample pages. This directory (normally C:\Program Files\AbelCam\Plugin\Web\X10Plugin) functions as the "web root" for this plugin. The URL for a custom page named "mypage.html" will be server:port/X10/mypage.html

Displaying X10 Device Status on a Web Page:  X10 data is placed in a page by using special HTML "Include tags". Include tags look a bit like Comment tags, but they contain information that specifies the X10 module whose status you want to display. When the page is served, the plugin replaces the Include tags with the actual live data items they specify.

Include tags look like this: <!--#HC --> where H specifies the House Code (A - P), and C specifies the channel (module). C can be any number 1 - 16, but be sure to use only a single digit for channels less than 10 (e.g. 1 is valid, 01 is not). Note the space directly after C - it is required, not optional. Example: <!--#D4 --> will display the status of Module 4 in House Code D.

Controlling X10 Devices from a Web Page:  Devices are controlled by passing arguments in a URL, much like calling a CGI script. There are two basic methods of doing this:

Method 1: hostname:port/X10/page.html?HC=J&CH=3&OP=ON will turn on module J-3 and then return a page named "page.html".

Method 2: hostname:port/X10/?HC=J&CH=3&OP=ON will turn on module J-3 and then return a tiny internal HTML page that simply says "Success" or "Error".

The general formats for passing arguments are:

?HC=X&OP=ALL_OFF or ?HC=X&OP=LTS_ON   Used for All Units Off (OP=ALL_OFF) and All Lights On (OP=LTS_ON). The X specifies the House Code to operate on.

?HC=X&CH=Y&OP=OFF or ?HC=X&CH=Y&OP=ON   Used for individual module Off (OP=OFF) and On (OP=ON). The X specifies the House Code to operate on, and the Y specifies the module.

?HC=X&CH=Y&OP=DIM&PCT=Z or ?HC=X&CH=Y&OP=BRT&PCT=Z   Used for individual module Dim (OP=DIM) and Bright (OP=BRT). The X specifies the House Code to operate on, and the Y specifies the module. Z specifies the amount (5 - 100 percent) by which to dim or brighten.

Examples: ?HC=K&OP=ALL_OFF turns off all modules in House Code K. ?HC=K&CH=4&OP=ON turns on module K-4, and ?HC=K&CH=4&OP=DIM&PCT=25 dims it by 25%.