Communicating with Litetouch via the TCP binding

Dear all,

I’m beginning my first steps with the openHAB and i love it.
My target is to be able to communicate with my old Litetouch system in my house.
I’m experimenting with the TCP binding and sending commands via IP to the system.
I am able to toggle lights through the following switch:

Switch  Light_FF_Office_Ceiling_map "Ceiling map" (FF_Office, Lights) tcp=">[ON:'MAP('], >[OFF:'MAP(']"

My challenge is to be able to get the strings the Litetouch system returns to the openHAB after each command I send.

Any help or pointers will be very helpful.


String Light_FF_Office_Ceiling_Return {tcp="<['REGEX((.*))']"}

The “<” indicated the direction, in this case incoming. The REGEX basically returns the full String unmodified.

Depending on what the device is returning (i.e. it is telling you when the light is toggled manually, you can put this all in the one Switch Item and use a transform on the String to determine which Strings indicate the Switch should be ON or OFF.

Thank you for the tip!

I defined the two strings:

String LT_send "[%s]" { tcp=">['REGEX((.*))']"}
String LT_receive "[%s]" { tcp="<['REGEX((.*))']”}

and in the rules each time switch toggle i did:

LT_send.sendCommand ("R,CGLED,742") 
logInfo(“Show", “Received data:[{}]",LT_receive)

Now it works!
I got the expected string.