Fibaro Dimmer 2, Dimmer rule not working

Hi

I run

  • Openhab 2
  • Z-wave binding (Fibaro Dimmer 2)
  • Kodi Binding

I want to make a rule that slowly dims my light’s

The rule below only works with on and off, not with %, ( i.e. 75%, 50% and 25%)

E1Lachter1_Switch” is my dimmer channel

E1Lachter1_Switch.sendCommand(OFF) is working
E1Lachter1_Switch.sendCommand(50) not working
sendCommand(E1Lachter1_Switch, 50) not working
sendCommand(E1Lachter1_Switch, “50”) not working

rule "Adjust living room lighting when Kodi starts/stops"
when
    Item Kodi_State changed
then
    var String stateKodi = Kodi_State.state.toString()    
     switch (stateKodi.lowerCase) {
		case "play" : {
                     E1Lachter1_Switch.sendCommand(OFF)
                }
		case "pause" : {                     
                     //sendCommand(E1Lachter1_Switch, 50)
                     E1Lachter1_Switch.sendCommand(ON)
		        }
        case "stop" : {
                     //sendCommand(E1Lachter1_Switch, 100)
                     E1Lachter1_Switch.sendCommand(ON)
		         }
    }  
end

Is E1Lachter1_Switch a Switch or Dimmer in your items file?

For example in my items file I have

    Dimmer  BathroomTLDimmer        "Bathroom Top Light"                                  
    Switch  BathroomTLSwitch        "Bathroom Top Light"

Which are both linked to the Dimmer channel via PaperUI for my Dimmer 2.

In my rules I then use the following commands.

BathroomTLDimmer.sendCommand(20)
BathroomTLDimmer.sendCommand(100)

BathroomTLSwitch.sendCommand(OFF)

Below my auto detected thing in Paper UI
The Dimmer channel (according to the description) is for brightness control and can accept on/off commands

When I use E1Lachter1_Dimmer.sendCommand(50) it works!

Strange, if my channel name (or need I say linked item name) is not ending with dimmer I can not dim and if it’s not ending with switch I can not use on of ???

Thank you for insight Tom

I see that stop command in Kodi binding is a separate channel/item.

So I think I need to make a separate rule for that
I have to figure out if the kodi stop channel has a state (int or string) i can check for

This is correct behaviour I believe as they are different item types…

If you wanted to switch using a dimmer you could send 0 for OFF.