Trigger from tcp socket?

This seems simple yet I haven’t figured out a solution yet. Is there an integration that can listen on a TCP port and fire a trigger any time a string of text (ending in a newline) is received and include the text string in the trigger data?

I have an old external automation system that can send commands over ip:port connections that I want to be able to use to trigger Home Assistant automations.

Any suggestions on how to achieve this would be welcome! Thanks!

Something like this?
Sorry, no. You need listener.

Try with node red.

I use it for polling, but I think it is possible to listen.

Try with node red.

This is an interesting idea - it does look like I can use NodeRed as a tcp server, however I want to keep my automations in HA, is there a way to create a HA trigger from a NodeRed flow?

You can create a binary sensor or a sensor (text) depending on your goal.
The sensor will be added to HA and there you create your automation