New to Hubitat and love it!
I have several X10 devices that are controlled by scripts running on an rpi. The scripts communicate to a dedicated rpi running a server (mochad, IIRC).
X10 control is done on different rpis using nc, for example:
echo "rf a4 on" | nc -q 2 192.168.0.224 1099
where 192.168.0.224 (port 1099) is the "X10 server". This turns on station a4.
Of course, my code (mostly perl) has maps for user friendly names. I also have code running on an Amazon Alexa server that implements a Smart Home skill that allow my X10 devices to be controlled from Alexa (and also a custom Alexa skill).
I'd like to keep the X10 devices for a while, but eliminate the need to maintain and enhance code running on the rpis. There is also an rpi for an IR server (controls and configures my legacy home entertainment devices). The scripts also interface with Pentair pool automation, a many zone irrigation system (OpenSprinkler) and other stuff.
So, it will be awhile before I get everything migrated, but I figured I'd start with the X10 stuff.
I've read a bit about writing a custom app and driver, and I think I need a driver to implement a new device type?
I think what I want is a type of device that simply does the nc (or open a socket) to the specified ip and port. A string needs to built based on the x10 station being controlled and either the "on" or "off" command. The string would be sent over the socket. X10 only receives, so only a send is needed.
Maybe a preference that associates a device label (Alexa name) with the correct station.
Am I on the right track? Is this the most straight forward approach, given what I already have implemented?