Home Assistant 2023.7.2 X10 CM15A

I am a newbie to Home Assistant with some past linux experience.

Does anyone have an X10 CM15A working on Raspberry Pi 4B running Home Assistant 20237.2?

I have a lot of X10 devices throughout my home that I would like to integrate into Home Assistant.

From everything I’ve read I need to have mochad running. I have followed the instructions from X10 devices, CM15 Pro - Domoticz. I performed all of the steps in a terminal window from Studio Code Server. The only variation is that I used a mochad-0.1.21.tgz tar file that I obtained from this link: mochad / Discussion / Open Discussion: Rasberry PI compile errors .

When I get to the test line: echo “pl a1 on” | nc localhost 1099 - I find that HAOS does not support the nc command.

I also do not know how to see if the HAOS is recognizing my CM15A or to see if the mochad process is even running?

I do not get any error in my terminal window when starting ./mochad

I replied in your other topic:

Hi Tom,

If I am reading this correctly I need to have mochad running on some other platform? Since I installed Home Assistant OS on my Raspberry Pi I cannot use that to run the mochad?

You can, but you need the add-on as well.

Use this 3rd party addon to run the mochad server: GitHub - FloridaMan7588/mochad-ha-addon

Use the core mochad integration to connect this server to home assistant and access your devices.

Add-ons are how you run seperate programs and servers on the same hardware as home assistant.

Integrations are how home assistant talks to APIs provided by servers or hubs (running on the same host machine as addons, or as completely seperate stand alone server/hub hardware).

1 Like

We installed the 3rd party integration and added the mochad information into the configuration.yaml file. We only added one light and one switch for the purpose of testing. The yaml file passed the configuration test successfully. We restarted Home Assistant, saw the pop up saying mochad was starting. However we cannot see any of our added X10 lights and switches on the Home Assistant web page in devices and entities. Mochad does show up.

This is what we see in the mochad integration log file:

s6-rc: info: service legacy-services successfully started
mochad.c:680:usbfds 0x7facb31430 0x7facb35860 0x7facb35880 0x7facb35960 0
mochad.c:684: 3: 0x7facb35860 fd 4 0001
mochad.c:684: 4: 0x7facb35880 fd 5 0001
mochad.c:684: 5: 0x7facb35960 fd 8 0004
mochad.c:692:nusbfds 3
mochad.c:407:initcm1Xa
mochad.c:722:listenfd 9
mochad.c:778:bind() 0/2
mochad.c:783:listen() 0/2
mochad.c:790:flashxmlfd 10
mochad.c:843:bind() 0/2
mochad.c:846:listen() 0/2
mochad.c:859:flashxmlfd 10
mochad.c:908:bind() 0/2
mochad.c:911:listen() 0/2
mochad.c:345:copy_clients
mochad.c:357:copy_clients 0
mochad.c:345:copy_clients
mochad.c:357:copy_clients 0
mochad.c:345:copy_clients
mochad.c:357:copy_clients 0
mochad.c:961:accept() 12/11
mochad.c:253:add_client(12)
mochad.c:260:add_client: i 0 NClients 1
mochad.c:345:cop… Read more

The integration is core, the add-on is 3rd party. You need both.

Did you follow the add-on instructions? https://github.com/FloridaMan7588/mochad-ha-addon#prerequisites

Did you find your CM15A listed in Settings > System > Hardware > (three dots) All Hardware

Thanks for the reply, As always your expertise and insight is greatly appreciated,

I mis-interpreted what I was seeing in the All Hardware. The directions said I should see something in hardware like ttyAMA0. I did see that but overlooked the fact that there was no physical device associated with the address.

I am now at a complete loss as to how I get HAOS to detect my CM15A.

I have tried both USB 2.0 and USB 3.0 ports. I have tried with two different CM15A modules. I have even tried using different usb wires. I have also tried USB 2.0 and USB 3.0 powered hubs.

Both CM15A modules are readily detected on two different Windows laptops.

My Zooz 800 Z-stick is immediately detected by HAOS in both USB 2.0 and 3.0 ports. All of the USB ports are functional.

Any ideas or suggestions you may have are greatly appreciated.

I realize this is a year-old thread but I have been going through a similar confusion when trying to get X10 switches into Home Assistant this week.

It took me a while to understand there’s a difference between the built-in mochad integration in Home Assistant (I think it’s referred to as pymocha sometimes) and the separate mochad server that also needs to installed as an add-on or running on another platform somewhere on the network.

In my case I added the simple:

mochad:
  host: localhost
  port: 1099

to the configuation.yaml file and added all my switch configurations

switch:
- platform: mochad
    devices:
      - address: a1
        name: front_door

(etc)

I thought that was all I needed but it didn’t work. It took me a while to realize what Tom_I (the moderator) is saying. The built-in mochad integration is just HA’s way to communicate with a separately running mochad server on the network.

Realizing I still needed a mochad server, I looked for a way to run a mochad server (daemon) on the same platform as HAOS (in my case an old i5 laptop). That’s where FloridaMan7588’s github instructions come in. He explains how to manually add his version of the mochad add-on to the HAOS repository so it can be installed.

The key information needed for the mochad add-on to function is the detailed information on where the CM15a hardware is connected (so that mochad can access the hardware through HAOS). FloridaMan7588 says to go into the Settings>System>Hardware>All Hardware (though he actually writes (3 dots) All Hardware - maybe a reference to an older version of HA but clear enough to find it).

From there he says to find the CM15’s “Identifier”. He provides some examples of what it may look like. Maybe “/dev/ttyUSB0” or “/dev/ttyAMA0”. I found my CM15a by typing X10 into the ‘search hardware’ bar. Only the “1-1.2” section contained an X10 reference. I expanded that section and it was clear the CM15a was there with several different forms of “Identifiers”. Which one is FloridaMan7588 referring to?
There are several things listed. Here’s a subset for reference:
DEVNAME: /dev/bus/usb/001/006
DEVPATH: /devices/pci0000:00/0000:00:1a.0/usb1/1-1/1-1.2
ID_MODEL: USB_ActiveHome_Interface
ID_MODEL_ENC: USB\x20ActiveHome\x20Interface
ID_USB_SERIAL: X10_Wireless_Technology_Inc_USB_ActiveHome_Interface
ID_USB_VENDOR: X10_Wireless_Technology_Inc
ID_USB_VENDOR_ENC: X10\x20Wireless\x20Technology\x20Inc
ID_VENDOR_ID: 0bc7
USEC_INITIALIZED: ‘460739283415’

Which one should I use to configure the Mochad add-on? The closest one to the examples was “DEVNAME: /dev/bus/usb/001/006” so I used “/dev/bus/usb/001/006” to configure the mochad add on.

The only other thing not made clear by FloridaMan7588 was how to enter the identifier into the configuration.

He writes "In the Add-On’s configuration, under the serial section, you’ll need to type port: followed by the port of your device. It should look similar to this 'serial port: /dev/ttyS0 '. The format of the add-on configuration section is laid out more like this:
Options
Serial
1
2

I added ‘port: /dev/bus/usb/001/006’ to line one and hoped for the best. It’s not clear when FloridaMan7588’s term ‘Identifier’ becomes the port but that’s how I interpreted it.

The switches have now shown up on my dashboard but I still can’t get them to function (If I move a switch to ‘on’ it stays on briefly then reverts to off. The physical switch doesn’t react.

I’m not there yet but I’m much closer than where I was yesterday! Hopefully I helped others who also didn’t understand the mochad integration and mochad add-on.

I just wanted to follow up to say it’s all working fine now. I’m not sure why it wasn’t before but after days of trying to get the switches to show up and function on the dashboard, I uninstalled mochad and removed it from the repository then reinstalled it following FloridaMan7588’s instructions (again) and the switches all showed up and functioned this time.

Now that I’m up and running, I can see there’s a small limitation on what the built-in mochad integration is capable of. It doesn’t make use of mochad’s ability to monitor all X10 traffic (RF or Powerline). For example, if I turn on a switch with an X10 rf remote, or using the X10 WM100, it would be nice for the Home Assistant pymochad integration be aware of that traffic (the mochad add-on does report all X10 traffic in addition to sending commands). While an X10 signal turning on a switch doesn’t guarantee that switch received the on command, it would be nice to be able to assume that switch is on now and report it as on in the HA dashboard. There are probably other ways to monitor and act on the information received by the mochad add-on but having that built in to the HA mochad integration would be nice.