An alternative might be two data things, one for ON and one for OFF, linked to separate Number Items that you command with 1234.
You’d probably want a rule to decode openHAB commands sent to the original switches into whichever form you wanted to send to the intermediate Item(s)
The least complicated way would be to have a slightly different JS script for each switch data thing.
Does that work, out of interest? I’d always assumed thing uid’s should begin with an alpha, never tried just digits.
rele11 is a Switch type Item, you cannot command it with strings.
You missed this part. If you want to send a string, you must create a String type Item.
What I’m suggesting is that you have an additional Item , “myModbusCommand” or whatever.
Link that to your write-only modbus channel with the JS transform. Do not link your Switch Items.
Have a rule that listens for commands to each of your switch Items and makes up a string to send to the string item, to be passed along to the string channel of your data thing.