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.