Legacy X10 Support

I am a Misterhouse user who is interested in openHAB as the community seems MUCH more vibrant and fresh.

Currently I am using X10 exclusively with the CM11a transmitter and the MR26a RF receiver.

I haven’t been able to find sufficient information on the status of x10 support with openHAB. Is it planned?, Is it working? Any workarounds?

I realize I can use an Insteon PLM for transmitting (I don’t want to though :smile: , but I NEED my RF signals!

Hopefully I can find a new home for my obsession!

There is an officially supported binding here. It requires the Mochad daemon which works with the CM15A and CM19A controllers so I don’t know if it will be much help for you.

There is a discussion about adding X10 to openHAB here. One of the posts is for a CM11a compatible binding on this discussion but it looks like it was abandonded as it could not be made to work reliably on Windows.

The last posting on this thread has a solution if you are running on Windows with Active Home Pro installed. If Misterhouse can be triggered through an API or from the command line (i.e. trigger switches, read sensors, etc) you can use the appropriate binding for the API (e.g. HTTP) or the Exec binding to call scripts. That is what this Active Home Pro solution is based on.

Beyond that the most I can find it to work through the Insteon PLM.

Another person posted how they created an Arduino gateway to bridge between X10 and probably MQTT (didn’t say what protocol they used) to communicate with openHAB.

I think X10 is very possible, but you may need to interact with an intermediary.

For the most part, X10 is mainly popular in the US and the majority of the developers and maintainers are in Europe so to add X10 to openHAB will require a developer with lots of X10 devices and some Java experience to code it up.

I’m a new OpenHAB user and it looks like X10 options for RF transmitters is either use mochad or EXEC and run some sort of command line tool (like heyu).

I’ve a Firecracker CM17a which mochad does not support, but I didn’t really want to mess with command line spawning. So I managed to fairly quickly knock up a (limited and incomplete) mochad clone that works with my transmitter. I’ve posted it https://bitbucket.org/clach04/mochad_firecracker - this can work with https://github.com/glibersat/python-x10 so this would be another way to get CM11a support.

This works for me but so far I’ve only experimented with switches (which is pretty much all I need).

Been a long time.

I have been testing OH with misterhouse. As MH can read/write X10 great, I was thinking of using that as a device controller. I can easily enough send an HTTP command to MH to turn on or off a light, but I need to be able to send the state of a light back to OH.

I was thinking of using OH as a server, and MH can send OH data like “Living_Room_Lamp=on”, but I don’t know how to set it up in OH. I was thinking it would be like:

Switch Light_GF_Kitchen_Ceiling “Ceiling” (GF_Kitchen, Lights) {tcp="<[localhost:4040:‘REGEX((.*))’]"}

in the items file, but I don’t know what to do with it.

Any idea on how to do this?

Craig

If you can get MH to make HTTP GET, PUT, and POST calls, just have it use OH’s REST API. If you do this you only need set up the Item without a binding and MH, or something MH calls will update and/or command the Items directly.

Alternatively you can set MH up to publish to MQTT and OH to subscribe to MQTT and issue messages and commands that way.

Personally, I’ve only resort to tcp as a very last resort.

You can see an example script where I publish GPIO states and receive commands for GPIO states over MQTT here which might provide some inspiration. There is at least one Perl MQTT client library in CPAN

If you still prefer TCP, see the wiki page for the TCP binding:

The big design piece will be setting up the REGEX to parse out the incoming Strings and assign the correct value to the correct Item. For example:

Switch Light_GF_Kitchen_Ceiling {tcp="<[ON:localhost:4040:REGEX(Light_GF_Kitchen_Ceiling=on)],<[OFF:localhost:4040:REGEX(Light_GF_Kitchen_Ceiling=off)]", http=">[ON:blah blah blah], >[OFF:blah blah blah], autoupdate="false"}

NOTE: I just typed in the above and it may be completely broken as written.

I’m sure there are ways to combine and make the above a little more terse but I don’t know enough details nor have the experience with either binding to know for sure it would work.

Finally, the autoupdate=“false” will prevent the commands coming in from the TCP socket from triggering the HTTP binding to resend the command back to MH.

When you get this integration done I’m certain the community here would love a quick tutorial on how you made it work in the Examples and Tutorials section.

Thanks for the info. For now I would like use TCP as I know how to send the info from MH already. What I can’t figure out is how to start the server on the OH2 side. I get no activity that I can find in the logs that any thing is happening. On the MH side it fails with “connection refused” I will do more reading on the configuration.

I’ll forewarn you that the TCP binding is one of the more difficult to get working in OH 2.

I believe you have to edit the start script of OH so it will be able to start up the server thread to start listening. I don’t use this binding though (MQTT was soooooo much easier to get working from both sides) so am not sure.

Got it! I will put something up in the examples section.

Craig

Oops. Not quite perfect yet. Gimme a bit to put some finishing touches on the URLs, etc.

Made a New topic

I have put this on hold for a bit till I move to my new RPI3. I was having some lag issues.

Update…

I have since moved to MQTT for this. Thanks Rich!

I had never heard of MQTT before. Took a while but I now have very fast two way communication between Misterhouse and OpenHab2

1 Like