i have a relay board that i comunicate via Modbus TCP protocol. All the tests from Modbus Poll works as expexted though in OH i am not able to send correct value for the particular register. For retrieving register value seems to be ok because i get 0 or 1 from the register but for sending i need to transform value to Hex. if i need to switch on I have to send 0x0100, to switch off 0x0200.
I tried writing my own transform script, but that does not seem to do the trick.
Thing data thermorelay1 [ readStart=“0”, readValueType=“int16”, writeStart=“0”, writeValueType=“uint16”, writeType=“holding”, writeTransform=“JS(hexvalue.js)”]
if(inputData==1) return 256;
else return 512;
Setpoint item=thermoRelay1 label=“Termo galbva (miegamasis)” icon=“heating” step=1