Litejet support for IP as well as RS232

The ‘litejet’ integration is I hope exactly what I need for my Litejet / Centralite lighting system… however the integration seems to only work with a hardware RS232 port.

I’ve had my Centralite system connected with a USR TCP232 board for years, so that I can talk to it via IP (of course, the Centralite system thinks I’m still on RS232).

Can the integration be extended to support use via a TCP connection or the current method of direct RS232 port?

I’m running HAOS in a VM so it’s not the easiest thing to attach a real serial port to (plus in any case my litejet is already connected via IP)

Seems like you need a HTTP service to receive the HTTP get requests.
Node Red might have the needed node to set up a HTTP service (probably the http in node).

Thanks for your reply!

Maybe I’ve got the wrong end of the stick but Node Red seems to be something different?

There’s a HA integration that should work with my litejet lighting system out of the box, but it seems to have been written for direct RS232 serial port connection rather than using an IP->RS232 gateway such as I have.

Would Node Red allow feeding the litejet integration (that expects me to specify a serial port in its configuration) with the IP address and port of my USR TCP-232 board instead?

I’m new to Home Assistant (and havent used Node Red before), but it feels like I need to either get the litejet integration extended to support IP connectivity, or somehow integrate a virtual serial port into the HAOS docker container…

The issue here is that it is not Centralite related.
You have an USR TCP232 board. The board will make a web service and you then install a program on your computer that connect to that web service and present it as a virtual RS232 port.
This is specific to the USR TCP232 board and have nothing to do with Centralite.
The Centralite system is just what you have connected, but it could be any device with a RS232 interface.

The USR TCP232 board software seems to be only available for Windows machines, so it is not possible to connect directly to HA.
Cutting out the software could be an option, but then you would have to connect directly to the web service of the USR TCP232 board and make your own integration. This is where Node Red might be an option.

Alternatively you can ditch the TCP232 board and get an USB to serial cable, which seems what others are using, or you might be able to implement something with ESPHome and a UART component.

Thanks

It’s not in any way web related. It simply exposes the RS232 data stream on a TCP port, there’s no web involved.

A USB-serial adapter wouldn’t work easily in my case not only due to cabling issues (the lighting controller has the IP bridge inside its enclosure; i’d need to rewire it and run a serial cable around the house), but I’m also running in a VM - if i had any hardware physically plugged into the host then that would tie the VM to that physical host machine as well… currently it can migrate across VM hosts with no problems.

If the integration can’t easily be changed to offer IP as an option then it’s easy enough on a normal Linux machine to present the TCP232 as a virtual serial port: USR-IOT Serial-to-Ethernet Converters with Linux – John's Geekblog

However i’m running HAOS and want to ensure that any changes i make are able to not only survive a HA version update, but also make their way into backups so that in case of any issues, hardware failures etc. I can install HAOS and restore. It would seem to me that messing with the docker image to get socat running might not meet either of these goals, but i’ll try to find some docs on what might be supported on that front as i guess the dev of the litejet integration might not update it…

[Edit: Found the relevant feature request, and it’s clear that it’s not supported and each integration needs to support IP itself: WTH can remote serial devices not be easily mounted as /dev/tty virtual devices? - #11 by ryans So I need to get the litejet integration updated, basically]

A web service just means it use http or https to communicate, which is what the TCP port seems to do.
The finding of the Linux install procedure makes it somewhat easier, but I do not think it is possible to do it on HAOS, because it is closed off.
You might have to install a HA Core or HA Supervised machine to get socat or ser2net running, which can then be connected to HA with the serial integration (Serial - Home Assistant)

Thanks. There’s definitely no HTTP or HTTPs here, it’s just TCP sockets transporting the RS232 stream.

It seems entirely backwards to hack a bunch of virtual serial ports into the architecture, with all the support/compatibility issues that entails - i guess I’ll try to learn how to code HA integrations and submit MRs, if I can’t speak to the developer of the litejet integration (github directed me here)

When I searched for info I stumbled on this: GitHub - kohai-ut/centralite_elegance: centralite eLite for home assistant in relation to this HA forum thread: Litejet help anyone?

Maybe there is help to get there. :slight_smile:

Thank you very much - good search skills!

Looks like this one is also direct RS232 serial port (or at least, USB-Serial) even though one of the commenters in that thread also had a Ethernet bridge on his system.

I think the best way is to extend the litejet integration to also support opening a TCP socket, instead of a serial port device… I just don’t know quite where to start as I haven’t done any HA coding yet (in fact, this is my first time running it - for the last 20 years I’ve used my own API I wrote for my Litejet system; I decided it was time to get into the 21st century, especially as there was already a Litejet integration… Just a shame it doesn’t allow for TCP connectivity (yet…!))

For the benefit of the archives (I don’t want to be another denvercoder9!) the documentation doesn’t explain how to do this, but by using the following syntax instead of specifying a hardware serial port it will connect: socket://192.168.1.15:20108