KNX Dimmer not working as expected

I am creating new files for working with OH2. I already managed to setup the KNX/IP gateway.
Now I am working on the Dimmer settings.
In ETS the following is assigned:

  • Switch object 0/0/4
  • Dim object 0/2/4
  • Value object 0/3/4
  • Feedback switch 0/1/4
  • Feedback Value object / brightness value 0/4/4

This is the code I have crafted together:

Type switch        : demoSwitch        "Light"       [ ga="0/0/4" ]
Type dimmer        : demoDimmer        "Dimmer"      [ switch="1.001:0/0/4+<0/1/4+0/3/4", position="5.001:0/4/4", increaseDecrease="3.007:0/2/4" ]

Issue 1:
The light is switching on when I use the switch and at the same time the slider of the dimmer goes to 100%. When switching off (with the switch) the slider goes back to 0% but quickly after to approx. 40% (no value shown next to slider).

Issue 2:
When putting the slider to 100% the light is not switched on. The slider indicates 100%. The switch indicates off.

In the openhab version 1 it was working correctly with the following line:

Dimmer Licht_BG_EK_PL1  	"Plafondlamp Tafel Dim [%d %%]"   				(gDI,BG_E,DIM) 		{knx="0/0/4+<0/1/4,0/2/4,0/3/4+0/4/4"}

Any help to solve my issues is welcome.

Your dimmer is wrong. You should use (like in you did in OH1):
Type dimmer : demoDimmer “Dimmer” [ switch=“1.001:0/0/4+<0/1/4”, position=“5.001:0/3/4+<0/4/4”, increaseDecrease=“3.007:0/2/4” ]

P.S.: Why use a switch and a dimmer thing?

The dimmer item status is always of type Number, and a knx dimmer channel will always send a status update via dim level.
There is absolutely no point in using the switch status communication object.

Furthermore, increaseDecrease is most likely not needed for controlling the dimmer from openHAB, as Basic UI will always send absolute dimmer values and I’m pretty sure you don’t want to send INCREASE or DECREASE command via rule. :slight_smile:

Also, it would be better to set the dimmer Item to autoupdate="false", because openHAB will otherwise always postUpdate(100) to the dimmer Item when switching the dimmer to ON, even if the dimmer itself will not dim to 100%. (initial brightnes < 100)

You can use Switch and Slider Widget with the dimmer item, the former will draw an ON/OFF switch, the latter will draw a slider, you don’t need additional Items for that functionality.

I have copied the settings from the documentation pages.
Now I am confused how to set it up.
Can you guide me in the right direction regarding the code?

Type number : demoDimmer "Slider" [ ga="1.001:<0/0/4+0/1/4" ]

  1. Please use type dimmer, not type number.
  2. A group address of DPT1.001 represents a Bit, so it’s not compatible to type number anyway.

Your Channel should look like this:

Type dimmer : demoDimmer "Dimmer" [ switch="0/0/4", position="5.001:0/3/4+<0/4/4" ]

If your knx bridge is called bridge and your Thing, which the Channel belongs to is called mything, the Item should look like this:

Dimmer Licht_BG_EK_PL1 "Plafondlamp Tafel [%d %%]" (gDI,BG_E,DIM) {channel="knx:device:bridge:mything:demoDimmer"}

In the sitemap, you can then use these lines:

Switch item=Licht_BG_EK_PL1 label="Plafondlamp Tafel Dim"
Slider item=Licht_BG_EK_PL1

to get both switch and slider to control.

Please be aware that you don’t need the switch to turn on/off the dimmer.

Besides ClassicUI uses increaseDecrease for Sitemap Slider. And ClassicUI can directly switch the lamp on if you put in your sitemap
Slider item=Licht_BG_EK_PL1 switchSupport

It is working now! Thanks.
I was not aware that with declaring 1 item you can link a switch and a slider to that.
The reason that I am using a slider and a switch is because I am making 2 separate frames for that. Thanks for pointing out.
Now working on extending the sitemap with window and doors status.
Also actual temps and set temp will be made visible.

Yes, that’s correct (if setting switchSupport, otherwise it will send 0 instead of OFF and 100 instead of ON - this is a big difference!).

But please be aware that even if Classic UI will send INCREASE and DECREASE commands, it’s likely that the dimmer won’t react like intended, as some (if not most) knx dimmers nowadays use start-stop-dimming (i.e. to start dimming, send DPT3.007 dxxx, where d is direction and xxx != 0, and to stop dimming, send another DPT3.007, now x000, where x doesn’t matter).

openHAB does not support start-stop-dimming for knx Type dimmer, but only
for knx Type dimmer-control, and for this Type only by receiving the command.

Of course you can use a rule like this:

rule "knx dimmer"
    Item myDimmer received command
    switch (receivedCommand) {
        case ON : myRealDimmer.sendCommand(ON)
        case OFF : myRealDimmer.sendCommand(ON)
        case INCREASE : myRealDimmer.sendCommand(if((myRealDimmer.state as Number) < 95) (myRealDimmer.state as Number) + 5 else 100)
        case DECREASE : myRealDimmer.sendCommand(if((myRealDimmer.state as Number) > 5) (myRealDimmer.state as Number) - 5 else 0)
        default : myRealDimmer.sendCommand(receivedCommand)

You will need a proxy item. And you won’t need to configure increaseDecrease as openHAB will send absolute dimmer commands instead.

1 Like

Correct. My “old” dimmer actuator supports dimming. However I have noticed that the iOS app does not seem to support the autoupdate=“false” for type dimmer. Is that a known issue?

autoupdate="false" is an item option.

Dimmer myDimmer "My Dimmer" { channel="knx:device:bridge:thing:channel", autoupdate="false" }

Of course. I have that, and it works for ClassicUI and BasicUI. But it doesn’t work in the app on iOS (jumps to 100% and back).