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

i really new in all this, i need some help to install this in my system. can i install this only for ubuntu? or can i install this in windows 7?

This plugin talks to a program called Mochad which only runs on Linux, but it would be possible to do something similar with activehome pro which does run on Windows.

Someone would have to write it though. I suppose the short answer is that for now yes you would have to use a Linux box.

do i have to keep my computer on all the time to receive the communication between the controller and mochad? or this is only for pragramming the controller?

You have to keep your computer on all the time.

The cm15a controller from x10 has a limited ability to run macros without a computer, but that only works if you use Activehome Pro to program it. I have never used it but I have heard it isn’t particularly useful. However, this still does not provide any way to communicate with Vera.

I run mochad on a small PogoPlug device. This is a small embedded linux computer that only uses about 5w of power. That way I don’t have to have one of my desktop computers on all the time. Right now the best price I can find online is about $50 but you can sometimes find them as cheap as $30 or $35. You would also need a usb flash drive to put linux on if you go the PogoPlug route.

It is also possible to run mochad on a router with a usb port that can run openwrt and a few different NAS devices with usb. This is a bit tricker to set up, but if you already an extra router or a NAS you leave on all the time it might be an OK option.

I am happy to provide further direction if you have questions about specific devices.

So I took @Intrepid’s advice and picked out a few outdoor floodlights which arrived today along with quite a few ds12a sensors. It looks like the ds12a data isn’t being decoded right by mochad (which @Intrepid also mentioned quite some time ago). It also looks like mochad hasn’t been updated in a while, and the developer seems to have gone awol, so I will probably need to take a look at patching it myself.

The topic has been pretty quiet otherwise, so I hope this plugin is working for everyone.

It is working great! I have a few MS15 motion sensors and a couple of keyfob remotes and palmpads running. It just works!

I have not yet installed my CM15 controller, and therefore have not installed the floodlight motion sensors (they use powerline X10 so I need the CM15).

If you’re looking into the X10 part, have you looked at something like misterhouse?

http://misterhouse.sourceforge.net/

Could it run in the place of mochad and add any functionality?

radarengineer,

Thanks for the update and sorry for the late reply.

Unfortunately, the update doesn’t work for my DimmableModule.

On GUI button:

12/06 11:45:52 Tx PL HouseUnit: A3
12/06 11:45:52 Tx PL House: A Func: Dim(31)

Lamp gets switched on, but dims down to the off state.

Off GUI button:

12/06 11:46:40 Tx PL HouseUnit: A3
12/06 11:46:40 Tx PL House: A Func: Off

Nothing happens.

On GUI button:

12/06 11:46:50 Tx PL HouseUnit: A3
12/06 11:46:50 Tx PL House: A Func: Dim(31)

Nothing happens.

GUI slider 50%:

12/06 11:47:15 Tx PL HouseUnit: A3
12/06 11:47:15 Tx PL House: A Func: Dim(16)

Nothing happens.

On GUI button:

12/06 11:47:32 Tx PL HouseUnit: A3
12/06 11:47:32 Tx PL House: A Func: Dim(31)

Nothing happens.

On GUI button:

12/06 11:47:44 Tx PL HouseUnit: A3
12/06 11:47:44 Tx PL House: A Func: Dim(31)

pl a3 bright 31 does work:

12/06 11:55:14 Tx PL HouseUnit: A3
12/06 11:55:14 Tx PL House: A Func: Bright(31)

Don’t worry about a late reply, I’m happy to keep trying new things with this plugin!

I don’t have any of the old non extended dimming modules. Do you have any idea what the proper command sequence should be? Changing the Lua code to generate the correct sequence is fairly easy but it is clear that my best guess on what to send mochad is wrong. I might try to get a hold of an old module just for testing.

Unfortunately, it gets really complicated:

[tt]http://davehouston.net/micro-dim.htm[/tt]

My own research (visual inspection only):

off state → pl a3 bright 31 → full brightness
full brightness → pl a3 dim 31 → off

full brightness → pl a3 dim 0, pl a3 dim 0, … (about 34 times) → off

full brightness → pl a3 dim 1, pl a3 dim 1, … (about 18 times) → off

full brightness → pl a3 dim 2, pl a3 dim 2, … (about 10 times) → off

full brightness → pl a3 dim 3, pl a3 dim 3, … (about 7 times) → off

full brightness → pl a3 dim 7, pl a3 dim 7, … (about 4 times) → off

off → pl a3 bright 0, pl a3 bright 0, … (about 30 times) → full brightness

Please note that

‘pl a3 bright x’ followed by ‘pl a3 on’ doesn’t change the brightness, but
‘pl a3 bright x’ followed by ‘pl a3 off’ and ‘pl a3 on’ does change the brightness to max level (a bug in [tt]mochad[/tt]?)

and

pl a3 dim 31 → pl a3 bright 10 → pl a3 off → pl a3 bright 0 → max level ???

@Ap15e, it does get complicated! @Intrepid, I have taken a look at the misterhouse X10 support. I’m on the list and exchanged a few messages with the guys doing the X10 maintenance.

I am trying to order an old non-softstart module for testing purposes. That way I can actually try things out and maybe have a better chance of making this all work with older modules.

Unfortunately, it looks like mochad is no longer being updated. I will probably try to patch it myself for the ds12a (not sure if I mentioned this before in this thread). It also looks like X10 is no longer making X10 devices? That was the rumor and now they are showing out of stock on more and more X10 devices. :frowning:

Oh well, I’ll still be supporting this plugin!

So I found and purchased a few old X10 power line modules that are non-softstart (a couple of sellers on ebay having IBM home director room expansions kits really cheap).

I now have both cm19a and cm15a controllers as well as soft-start and non-softstart modules, so I should be able to test wireless and non-wireless control of all lamp and appliance modules.

I also set up a pogoplug with a big hard drive to use for development purposes and hopefully get some patches for mochad; I still want to patch it to support ds12a modules. I have 11 of them that I recently picked up at X10.

That all being said, I have been really busy recently and I think it might take a few weeks for everything to settle down. So no guarantees on a timeline. :frowning:

First off, radarengineer, I’d like to express my thanks for developing this functionality and making it available to the rest of us!
It became the key factor when it came to deciding whether or not to continue with Vera and all it’s idiosyncrasies. So I very much appreciate it (and MCV should too as it prevented a swift return of their product =>“works with INSTEON, X10 and other platforms”. )

Being able to incorporate a host of cheap X10 motion sensors into my setup makes it doable. I’m hoping that there will be more zwave options available in the future and that competition drives the price/unit down a bit. And I’m hoping that my X10 devices will see me through until that day arrives. Fingers are crossed as the PogoPlug continues to chug away.

I get the impression that the supply of cheap MS10As has pretty much dried up. I see a few MS18As. Is there reason to believe those will work with Mochad? I’ve not seen any discussion to that effect. Any info that you know of?

@khyizang, glad my plugin was useful to you! Sadly it isn’t just the MS10A sensors that are drying up. It looks like the cm15a controllers are sold out too.

I don’t have any MS18A sensors, and have no personal knowledge of them, but from the X10 wiki (MS18A - X10Wiki):

Q: What makes the SMART Motion Detector (MS18A) different than the original Motion Detector (MS10A)? A: The new SMART Motion Detector has a rounder, more modern design. Plus, it has a tamper-resistant feature that triggers the alarm system when the Sensor is tampered with!

Q: Does it work with my old security console?
A: Absolutely! The SMART Motion Detector works with both the new SecuriLINK Console and Protector Plus Console (PS561).

It sounds like it is using the same RF protocol and I would expect that it works fine as is. If not, it should be possible to modify mochad (the daemon) so that it does. If the plugin needed a change it would be trivial. A new version 0.1.14 was just released by mmauka (mochad dev) on Jan 15 with support for the ds12a, which is good news because it means it is still being developed. I’ll try to get a build put togeather for the pogoplug sometime soon.

I’m finally trying to brush the dust of this plugin again. I uploaded a new binary version of mochad for the pogoplug (supporting ds12a sensors) here:

http://naething.com/mochad-0.1.14_pogo.tar.gz

You can see my earlier installation instructions, they should still be valid:

http://forum.micasaverde.com/index.php/topic,7463.msg47969.html#msg47969

Of course, if you can also just do this all manually:

I would recommend doing this on a pogoplug with a USB harddrive and not a memory stick. Also, I proceed any commands that need to be run as ‘root’ with ‘sudo’ (you have to first set up sudo on your pogoplug). If you are running this as root simply ignore the ‘sudo’ (just type in the command without it).

[code]

There are extra packages that you will need to have if you want to compile mochad yourself from scratch.

(there maybe more that I missed too!)

pacman -S gcc #this is a big
pacman -S make

sudo pacman -Sy # Update repository information:
pacman -S libusb # install libusb

Download mochad:

wget -O mochad-0.1.14.tar.gz Download mochad

tar -zxvf mochad-0.1.14.tar.gz # Extract the files from the tar ball:
cd mochad-0.1.14 # Go into the mochad directory
./configure # Configure the build:
make # Compile mochad
sudo make install # install mochad (if you have set up sudo)
make install # otherwise as root:

Now plug in the cm15a/cm19a and test out mochad

You can use netcat to try out mochad:

sudo pacman -S openbsd-netcat
nc.openbsd localhost 1099

If this returns immediately you have a problem.

Otherwise, try sending an X10 command (see the mochad README)

or tripping a motion sensor.[/code]

Just wanted to let you know i have been running on the new release of mochad without any issues for about two weeks now, on my ttylinux system.

This plugin has been pretty solid and i have been using it since october. Last night i was playing with geting the kr10 security remotes working and can send you the function once i get it integrated…

I have tweaked my plugin slightly and added a function to convert the security addresses to bcd since that is how the x10 active home software stores them in their xml file.

@localuser, I would really appreciate that!

I’m going to see if we can get mochad added as a package in archlinuxarm for those of us who use a pogoplug. In hindsight that is something I should have done a while ago. I’m also experimenting with RF dimming of non-softstart modules (to solve the problems experienced by @Ap15e).

I also picked up a mini-controller and I’m trying to figure out the best way to integrate that into the plugin. I plan on using it to trigger different scenes by having it on otherwise unused house/unit codes. Right now I’m just adding an appliance module for each of the buttons I want to map to scenes. I think this limits me though to having a scene per device code (A1) rather than two (A1 “off” and A1 “on”). I’m sure there is a smarter way to do this and I’m open to suggestions.

radarengineer,

I have the plugin working with an alarm panel now. It ues the S_AlarmPartition2.xml to arm/disarm the x10 alarm panels.

I pretty much had to modify all of the files to get it working and add a few more. If you want to give me access I can check in my updates to code.mios.com for you to review.

The basic concept is that there is another variable (RFSecRemote) that you enter a rf security code in similar to the RFSecDoorSensors security code. Once the Alarm Partition device is created, then go to the alarm console (sc12a or ds7000) and put it in add mode. From the vera dashboard press the “arm” button on the X10 Alarm Partition button.

For me I just used a security code from a KR10a remote that was already paired to the alarm panel.

@localuser, that is terrific! You should now have access to the repository.

I’ve been doing a little testing myself under UI5 and it looks like there are some issues still with this plugin and controlling appliance and light modules. Still trying to track that down.

FYI,

I purchased a MS18A and tried it. It’s recognized as a MS10A and seems to work fine using your plugin. Two AA batteries are required instead of the 4 that the MS10A needs. Overall, it seems to be a bit less sensitive than the only MS10A I have to compare with.

I like the fact that it will hold it’s address if weak batteries are detected and swapped out quickly enough. Am I correct in concluding that the current code doesn’t manage the status reports from such devices? If it doesn’t, then I suppose some other means will be necessary to monitor battery status.

First, mochad is now in the pogoplug repositories! I’m going to remove the links to my builds since there is an official one. :slight_smile:

@khyizand, mochad does not seem to identity low battery alerts from the MS10A:

However, supposedly it does change its signal for low battery:

So for now the answer is no; but this is worth testing out. If we can verify that that low battery bit is actually flipped then it should be a pretty simple change to the mochad code (we just need to add a Motion_alert_low_MS10A Function/Key Values). It would be a nice thing to have, and the mochad plugin should at least support this notification for the ds10a because mochad already picks up their low battery levels.