Help with sending hex with Serial Binding (1141 Plcbus)

I’m wondering if someone can point me in the right direction. I’m trying to get a simple way to send commands to my 1141 plcbus device. I was hoping to use the binding, but it’s not been updated to OH3 (fingers crossed it will be migrated).

Anyway, I spotted a post over on home-assitant forum that has a python script that does the following:

import serial
myser= serial.Serial('/dev/ttyUSB1',9600)
frame="0205D11722000003"
message_bytes = bytes.fromhex(frame)
myser.write(message_bytes)

From this I attempted to do something with the serial binding. It is connecting but nothing else. Would anyone have any advice? My dodgy code below! thanks.

plcbus.things
Bridge serial:serialBridge:plcbus [serialPort="/dev/ttyUSB2", baudRate=9600] {
Thing serialDevice devices [patternMatch=".*"] {
Channels:
Type switch : b6 [on=“0205D11722000003”, off=“0205D11723000002”]
}
}

plcbus.items
String PlcBusBinary “PlcBus [%s]” { channel=“serial:serialBridge:plcbus:binary” }
Switch TestPlcbus “test plcbus” {channel=“serial:serialDevice:plcbus:devices:b6”}

The examples in the documentation are wrong, refer to the parameters table which is correct.

You need to use onValue and offValue

Thanks for the information. but unfortunately, I still can’t get it to work. It connects ok but doesn’t return anything and onValue is ignored. I have also tried to send the command as /u0002/u0006/u00bd/u0000/u0022/u0000/u0000/u0003.

It’s all little beyond my understanding and I’m struggling to find more detailed information on the serial binding for openhab3.

I’ll just have to hope that the plcbus binding gets migrated, if anyone is looking into this then I’ll happy to do some testing, I have serial and USB version of the 1141 with lots of x10 and plcbus devices.