X10 CM11 Plug-in for Vera !

Hello to every body,

I’ve develop a Plug-in to control and monitor some X10 devices through a CM11 unit. I’ve attached a beta version to test it.

Recently I’ve purchased a Vera Lite to explore the Z-WAVE world, but I have a few old X10 devices that I want to still use.

As MCV does not natively support X10, I´ve created this plug-in, based on the excellent work done by radarengineer in MOCHAD for Vera. Thanks radarengineer for your plugin.

I’ve simplified the interface definition as some of them are not applicable to CM11 (I.e. RFXSEC).

Please, consider that I am very bad at programming and I just own few devices (ON/OFF units), so testing is limited.

What the plug-in aims to do/offer:
· Command ON-OFF (binary states in general) of X10 devices (what I use).
· Command Dim/Bright units. This functionality is under “theoretical” testing as I do not own any dimmable unit.
· Incoming commands are also processed and update in Vera Dashboard
This is very useful if you have additional controllers (i.e. RF remotes). CM11 captures the command and instance vera dashboard with it.
Scenes could use this command to perform actions. You can use “non real” devices to trigger scenes/events. Example: You have a wireless remote configured to send E1 ON/OFF. You define a X10 device E1, and use it as trigger to start a scene.

· Not external libraries are required. Self contained solution.

Not doing:
· Extended code. I do not use it since I have not devices. I think it is no very difficult to implement it (I.e. cyclic status request function), but …
· Special functions (i.e. ‘All units off’) are implemented in the internal X10 commands constructor but not instanced from Vera. I think this functionality could be done with scenes, but if necessary I think it is easy to implement.

You obviously need a USB-Serial line adapter properly installed.

See:
http://forum.micasaverde.com/index.php/topic,1471.0.html

To install the plug-in follow the process defined in the wiki (created device), and finally set in Serial port Configuration that the serial line will be used by the device you have created.

Serial Line settings:
Baud Rate: 4.800 bps
Parity: None
Data Bits: 8
Stop Bits: 1

Hopefully you enjoy my plug-in.

Cheers
César

César,

That is great, I would had to have this plugins.

I downloaded the plugins and installed it.

Unfortunatly It created both device A1 and A2 but it does not seems to communicate with my CM11A

May be I forgot something.

Since I can not configure the ioport into the module, Do you have some instruction on how assign which serial port the module will use ?

Thank you for your help.

Hi Charly86,

First of all you need a serial connection, I mean a USB to Serial converter.

To install it you have to follow instructions at http://forum.micasaverde.com/index.php/topic,1471.0.html.

I tried with both PL-2303 and FTDI chipset and both ones work fine. I prefer the FTDI, but 2303 is much cheaper and works (at last the one I have).

The most important think, I believe, is to set the device (below for my FTDI; for PL-2303 is similar with dmesg info)

“ftdi_sio vendor=0x403 product=0x6010” > /etc/modules.d/65-usb-serial-ftdi

One you have done that, check that you have this ID in file serproxy.ports (at /etc/cmh/), if not, add it.
So, I have for my FTDI (only one line):
vendor:0403 product:6001

Once you have the serial line installed, you have to configure it.
Go to APPS → Develop Apps → Serial Port Configuration
Configure with above settings, set a name for the connection and used by CM11_Vera_Interface (or the device name when installing the plugin).

Save, and It should work.

I have updated the lua implementation to improve dimming feature.

Regards
César

César,

Thank you for your quick response :slight_smile:

Yeah, I followed the instruction, but I think they are for UI4 and not for UI5 (I do not hav any serproxy.ports file)

root@MiOS_xxxxx:/etc/cmh# ls s*
scenarios             servers.conf.default  srv_timestamp
servers.conf          services.conf
root@MiOS_xxxxx:/etc/cmh#

I posted in this thread to explain my problem with usb serial http://forum.micasaverde.com/index.php/topic,1471.30.html, which I think is the source of my problem, as you can see in the thread, my both USB serial are recognized by the kernel but not in the UI5.

I tried to add the information on the file 65-usb-serial-ftdi (because I got one ftdi) but no luck, when I go in serial port configuration, still do not see it.

Like you I hate pl2303 and love ftdi (just because they have a unique serial number and can be detected and affected with the same ttyUSBx at boot with udev, unfortunalty not possible on vera)

To try to avoid a problem in vera and check it out, would it be possible to use the CM11 from another box configured with ser2net (the same that serialproxy) then in you plug ins just tell it to use a remote serial proxy (typing the IP and port) ? I would like to try this to be sure. I can setup this config in the xml file if you can tell me where it is located.

What do you think ?

Oh, by the way, are you on UI4 or UI5 ? Also to you put anything on the Serial Port Configuration Fields named “path” and “port” ?

The serproxy.ports file can be created if its not there as its contents augment the built-in (hard coded) default list.

Guessed

you know what ? I created and populated the serproxy.ports file with my both usb serial adapters (one ftdi and one cp210x)

And you know what ? I now can see both in Serial Port Configuration in UI5

you saved my life of this thread http://forum.micasaverde.com/index.php/topic,1471.30.html,

thank you thank you, I will now investigate on César plugins, but still no luck with it.

NB : Amazing that you buy a final product and need to to ssh,create file and populate the file to get things working …

You’re welcome. It has a number of built-in default Serial Port setups, but if the specific device has another then it does need to be added manually.

Most of these embedded [style] units have the drivers but don’t install all of them in order to avoid the resource usage (since they’re typically strapped for memory)

If your device is common, then list it’s key in the main Serial Port config thread and maybe CJ will add it to the perm list (which, to be honest, should ALL be inside of [tt]serproxy.ports[/tt] so people can remove if they don’t want)

Good afternoon. I downloaded the files. copied to Vera3, the application appears to be installed on. how to install the necessary plug-in? thank you ???

Hello César,

I’m using your CM11 plugin on my Vera Lite (UI5) and am very happy to see my X10 appliances come to life again after years of oblivion. Thank you for the good work! There is however a problem with my MS13 motion sensors, which do not seem to report any triggers. I have of course a TM13 transceiver plugged in too. Since motion sensors are apparently supported by your plugin, I thought the MS13 might work as well (with the help of a TM13). Have you tried some of those?
Best regards

Well I’ll modify this as Brientim answered in another forum
http://forum.micasaverde.com/index.php?topic=10817.new;topicseen#new
So I think my confusion was I needed download both of your attachments (I only downloaded the new one)
Thanks

[quote=“rjwilson01, post:10, topic:171742”]Well im lost
I’ve got my serial port configured ( I think ) but without knowing how to get this plugin installed its hard to tell (but the serial port shows up in the web interface)
i think the part I dont understand is this
“To install the plug-in follow the process defined in the wiki (created device)”
I can find nothing on the Wiki (MiOS) about creating devices from downloaded luup files
I did go to the apps/developapps/luupfiles and uploaded your file, but i have no clue of what to do next
My worry is you actually mean the wiki called “Luup Plugins ByHand” Luup Plugins ByHand - MiOS - I think that will do it … but thats a fairly large amount of stuff I’m going to have to read and understand[/quote]
@rjwilson01,

As this is cross posted did you follow the instruction on the other thread?
http://forum.micasaverde.com/index.php/topic,10593.msg82160.html#msg82160

Edit: Yes, you just responded/modified previous post as I was typing!

Great, at last een plug-in voor my old cm11. I wil trye it tonight.

Peter

The switches A1 and A2 stil don’t work on the vera lite
They only work with a IR7243 (lightnet) controller.

the serial cable seem to work:

5 10/05/12 18:56:11.923 IOPort::Run starting for 87 <0x2dbb3680>
25 10/05/12 18:56:11.923 IOPort::Connect device 87 connecting to 127.0.0.1:3482 iodevice: 80 path /dev/ttyUSB1 <0x2dbb3680>
25 10/05/12 18:56:11.924 IOPort::Connect connect 1: 127.0.0.1:3482 <0x2dbb3680>
25 10/05/12 18:56:11.925 IOPort::Connect connect 3: 127.0.0.1:3482 m_socket_handle 14 <0x2dbb3680>
25 10/05/12 18:56:11.946 IOPort::Connect OK 127.0.0.1:3482 <0x2dbb3680>
25 10/05/12 18:56:12.003 IOPort::ConfirmSocketHandle device 87 success 1 handle 14 connecting 0 <0x2c3b3680>

The cm11 seems to work:

10 10/05/12 18:56:12.006 XXX-UpdateSystemMessagesTasks now 1=CM11_Interface[87]: Running Lua Startup <0x2c1b3680>
10 10/05/12 18:56:12.007 UserData::m_iDataVersion_Variables_incr short sys message user data 456155001 variables 456155083 <0x2c1b3680>
31 10/05/12 18:56:12.007 AlarmManager::Run finish callback for alarm 0xaf4288 entry 0xf0f808 type 24 id 58 param=(nil) entry->when: 1349456171 time: 1349456172 tnum: 1 slow 0 duration 0 <0x2c1b3680>
06 10/05/12 18:56:12.085 Device_Variable::m_szValue_set device: 87 service: urn:micasaverde-com:serviceId:CM11 variable: e[35;1mIncoming_CM11_buffere[0m was: now: #hooks: 0 upnp: 0 v:(nil)/NONE duplicate:1 LEAK this:28672 start:540672 to 0xf46000 <0x2c3b3680>
06 10/05/12 18:56:12.096 Device_Variable::m_szValue_set device: 87 service: urn:micasaverde-com:serviceId:CM11 variable: e[35;1mPolling_statuse[0m was: 0 now: 0 #hooks: 0 upnp: 0 v:(nil)/NONE duplicate:1 <0x2c3b3680>
06 10/05/12 18:56:12.097 Device_Variable::m_szValue_set device: 87 service: urn:micasaverde-com:serviceId:CM11 variable: e[35;1mBuffer_CM11_no_bytese[0m was: 0 now: 0 #hooks: 0 upnp: 0 v:(nil)/NONE duplicate:1 <0x2c3b3680>
06 10/05/12 18:56:12.097 Device_Variable::m_szValue_set device: 87 service: urn:micasaverde-com:serviceId:CM11 variable: e[35;1mProcessed_bytese[0m was: 0 now: 0 #hooks: 0 upnp: 0 v:(nil)/NONE duplicate:1 <0x2c3b3680>
06 10/05/12 18:56:12.097 Device_Variable::m_szValue_set device: 87 service: urn:micasaverde-com:serviceId:CM11 variable: e[35;1mold_funct_cmde[0m was: now: #hooks: 0 upnp: 0 v:(nil)/NONE duplicate:1 <0x2c3b3680>
06 10/05/12 18:56:12.098 Device_Variable::m_szValue_set device: 87 service: urn:micasaverde-com:serviceId:CM11 variable: e[35;1mold_addr_cmde[0m was: now: #hooks: 0 upnp: 0 v:(nil)/NONE duplicate:1 <0x2c3b3680>
11 10/05/12 18:56:12.099 Child_Devices::AddChild id A-A1 parent id device type urn:schemas-micasaverde-com:device:BinaryLight:1 parent device: 87 devfile:D_BinaryLight1.xml desc:X10 A1 parms: <0x2c3b3680>
11 10/05/12 18:56:12.100 Child_Devices::AddChild id A-A2 parent id device type urn:schemas-micasaverde-com:device:BinaryLight:1 parent device: 87 devfile:D_BinaryLight1.xml desc:X10 A2 parms: <0x2c3b3680>
11 10/05/12 18:56:12.101 Child_Devices::Synchronize 2 devices parent 87 <0x2c3b3680>
11 10/05/12 18:56:12.101 Child_Devices::Synchronize child 88 current 1 id A-A1 parent 87 <0x2c3b3680>
11 10/05/12 18:56:12.101 Child_Devices::Synchronize child 89 current 1 id A-A2 parent 87 <0x2c3b3680>
11 10/05/12 18:56:12.102 Child_Devices::Synchronize parent: 87 0 new and 0 removed devices <0x2c3b3680>

can anyone help me?

Peter

I have my vera reinstalled but it stil not working.

switches A1 and A2 don’t work. And i don’t no what is the problem.

I have only new log files and device 24 is switch A1 automaticly made bij C11 plugin

06 10/12/12 17:23:29.452 Device_Variable::m_szValue_set device: 23 service: urn:micasaverde-com:serviceId:CM11 variable: Incoming_CM11_buffer was: now: #hooks: 0 upnp: 0 v:(nil)/NONE duplicate:1 <0x2ba71680>
06 10/12/12 17:23:29.453 Device_Variable::m_szValue_set device: 23 service: urn:micasaverde-com:serviceId:CM11 variable: Polling_status was: 0 now: 0 #hooks: 0 upnp: 0 v:(nil)/NONE duplicate:1 <0x2ba71680>
06 10/12/12 17:23:29.453 Device_Variable::m_szValue_set device: 23 service: urn:micasaverde-com:serviceId:CM11 variable: Buffer_CM11_no_bytes was: 0 now: 0 #hooks: 0 upnp: 0 v:(nil)/NONE duplicate:1 <0x2ba71680>
06 10/12/12 17:23:29.453 Device_Variable::m_szValue_set device: 23 service: urn:micasaverde-com:serviceId:CM11 variable: Processed_bytes was: 0 now: 0 #hooks: 0 upnp: 0 v:(nil)/NONE duplicate:1 <0x2ba71680>
06 10/12/12 17:23:29.453 Device_Variable::m_szValue_set device: 23 service: urn:micasaverde-com:serviceId:CM11 variable: old_funct_cmd was: now: #hooks: 0 upnp: 0 v:(nil)/NONE duplicate:1 <0x2ba71680>
06 10/12/12 17:23:29.454 Device_Variable::m_szValue_set device: 23 service: urn:micasaverde-com:serviceId:CM11 variable: old_addr_cmd was: now: #hooks: 0 upnp: 0 v:(nil)/NONE duplicate:1 <0x2ba71680>

02 10/12/12 17:26:57.398 luvd_get_info mg conn can’t read /etc/cmh-ludl//toolbox.js or /etc/cmh-lu//toolbox.js from filename /toolbox.js pPtrFile (null) <0x2e071680>
08 10/12/12 17:27:01.854 JobHandler_LuaUPnP::HandleActionRequest device: 24 service: urn:upnp-org:serviceId:SwitchPower1 action: SetTarget LEAK this:151552 start:536576 to 0x97c000 <0x2ce71680>
08 10/12/12 17:27:01.855 JobHandler_LuaUPnP::HandleActionRequest argument DeviceNum=24 <0x2ce71680>
08 10/12/12 17:27:01.855 JobHandler_LuaUPnP::HandleActionRequest argument serviceId=urn:upnp-org:serviceId:SwitchPower1 <0x2ce71680>
08 10/12/12 17:27:01.855 JobHandler_LuaUPnP::HandleActionRequest argument action=SetTarget <0x2ce71680>
08 10/12/12 17:27:01.855 JobHandler_LuaUPnP::HandleActionRequest argument newTargetValue=1 <0x2ce71680>
08 10/12/12 17:27:01.856 JobHandler_LuaUPnP::HandleActionRequest argument rand=0.2634547578636557 <0x2ce71680>
06 10/12/12 17:27:01.856 Device_Variable::m_szValue_set device: 24 service: urn:upnp-org:serviceId:SwitchPower1 variable: Status was: 0 now: 1 #hooks: 0 upnp: 0 v:0x6f9210/NONE duplicate:0 <0x2ce71680>

Thank you for your plugin, it works very well, but if the cm11 is unplugged/replugged it won’t work until the unit itself is reset. I tried completely uninstalling it, reloading luup, changing the USB ports, powering off the Vera, etc., but until I plugged the cm11 into my PC and sent it a reset command, (in eventghost, FWIW), it wouldn’t work.

There were no errors, and it would show off & on in the Vera page, but the x10 switches didn’t physically turn on/off. Perhaps a reset function could be incorporated into the plugin and it might help others.

Cheers.

I’m trying to get a CM19a working… it is USB but not showing under Develop Apps \ Serial Port Configuration ?

5 days and no help?

10 days an no help… thx guys

Aaron sorry for not getting back to you. I managed to get a loan of an Australian equiv of the CM19 and CM15 to try and get them running. Now on both account I was not successful and neither were recognised as serial devices. I tried to add the manually as they have the same interface but was once again not successful.

thx… not what I was hoping for, of course. Do you think there might be a possiblilty that we can support the cm19a if we get the Vera to recognize the device?