New X10 CM11 controller plugin

Hi all,

I’ve been trying the different plugins for X10 control. I have used the mochad plugin and that works very well, you just need to have another server to run mochad on. I wanted to use the direct connection for the CM11 through a USB to serail adapter and have tried brucehvn’s X10 plugin and that works pretty well. There are issues with target updates on dimmables for on/off with third party applications.

So, I looked at merging these two projects as I like the simplicity for the mochad plugin and all the work that was put into brucehvn’s plugin for CM11 handling and created a streamlined X10 plugin. So this is basically a mashup between the two and those devs earn the credit for all of this as they did all the hard work.

Here is the config… (copied and pasted together from the others descriptions)
Installation instructions:
These instructions are based on UI5.

  1. Upload the files from the zip archive via Apps->Develop Apps->Luup Files.

  2. Go to the “Create Device” tab. Fill in these fields:
    Description: a name, type whatever you want to call the CM11 PLI. Something like “X10 CM11A PLI” or whatever you like.
    UpnpDevFilename: D_X10CM11a.xml
    UpnpImplFilename: 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.

  3. 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:
    http://forum.micasaverde.com/index.php/topic,1471.0.html

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.

  1. You are now ready to create devices for the CM11 to interact with.

  2. in the devices tab find the CM11 and Click the little wrench in the upper right hand corner of the device.
    Go to the “Advanced” tab and scroll down to the “Variables” section.
    Fill in the following variables:
    BinaryModules: a comma separated list of house/unit codes for any appliance modules you may have. For example: “A1,D2”
    DimableModules: a comma separated list of house/unit codes, but for old style dimmable modules.
    SoftstartModules: a comma separated list of house/unit codes, but for newer dimmable modules like any recently produced LM465s.
    MotionSensors: a comma separated list of house/unit codes for any motion sensors you may have. Don’t forget that X10 outside motion sensors (like the EagleEye MS14A and the ActiveEye MS16A) have a photosensor that will return a code for transitions to night/day. These alerts occur at a unit code one above the currently set unit code. This means that a motion sensor set to M1 will alert on M1 when there is motion and M2 for day / night.

  3. make sure you reload your vera so that all the dvices are created.

  4. test out your new devices and you should be good to go!

Have fun!

Brad

Updated 6/29/15: Added updated zip file and code. Removed unused code. Turned debug off.
Updated 7/30/15: Updated L_X10CM11.lua to be compatible with UI7. Now on github

Get it here:

Thanks, Brad, for sharing this. I was excited to try another version of the CM11a plugin, because the popular one doesn’t work on UI7; it causes Luup to continuously reload. Unfortunately, yours has the same problem.

So I decided to finally delve into Lua and see if I could get to the bottom of this. Fortunately, I was successful and I have a version that does work on UI7. Because I don’t have UI5, though, I can’t be sure it will work there.

Details (ignore the rest of this if you don’t care):

In your L_X10CM11a.lua (and the original one), there is a line:
luup.chdev.append(parent, child_list_ptr, prefix … dev_name, "X10 " … dev_name, schema, dev_file, “”, “”, false)

But in MCV’s documentation for this call, there is a comment:
On UI7, the device_type MUST be either the empty string, or the same as the one in the device file, otherwise the Luup engine will restart continuously.

Indeed, what you’re using for “schema” for BinaryLights (as an example) is “urn:schemas-micasaverde-com:device:BinaryLight:1” whereas (at least for UI7) the device_type defined in D_BinaryLight1.xml is “urn:schemas-upnp-org:device:BinaryLight:1”. So, taking the safer advice from MCV’s comment, I replaced “schema” with the empty string.
luup.chdev.append(parent, child_list_ptr, prefix … dev_name, "X10 " … dev_name, “”, dev_file, “”, “”, false)

And now it works!

Cheers!
/Andrew

Andrew, Thanks for addressing that. It was a simple update. Now I could publish a Mochad update too as it will have the same issue for UI7 as it is basically the same code.

That is not a great implementation from micasaverde if it continually re-loads when it can’t find something…

X10 is still very useful and cheap. I have worked on the front end for heyu called domus.Link for years but now have switched to the vera controller as it is standalone and there are some devices for zwave that you can’t get x10 equivalents such as door locks (and of course that is due to security).

X10 also works very well if you use a phase coupler and an XTB booster from JV Digital Engineering or they have both in one package. These make X10 work like it is supposed too…

So, This works for UI5 as well. I am updating the code and it will be available on GitHub at GitHub - bwssytems/vera-x10-cm11a-controller: A plug in for micasaverde products to controll x10 devices through a CM11a.,

With a little more work you can make this into a plugin in the APP store (apps.mios.com)
You will need to create an Account on cp.mios.com (or use your UI5 login if you had one)

Yes, I was going to get to that soon. Always want to get it out there sooner rather than later.

I’ll login and take a look, I might have some questions for you.

Thanks!

It’s a strange interface … be glad to help you through the land mines … not to much of a problem once created …
Email me at schaefer@rts-services.com if you have any questions …

I’m glad the fix works on UI5 as well!

I’m trying to think of a decent way to add the “All Lights On” and “All Off” X10 commands. One thought was to special-case a binary switch id of “all” (rather than, say, “A1”).

What do you think?

/Andrew

Sent from my iPhone using Tapatalk

I’ll see what I can do. That should work and the code would be a simple call.

Thanks

Hi all,

I’m new to Vera. I’ve a VeraEdge with UI7 installed on it.
I want to migrate my X10 devices from my Domoticz system to the VeraEdge. I hava a CM11 and a CM15Pro.

This X10 plugin is looking verry good to me!
The only problem I have is on step 5. I can’t find a CM11 device and a little wrench… Is this a UI5 option? Where can I find this “wrench”-button in UI7?
The only thing I see in my devices are some “X10 A1”-lights that are showing up. But where can I add my own X10 devices in the VeraEdge with UI7?

Hope for an answer :slight_smile:

[quote=“Ivan86NL, post:10, topic:187817”]Hi all,

I’m new to Vera. I’ve a VeraEdge with UI7 installed on it.
I want to migrate my X10 devices from my Domoticz system to the VeraEdge. I hava a CM11 and a CM15Pro.

This X10 plugin is looking verry good to me!
The only problem I have is on step 5. I can’t find a CM11 device and a little wrench… Is this a UI5 option? Where can I find this “wrench”-button in UI7?
The only thing I see in my devices are some “X10 A1”-lights that are showing up. But where can I add my own X10 devices in the VeraEdge with UI7?

Hope for an answer :)[/quote]

Interested in same question - app installs and then I end up with 4 x10 devices, but not sure how to config for my devices…

Sorry, will need to look at the apps install area to see if the instructions were included.

But for now, go here

In UI7, is there a settings icon for the device of the CM11? On UI5 you need to hover the mouse over the upper right corner.

So I messed around a bit more with this - one odd thing with UI7 is that you can’t “see” the parent device for some reason…when the device gets installed

SoftstartModules A1,A2 and MotionSensors M1,M2 get made and are visible in the devices. If you load AltUI, you can see the parent device and by selecting Variables from the dropdown menu (or control panel → variables) you can edit the fields for:

BinaryModules: a comma separated list of house/unit codes for any appliance modules you may have. For example: “A1,D2”
DimableModules: a comma separated list of house/unit codes, but for old style dimmable modules.
SoftstartModules: a comma separated list of house/unit codes, but for newer dimmable modules like any recently produced LM465s.
MotionSensors: a comma separated list of house/unit codes for any motion sensors you may have.

I was able to add 2 BinaryModules (G1 and G2) and they worked!

So basically, to configure the parent CM11 device you need to use AltUI (or some other way I’ve not found yet) to interact with the parent device and to edit the variables…

[quote=“boykster, post:13, topic:187817”]So I messed around a bit more with this - one odd thing with UI7 is that you can’t “see” the parent device for some reason…when the device gets installed

SoftstartModules A1,A2 and MotionSensors M1,M2 get made and are visible in the devices. If you load AltUI, you can see the parent device and by selecting Variables from the dropdown menu (or control panel → variables) you can edit the fields for:

BinaryModules: a comma separated list of house/unit codes for any appliance modules you may have. For example: “A1,D2”
DimableModules: a comma separated list of house/unit codes, but for old style dimmable modules.
SoftstartModules: a comma separated list of house/unit codes, but for newer dimmable modules like any recently produced LM465s.
MotionSensors: a comma separated list of house/unit codes for any motion sensors you may have.

I was able to add 2 BinaryModules (G1 and G2) and they worked!

So basically, to configure the parent CM11 device you need to use AltUI (or some other way I’ve not found yet) to interact with the parent device and to edit the variables…[/quote]

Great, glad you got that to work. I do not have UI7 yet as there is so much about issues with things that would anoy me…lol

Hopefully this can help others who want to use the plugin. The key is getting access to the parent device to access those variables. AltUI seems to access the device hierarchy differently (and better) than UI7.

As it turns out, I’m retiring all my X10 stuff for z-wave switches/outlets,but it was fun trying to figure out what was going on.

Thanks for the work on the plugin!

I was glad to find this, as I just got a Vera Plus after being out of home automation for a few years (having your house burn down will do that to a guy).

I got a one of the newer controllers from JV Digital Engineering, and a Tripp-Lite Serial to USB adapter. Installed the plugin (Vera Plus, U17), it created the device and the 4 sample units (A1,A2,M1,M2) and then I used AltUI to reconfigure the units. I created just one, for testing, at G1. Reloaded the LUUP engine, and it got created. (SimpleBinary).

Unfortunately, I can’t control it. I get an on/off toggle switch, but clicking it does not change state at all.

I tried creating another, dimmer module, and moving the slider to 100% just resulted in “Cannot detect device.” And now AltUI shows the CM11_Interface in red, which I assume means it can’t be detected either. (AltUI doesn’t have the “Logs” interface that I can find, and the CM11 doesn’t show up in U17).

Any suggestions on what to try?

I’m still not using UI7 and certainly not AltUI. Without seeing the feedback on the vera unit in the cmh/luup.log file on the unit, it will be hard to debug.

Thank you thank you for this! I’m a new convert to Vera but have a stack of X10 kit that I am now going to be able to slowly wean myself off from. Initially tried mochad running on a 'pi, but it didn’t recognise my controller - later worked out it needed a CM15 which I didn’t have. For those who may be interested, I have a Vera Edge, with HA125 (Rebadged CM12, which is the Aus/UK variant of the CM11). I did the following:

[ul][li]Installed the CM11 Plugin in Vera[/li]
[li]Waited for a while and eventually the default modules appeared - I have now found this can be kick-started by choosing an existing module, going into advanced/service/reload engine. Can also log on remotely via ssh, username root and password as printed under the Vera, and type ‘reboot’.[/li]
[li]Went into apps/develop apps/serial port config - and changed the speed to 4800 and assigned it to the CM11[/li]
[li]I could not see the CM11 device so I then installed ALTUI from the apps/install apps option[/li]
[li]Went to http://local-vera-address:3480/data_request?id=lr_ALTUI_Handler&command=home#[/li]
[li]Went to devices/cm11_interface/variables and added in my modules[/li]
[li]Then I picked a module at random, and forced a reload, and they all appeared![/li][/ul]

Would be nice if this was all supported natively, but fantastic work. Much appreciated!

** Minor Update **

Have found that after time, the X10 side becomes unresponsive. All the Zwave stuff is fine, but when I try to (for example) turn on an X10 light nothing happens. Sometimes it seems to fix itself, other times it just stays dead. I’ve just found that reloading the engine (device/advanced/new service/reload engine) appears to fix it but obviously this is not a long term/permanent thing. My guess is it’s running out of resources somehow, and the only fix is the restart. Possibly could schedule this to happen somehow - maybe it already does this as indicated by it ‘fixing itself’, or it could be because I have a new installation that I’m playing with I’ve been doing unintentionally.

Have added in two new scenes - one that runs the command “os.execute( ‘reboot’ )” at 1am every Monday morning (to completely reboot the Vera) and one that runs the command “luup.reload()” at 1am every other morning (to just restart the engine) and will see if that helps. Will report back!

update Yep - restarting the engine every day seems to have done the trick.

[quote=“ahsboy, post:16, topic:187817”]I was glad to find this, as I just got a Vera Plus after being out of home automation for a few years (having your house burn down will do that to a guy).

I got a one of the newer controllers from JV Digital Engineering, and a Tripp-Lite Serial to USB adapter. Installed the plugin (Vera Plus, U17), it created the device and the 4 sample units (A1,A2,M1,M2) and then I used AltUI to reconfigure the units. I created just one, for testing, at G1. Reloaded the LUUP engine, and it got created. (SimpleBinary).

Unfortunately, I can’t control it. I get an on/off toggle switch, but clicking it does not change state at all.

I tried creating another, dimmer module, and moving the slider to 100% just resulted in “Cannot detect device.” And now AltUI shows the CM11_Interface in red, which I assume means it can’t be detected either. (AltUI doesn’t have the “Logs” interface that I can find, and the CM11 doesn’t show up in U17).

Any suggestions on what to try?[/quote]

Hi

  1. Go into apps/develop apps/serial port and make sure ‘used by device’ is set to cm11_interface
  2. Also make sure that it is set to 4800 baud. If still no joy, then:
  3. Try using ssh to log onto the Vera - use the username ‘root’ and password printed under the unit (command line is ‘ssh ipaddress -l root’)
  4. With the controller unplugged, type ‘dmesg’. Plug it in and type ‘dmesg’ again and see if it has been recognised properly

Cheers

Wondering if there’s any updates/plugin for the wifi hub?