Controlling HTD MCA66

I’ve been trying to add my MCA-66 to HA via the serial port but I can’t seem to figure out how to progress. I have the codes and they work using echo from the terminal for controlling the MCA-66, But not sure how to use those or if I even should do it that way.

I’ve found a github repo with some .py files that looks like they’ve done most of the work and they even have a comment about compatibility with HA, but I’m not sure it works or how to integrate it if it does work. The newest commit is 6 years old so that probably doesn’t help.

I see there seems to be a working integration using the gw-sl1, but I’d really rather not buy a device when the serial way should work fine. Though maybe that setup could be modified?

Just looking for some guidance and to be pointed in the right direction. Any help is greatly appreciated.

I’ve figured something workable out, but its pretty basic.

Installed HACS
then installed pyscript through that

then I could make a py file to run like this:

import serial

@service
def Z1_ON():
        ser = serial.Serial('/dev/ttyUSB0', 38400, timeout=1)
        ser.write(b'\x02\x00\x01\x04\x20\x27') 
        ser.close()