TCP binding configuration for command/response sequence

I have a modified thermostat which expect TCP Connection When I sent a command it respond back over TCP port 23. For example if I send “A=1 O=0 R=1\r\n” (This is the command to retrieve current settings)it responds back with “A=00 O=1 T=68 SP=68 SPH=68 SPC=84 M=H FM=0”. This string has Destination Address(Always 0), Origin address(Always 1), temperature, Set Point, Set point for heating, set point for cooling, Mode and some other value respectively. How I can do this transaction in OpenHab. I like to periodically send “A=1 O=0 R=1\r\n” to the device and get the status and populate this information in multiple strings and display it on the map. After each transaction I like to close the TCP connection. Any help is appreciated on this.

Look at the TCP Binding. I’m not positively sure it will work though. If not, write a script of external program and call that program using the Exec Binding.

Since the results are not XML or JSON you will need to parse the results either using the REGEX transform or in a rule.