given MB_I_Reg_10 as Number, you have to cast the state to byte (this would cut away the high byte)
Maybe this will do it (did not test it, as I’m at work)
rule "MB_I_Reg_10"
when
Item MB_I_Reg_10 changed
then
SpitzbodenRT.sendCommand(MB_I_Reg_10.state as Byte)
end
If this does not work as expected, type conversion should work:
SpitzbodenRT.sendCommand((MB_I_Reg_10.state as DecimalType).toBigDecimal.toBigInteger && 255)
I’m using .testBit(n) to get various boolean informations from a BigInt:
myState = (MyItem as DecimalType).toBigDecimal.toBigInteger
if(myState.testBit(0))
{}
if(myState.testBit(1))
{}
if(myState.testBit(2))
{}
if(myState.testBit(3))
{}
if(myState.testBit(4))
{}
...