so, while waiting, i tried playing around with TCP Binding.
the system is OH2 on a RasPi
tcp.cfg (everything else set to default)
# Post-amble that will be appended to data being sent postamble=\r\n
item:
Switch stairway "Stairway" {tcp=">[ON:192.168.31.103:55443:'MAP(yeelight.map)'], >[OFF:192.168.31.103:55443:'MAP(yeelight.map)']"}
sitemap
Switch item=stairway
yeelight.map
ON={"id":1,"method":"set_power","params":["on","smooth",500]} OFF={"id":1,"method":"set_power","params":["off","smooth",500]}
i’ve been able to turn the bulb on/off, and seems like it 's returning its status
log
10:53:49.459 [INFO ] [ing.tcp.AbstractSocketChannelBinding] - Connecting the channel Channel [item=stairway, command=OFF, direction=OUT, remote=/192.168.31.103:55443, buffer=, isBlocking=false, isReconnecting=false, channel=, host=192.168.31.103, port=55443] 10:53:49.565 [INFO ] [ing.tcp.protocol.internal.TCPBinding] - Updating states with returned values will be set to the default value of true 10:53:49.588 [INFO ] [ing.tcp.protocol.internal.TCPBinding] - The characterset will be set to the default value of ASCII 10:53:49.966 [INFO ] [ing.tcp.AbstractSocketChannelBinding] - The channel for /192.168.31.103:55443 is now connected 10:54:31.225 [INFO ] [smarthome.event.ItemCommandEvent ] - Item 'stairway' received command ON 10:54:31.250 [INFO ] [marthome.event.ItemStateChangedEvent] - stairway changed from NULL to ON 10:54:31.571 [WARN ] [rm.AbstractFileTransformationService] - Could not transform '{"id":1, "result":["ok"]} {"method":"props","params":{"power":"on"}} ' with the file 'yeelight.map' : Target value not found in map for '{"id":1, "result":["ok"]} {"method":"props","params":{"power":"on"}} ' 10:54:31.576 [WARN ] [ing.tcp.protocol.internal.TCPBinding] - Can not parse input {"id":1, "result":["ok"]} {"method":"props","params":{"power":"on"}} to match command OFF on item stairway 10:54:31.583 [WARN ] [rm.AbstractFileTransformationService] - Could not transform '{"id":1, "result":["ok"]} {"method":"props","params":{"power":"on"}} ' with the file 'yeelight.map' : Target value not found in map for '{"id":1, "result":["ok"]} {"method":"props","params":{"power":"on"}} ' 10:54:31.588 [WARN ] [ing.tcp.protocol.internal.TCPBinding] - Can not parse input {"id":1, "result":["ok"]} {"method":"props","params":{"power":"on"}} to match command ON on item stairway
i think i just need to find a way to parse the returned json value