Modbus OH2 slider with dimmer

Hello all. Can someone give me some guide or example how to make slider that will work as dimmer for Modbus RTU device ? I build small Arduino Modbus slave that has one register (16bit) that drive PWM output… as for arduino its simple for me but OH2 config …not
I found on internet example for “Process roller shutter commands” and it works for buttons (depending from button i can send proper value 0 , 127, 245 ect ) - so Modbus cfg is OK
question - how should look “items” file? For now i have :

Dimmer LightControl “Dimmer [%d %%]” {modbus=“slave1:<2:>2”}

And items like on “demo” but i dont see change on RS232 modbus device (like OH dont send frame that change this register )

rule "Dimmed Light"
Item LightControl received command
if ((receivedCommand==INCREASE) || (receivedCommand==DECREASE)) {
var Number percent = 0
if(LightControl.state instanceof DecimalType) percent = LightControl.state as DecimalType

		if(receivedCommand==INCREASE) percent = percent + 5
		if(receivedCommand==DECREASE) percent = percent - 5

		if(percent<0)   percent = 0
		if(percent>100) percent = 100
         postUpdate(LightControl, percent);

You might need later Modbus binding version for Dimmer support

Hi thx for quick reply but can you be more specific what do you mean by “new version” ? I download openhab2 from website 1 week ago.
Also my gut tells me that i have problem with .rules … I’m on stage monkey when i type all i think is OK for my configuration.
How should look .rules for sendCommand for above example ?
because working part for at the end of rules there is switch and sendCommand
case “STOP”:{
sendCommand(myRSMoveStop, 127)

So case STOP send value 127 to modbus on Demo rules i have only “postUpdate” - its ok ?

Yes, I mean you need the Modbus binding version 1.10 to support Dimmer item types. This version is not included in stable OpenHAB2.

I don’t understand the rest of your post. if you use sendCommand, the binding should act on the command. If you use postUpdate, the binding will not act on the command.