Rule for using only the lower byte of an 2 Byte value?

It worked for Udo using an intValue. Maybe time to use that number type instead of BigInteger. (an int will easily hold 16 bits)

There is no such function like and() for integer, the function is called bitwiseAnd() - using openHAB Designer makes these things a lot easier.

I tested with that function as well. Igot the same error messeage

2016-10-25 15:00:24.198 [ERROR] [.script.engine.ScriptExecutionThread] - Rule 'MB_I_Reg_10': An error occured during the script execution: The name '<XFeatureCallImplCustom>.bitwiseAnd(<XNumberLiteralImpl>)' cannot be resolved to an item or type.

only the “and” is changed here for “bitwiseAnd”.

I tried to use the openhab Designer as well. But I see no advantage at the moment in comparison to the notespad++

The only positive thing is the syntax highlighting and it should show errors. In my case the error (small “e” at the lefthand side of the line) is shown very often. But the line contains no error. I will try to use the openhab Designer on writing the rule, maybe he will show me the options I have (until now I never noticed that).

You think I should kill that line

var Number MyVal = (MB_I_Reg_10.state as DecimalType).toBigDecimal.toBigInteger

and change the rule to

rule "MB_I_Reg_10"
when Item MB_I_Reg_10 changed then
  SpitzbodenRT.sendCommand((MB_I_Reg_10.state.bitwiseAnd(4095))/10) // where MB_I_Reg_10 is defined as number item
end

I will try this today in the afternoon.
Do I have to do the imports as well?