I’m adding a new plugin to handle X10 devices and the CM11A power line interface. This is based on the work by yocesar in this thread:
[url=http://forum.micasaverde.com/index.php/topic,10817.0.html]http://forum.micasaverde.com/index.php/topic,10817.0.html[/url]
As I pointed out in another thread, when I started with Vera, I was disappointed in the X10 support provided by the Insteon PLM. I found yocesar’s thread and started using his CM11 plugin. This worked fairly well, but I noticed a few things I wanted to correct.
- There was only support for dimming using standard X10 dimming. No support for extended dimming or preset dim switches.
- The plugin didn’t really look too much at responses from the CM11 when sending commands. It would mainly just send a command, sleep for awhile, then send the next command, whereas there should be a two way communication involving checksums, etc.
- If I wanted to add a new device, I had to hard code all the details of that device into the plugin. That seemed wrong in that the CM11 should just be an interface to the powerline and shouldn’t have to worry about what devices are talking to it.
So, I’ve rewritten the plugin with a different architecture. The CM11 part is just a PLI and sends X10 commands and sends status to devices when it receives it. It becomes more just like a dumb terminal. The devices are all separate and all the logic to handle that device is contained in those device files. They all talk to the CM11 through the same UPNP calls.
This new architecture will make it easy for people to develop plugins for other X10 PLI units such as the CM17, CM19, etc. and as long as they implement the same UPNP interface, then the device files do not need to change in any way.
I’ve created devices for standard on/off devices (appliance modules, on/off light switches, etc.), Standard X10 dimmers, Extended code dimmers (Some Leviton switches, etc.), Preset Dim dimmers (SmartLinc), and security sensors (really just on/off devices, but they implement the sensor UPNP interface).
I code in many other languages, but this was my first experience with Lua. Thanks to yocesar who said he wasn’t very proficient at coding, but his code gave me a good head start in my learning process.
I’ve uploaded all the files as an attached zip as there are many. I will outline the files below so you can determine which ones you need for your setup. You only need to upload the required files and the ones for devices you want to control.
Required Files:
D_X10CM11a.xml
I_X10CM11a.xml
S_X10PLInterface1.xml
S_X10Device1.xml
Device Files (as needed):
Binary Switches
D_X10BinarySwitch1.xml
I_X10BinarySwitch1.xml
S_X10BinarySwich1.xml
Standard X10 Dimmers
D_X10DimmableLight1.xml
I_X10DimmableLight1.xml
S_X10DimmableLight1.xml
Extended Code Dimmers
D_X10ExtDimmableLight1.xml
I_X10ExtDimmableLight1.xml
S_X10ExtDimmableLight1.xml
Preset Dim Dimmers
D_X10SmartLincLight1.xml
I_X10SmartLincLight1.xml
S_X10SmartLincLight1.xml
Security Sensors
D_X10SecuritySensor1.xml
I_X10SecuritySensor1.xml
Installation instructions:
These instructions are based on UI5. I have no access to UI4, or UI6, so I cannot speak to installing there.
-
Upload the files above as needed via Apps->Develop Apps->Luup Files. If you don’t have SmartLinc/Preset Dim switches, then don’t bother to upload those files. Same with the other non-required files. No need to take up the extra memory if you don’t need them.
-
Go to Apps->Develop Apps->Create Device.
In the “Description” field, type whatever you want to call the CM11 PLI. Something like “X10 CM11A PLI” or whatever you like.
In the “UPNP Device Filename” field, type D_X10CM11a.xml.
In the “UPNP Implementation Filename” field, type I_X10CM11a.xml
Put in a room if you like (not required)
Press the “Create Device” button. You should get a message about the device being created. Make a note of the device number is specifies. You will need this later. You can always find this in the dashboard by going to the settings->advanced tab for that device and look at the “id” field. -
Plug your CM11 a into vera via a USB to serial adapter and reboot Vera. If you need help getting Vera to recognize your USB to serial adapter, see this thread:
[url=http://forum.micasaverde.com/index.php/topic,1471.0.html]http://forum.micasaverde.com/index.php/topic,1471.0.html[/url]
When you see your USB to serial device in the configuration screen, set the following parameters:
Baud Rate: 4800
Parity: None
Data Bits: 8
Stop Bits: 1
In the “Used By Device” dropdown, find the X10 PLI device you created in step 2 and select that.
- You are now ready to create devices for the CM11 to interact with. The best way to describe this is probably with an example scenario.
Lets say you have an appliance module at C5 controlling a light in the family room. Use these steps to create the device for that module.
Go to Apps->Develop Apps->Create Device.
In the “Internal Id” field, type the X10 house code, unit code. In this case “C5”
In the “Description” field, type “Family Room Light” (or whatever you like).
In the “UPNP Device Filename”, type D_X10BinarySwitch1.xml. (Use the appropriate file for the type of device)
In the “UPNP Implementation Filename” field, type I_X10BinarySwitch1.xml (Same as above, use the appropriate file)
Select the room if you like.
Press the “Create Device” button.
Vera will reload luup. You will see in the dashboard your new device complains about an error. This is because you need to input the device number of your CM11A. You may need to do a couple more reloads until when you go to the settings->advanced for the new device you see the “ControllerDeviceNum” field. Fill out the device number of the CM11A that you wrote down in step 2. After you close the setting box, press the red “Save” button at the top of the screen. Vera will reload and your device should now be active without errors.
Repeat this for your other X10 devices as needed.
All the devices you create should show up in remote control apps as they use the same category/sub-category as standard devices.
That’s all I can think of to say right now. Give it a try if you have a CM11 and X10 devices you want to control.
Enjoy,
Bruce