Plugin for cm15a/cm19a X10 Controllers /w Mochad Linux Daemon (full send/recv)

I just set up, in about 5 minutes, a 50 cent X10 keyfob 4 button remote to turn on/off my inside lights from my bedside. This is such a nice, easy, and inexpensive addition to my zwave network.

I’ve got boxes of this RF stuff. I was never a huge fan of the powerline X10, but the RF stuff is rock-solid. I am so thrilled to be able to use it to control stuff.

Thanks again, radar.

Are there any cheap X10 devices for 433.92 MHz?
Is the CM15Pro compatible with mochad?

I can’t verify that the CM15Pro works, but a quick google search seems to indicate that people are using mochad with it.

Unfortunately, I think the 433.92 Mhz modules are more money than the 310. I know a lot of people overseas still order the us modules. I think you can modify the US RF modules to operate on the European standard, but I can’t seem to find the page describing the modification so don’t take my word on that.

http://www.sariwating.net/index.php/en/home-automation/wireless/11-modify-ds10a-43392mhz
http://www.sariwating.net/index.php/en/home-automation/wireless/10-modify-ms14a-43392mhz

I got [tt]mochad[/tt] compiled on my Synology Diskstation DS-106 (it only took a few hours to find out how to compile the source code - thanks to radarengineer for some valuable pointers). I’ll write up instructions if there is any interest.

Now waiting for my X10 devices to arrive and warming up my soldering iron …

Compiling [tt]mochad[/tt] on a Synology Diskstation DS-106x (DM 2.3)

ipkg install crosstools-native
ipkg install grep (for configure)
ipkg install textutils (for tr in mochad/config.status)
ipkg install gawk (busybox' awk doesn't work)
ipkg install sed 

In addition the following packages might be required:

ipkg install make
ipkg install findutils
ipkg install diffutils
ipkg install coreutils
ipkg install bash

Download and compile libusb-1.0.8 (make sure you are using the latest version) and mochad.

The following devices seem to work ok:

[ul][li]Remote Commander CV 450 (433,92 MHz)[/li]
[li]CM15Pro (433,92 MHz)[/li]
[li]LM15ES (screw in lamp socket)[/li]
[li]LM12 (lamp module/dimmer dim/bright)[/li]
[li]LW12 (in wall lamp module/dimmer dim/bright and xdim)[/li][/ul]

There seems to be a problem with dimming DimmableModules:
[tt]pl a1 dim/bright [/tt] does work, but dimming via Vera’s GUI seems to cause the Luup plugin to send only [tt]bright 1[/tt] commands …

BTW, does anyone know the meaning of the following commands:

09/17 18:31:38 5D 14 FD FF F0
09/17 18:32:39 Unknown RF camera command
09/17 18:32:39 5D 14 FD FF F0
09/17 18:35:45 Unknown RF camera command
09/17 18:35:45 5D 14 FF F3 F0
09/17 18:35:46 Unknown RF camera command
09/17 18:35:46 5D 14 FF FF 90
09/17 18:37:50 Unknown RF camera command
09/17 18:37:50 5D 14 FD FF F0
09/17 18:41:26 Unknown RF camera command
09/17 18:41:26 5D 14 FF FB F0
09/17 18:41:27 Unknown RF camera command
09/17 18:41:27 5D 14 FF CF F0
09/17 18:41:57 Unknown RF camera command
09/17 18:41:57 5D 14 FF 7F F0
09/17 18:41:58 Unknown RF camera command
09/17 18:41:58 5D 14 FF F9 F0
09/17 18:42:28 Unknown RF camera command
09/17 18:42:28 5D 14 FF CF F0
09/17 18:45:03 Unknown RF camera command
09/17 18:45:03 5D 14 E7 FF F0
09/17 18:46:06 Unknown RF camera command
09/17 18:46:06 5D 14 E7 FF F0
09/17 18:47:08 Unknown RF camera command
09/17 18:47:08 5D 14 CF FF F0
09/17 18:47:38 Unknown RF camera command
09/17 18:47:38 5D 14 FF FF C0
09/17 18:48:10 Unknown RF camera command
09/17 18:48:10 5D 14 FF F9 F0
09/17 18:48:41 Unknown RF camera command
09/17 18:48:41 5D 14 FF FB F0

@Ap15e, I’m glad you were able to get everything working on your Diskstation, and thank you for posting instructions.

Did you set the mochad plugin to send PL commands instead of RF? That is preferable because using a cm15a the plugin can send actual percentages instead of dim/bright.

However, when I was first working on getting this plugin working it seemed like everyone on the forum had cm19a and not cm15a I spend more time testing the RF mode. The cm15a will work in either mode so if one is not working you could always try the other in the interim.

I will definitely take a look at the code and see if I can figure out what is going on.

I received my cm15a but haven’t tried it yet. I did an antenna mod on the cm19a, so i’ll probably keep using it. My main interest is the rf motion sensors, remotes, and door sensors and it works great with them.

I’ve tried an appliance module and a chime, and they both work. I’ll try a dimmable module tomorrow and let you know if it works.

I love this plugin. I even put a door sensor on a squirrel trap to let me know when it trips (stupid things got in our attic). I would never use a $50 zwave sensor for such a trivial thing, but a cheap ds10a is fine.

Radar, don’t forget to look into some type of reset if the mochad reboots. vera has to be refreshed if mochad reboots. they’re both on a ups but this would help just in case.

I’ve been looking into that, some of the other plugins have a poll function that makes sure the connection is alive. Definitely on my to do list!

I tried a lamp module. It will turn on and off, but not dim.

I’m trying to figure out the problem and should be posting a new version shortly.

I also added a poll() method which will notify vera if the connection drops, I think that will fix the reconnect issue.

I just uploaded a new version with some major changes which hopefully will fix the problems you both were seeing. I also moved all the Lua functions to a separate file which helps with debugging quite a bit. That means four files that have to be uploaded to Vera.

If you ever get a Bright(1) or Dim(1) command being sent by mochad that is because mochad is doing RF->PL conversion for a cm15a. Probably not what you want, and you should set PowerLineControl to 1 in the mochad plugin options. @Ap15e, you probably were seeing this because I had a bug in the previous version of the code that checked that variable. :frowning:

Dimming modules through PL control is much nicer than RF. In PL I can just send a dim level directly, for RF I have to send dim / bright commands one at a time and pause for a second in between then to allow the command to get sent, plus the levels of dimming available are limited. However, both should be working now.

Please keep the bug reports coming! Also, if something isn’t working the way you expect if you can include a portion of the log from mochad that helps a lot too. :slight_smile:

I tested the new version with the following:

  1. ds10a (RFSEC door sensor)
  2. ms14a/ms16a (motion sensor)
  3. ms10a (RFSEC motion sensor)
  4. appliance, dimmable, and xdimmable modules.

And both RF and PL control.

Thanks.

I’m getting some strange things with my test dimmable module. Sometimes it works on/off. Sometimes it says ‘delivery failed’ and then refreshes/reboots vera.

Also, it does not seem to dim at all. The UI shows a dim level, but not the lamp.

edit: sometimes, it actually turns the light on, but the UI shows off. This appears to only be on the lamp module. Don’t worry to much about cm19a dimming as far as I’m concerned…I won’t use dimming X10 with this anyway.

Also, I rebooted the pogo, and it still requires a refresh of vera to get it working again.

Hmm, that is ugly. :frowning: You are still using a cm19a and have PowerLineControl set to 0 in the plugin right? I’m going to hook up my cm19a again and see if I can reproduce this.

Do you know what gets sent in mochad when you try to set the dim level?

12/31 18:09:13 Tx RF HouseUnit: A15 Func: Off
12/31 18:09:15 Tx RF HouseUnit: A15 Func: On
12/31 18:09:17 Tx RF HouseUnit: A15 Func: Off
12/31 18:09:22 Tx RF HouseUnit: A15 Func: Off
12/31 18:09:23 Tx RF House: A Func: Bright
12/31 18:09:24 Tx RF House: A Func: Bright
12/31 18:09:25 Tx RF House: A Func: Bright
12/31 18:09:26 Tx RF House: A Func: Bright

here’s an off/on/off then a dim up to about 50%. looks like it is doing what is intended? Maybe its a bad module.

I’ll grab another.

ok, tried another, same result…no dimming. i have not seen any more ‘delivery failed’ errors…maybe that was fixed with some reboots.

Seriously, don’t spend much time on the dimming/cm19a. I won’t use it. But i’ll be glad to test it.

That does look correct. The last A15 OFF is because X10 RF Dim/Bright commands are sent to a House Code and not a specific Unit Code.

Basically if the unit is currently off I sent off again, if it is on I sent on again. That sets it to the last used RF device, and then it will intercept the dim/bright commands.

As for “delivery failed”, I was able to reproduce it once… I think I was doing a lot of dimming / brightening. I think, but I’m not sure, that what is happening is that multiple dim/bright commands are being executed at once because it takes up to 10 seconds for one to finish when using RF. Do you think that might be what you are seeing?

If (and that might be a bit if!) that is what is happening I’m not sure how to fix it. Basically multiple Vera threads trying to write to mochad at once. The way to solve it would be make sure you let one finish before starting another dim/brighten.

EDIT: @Intrepid, I’ll try to track this down a bit more, but as I think you are the only one I know of who is using a cm19a I say we don’t worry about it too much right now unless you need the functionality :slight_smile: My guess right now is that your device doesn’t respond to a bright command when it is off. I only have the new softstart lamp modules and they do.

No problem whatsoever. It works GREAT for my needs as-is.

I prefer z-wave with polling for important stuff. But this is a great way to get some life out of the old cheap stuff I already have.

Plus, there is no z-wave equivalent for a few X10 items, like the motion floodlights. And the X10 motion sensors and remotes are actually more reliable right now in my opinion. And much cheaper.

On your CM15a, did you install an external receive antenna jack? I haveone on my CM19a, plus I have the RF extender unit (SR731/PSX01…discontinued but works great for RF devices). I will try my CM15A, but don’t want to mod it quite yet.

Thanks again for all your work on this.

So about 3:00 today I got a prowl notification that said “squirrel”. I checked my attic trap with a ds10a, and there was the critter.

Gotta love home automation.

That is hilarious! I used to live in upstate NY and keeping squirrels out of the attic was almost a full time job. :slight_smile:

The X10 floodlight motion sensors are on sale for about $16 each in a 2 pack on the x10 site. These haven’t gone on sale in a while.

These are good weatherproof outdoor sensors, very reliable. I have 2 installed but ordered 4 more. I don’t use the floodlight part, but I install the motion sensor part on my exterior light fixtures.