KNX Lights using switch and dimmer

I have hardware switches to steer KNX dimmable lights. If I push short it switches on and off, if I push long it is dimming the lights.

If I implement the same via OpenHAB switch and dimmer items I have the issue that the two elements interfere. These is because for the switch KNX gives feedback on the state on the Group-address (GA) of the switch that sends the commands. For the Dimmer I get e second response from KNX with a percentage value. So if I switch on with the Dimmer Item e.g. to 30% I receive two feedbacks. 1. 30% and secondly “ON” wich has by default a value of 90%. I defined 3 rules to overcome the situation.
They implement that I cannot put on and turn off the lights with the Dimmer Item anymore. (Wich Is pretty much the same the hardware switch does. If I push the switch long to put on the lights, it goes to 90% and does not start dimming. To dimm I have to push it a second time)
In my case only the Dimmer Item is connected to the respective KNX Light Thing. The Switch Item is only connected to the rules.

My question: Is that the simplest way to implement a Switch and a Dimmer Item for the same KNX Thing without an interference of the KNX feedbacks or is there a simper way?

Here my rules (I know that the on and off rules could have been be written in one rule)

rule “Büro_D_an”
when
Item Buero_D changed to ON
then
Buero_D_Dim.sendCommand(90)
end

rule “Büro_D_aus”
when
Item Buero_D changed to OFF
then
Buero_D_Dim.sendCommand(0)
end

rule “Büro_D_Dim”
when
Item Buero_D_Dim changed
then
if (Buero_D.state == OFF) Buero_D_Dim.sendCommand(0)
else if (Buero_D_Dim.state==0) Buero_D_Dim.sendCommand(5)
end

No, that’s far too complex.

  1. Your wall switch has two GA, one for short press, one for long press (in fact, there always should be a third GA for switch state, think about scenes, the switch has to “know” which state the dimmer is without receiving the short press GA)
  2. The dimmer channel has also option for at least three GA (in fact, the third parameter increaseDecrease should be left empty but instead there should be an additional state GA, but now for position (i.e. absolute brightness).

Now, if configured correctly, you would only need one Item to control both brightness and on/off state:
given GA in dimmer actuator:

1/1/0 switch on/off command
1/1/1 switch on/off state (with R-flag set (i.e. L-flag in germany)
1/1/2 increase/decrease command
1/1/3 absolute dimmer level command as % (i.e. DPT 5.001)
1/1/4 absolute dimmer level state as % (i.e. DPT 5.001, with R-flag set (i.e. L-flag in germany)

The wall switch should be configured to

1/1/0,1/1/1 for short press
1/1/2 for long press

openHAB should be configured to

channel:

Bridge knx:bridge:bridge ... [...] {
    Thing device myDevice ... {
        Type dimmer : myDimmer "Dimmer" [ ga="1/1/0", position="1/1/3+<1/1/4" ]
    }
}

as item:

Dimmer myDimmItem "Dimmer [%d %%]" <light> { channel="knx:device:bridge:myDevice:myDimmer", autoupdate="false" }

sitemap:

Slider item=myDimmItem
Switch item=myDimmItem

If using the switch to switch the light, the dimmer will use configured start level (last value or fixed level)
If using the Slider, dimmer will dimm to absolute level.

Because of the additional parameter autoupdate="false" there will be no update to ON or OFF but only to the level.

1 Like

Wow, many thanks Udo for the detailed help! Very much appreciated. As I understand the devil lies in the way KNX was set up. I am not really into KNX even if I asked my electrician for a dongle for ETS to have a look what is going on there. I never really dared to touch the set up there. It seems that they did not implement as they should. I have to check with them. I guess the R-flag is also to be set in ETS KNX. Just out of interest, what is the R-flag or the L-flag respectively.

Hi Udo
Sorry for boring you again. I have added a picture of the ETS KNX config. I shows the details of channel 53, wich is as I understand configured to write and to submit also the state.
Am I right to unmark the “übertragen” and to put that to a separate GA and there to put on the L flag. (german).

Hi Udo
I have implemented your version. Works perfectly fine. The two items interact with some time delay of one to two seconds before the not changed intem also reflects the new status.

So thanks agains.
Regards
Thomas

I guess with “two Items” you mean the two Widgets?
It’s normal behavior that there is some delay for state updates.

I have simialiar setup and and problem than Thomas had. Zennio wall switches and dimmable lights, short push to switch lights on and off, longer push for dimming.

Never got dimmers working with my openhab 2, now I have migrated to 3.3 and investigated more this problem with ETS. The wall switch sends multiple commands to dimmer and when using openhab only one commad is send. So dimmers work fine when wallswitch is operated, but not with openhab.

With openhab dimmer commands are following, before dimmer I tested the on/off switch

#	Time	                Service	Flags	Prior.	Source	Source name	 Dest.	Dest. Name	number of hops	Type	DPT datapistetyyppi																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																				
2	20.11.2022 14.13.01,166	väylästä		Matala	15.15.241		1/0/5		6	GroupValueWrite	 	$01 | Päällä																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																			
3	20.11.2022 14.13.01,272	väylästä		Matala	01.01.05		1/0/6		6	GroupValueWrite	 	$01 | Päällä																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																			
4	20.11.2022 14.13.01,311	väylästä		Matala	01.01.05		1/0/8		6	GroupValueWrite	 5.001 percentage (0..100%)	$10 | 6 %																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																			
5	20.11.2022 14.13.09,896	väylästä		Matala	15.15.241		1/0/8		6	GroupValueWrite	 5.001 percentage (0..100%)	$4F | 31 %																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																			
6	20.11.2022 14.13.11,324	väylästä		Matala	15.15.241		1/0/8		6	GroupValueWrite	 5.001 percentage (0..100%)	$8F | 56 %																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																			
7	20.11.2022 14.13.16,323	väylästä		Matala	15.15.241		1/0/5		6	GroupValueWrite	 	$00 | Pois																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																			
8	20.11.2022 14.13.16,476	väylästä		Matala	01.01.05		1/0/6		6	GroupValueWrite	 	$00 | Pois																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																			
9	20.11.2022 14.13.16,515	väylästä		Matala	01.01.05		1/0/8		6	GroupValueWrite	 5.001 percentage (0..100%)	$00 | 0 %																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																			

And with wallswitch command are following

#	Aika	Palvelu	Merkit 	Prior.	Lähdeosoite	Lähteen nimi	Kohdeosoite	Kohteen nimi	Hyppyjen määrä	Tyyppi	DPT datapistetyyppi	Tiedot																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																			
2	20.11.2022 14.17.12,726	väylästä		Matala	01.01.18		1/0/5		6	GroupValueWrite	 	$01 | Päällä																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																			
3	20.11.2022 14.17.12,833	väylästä		Matala	01.01.05		1/0/6		6	GroupValueWrite	 	$01 | Päällä																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																			
4	20.11.2022 14.17.12,872	väylästä		Matala	01.01.05		1/0/8		6	GroupValueWrite	 5.001 percentage (0..100%)	$10 | 6 %																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																			
5	20.11.2022 14.17.14,855	väylästä		Matala	01.01.18		1/0/7		6	GroupValueWrite	 	$09 | Päällä																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																			
6	20.11.2022 14.17.15,386	väylästä		Matala	01.01.05		1/0/8		6	GroupValueWrite	 5.001 percentage (0..100%)	$28 | 16 %																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																			
7	20.11.2022 14.17.15,835	väylästä		Matala	01.01.18		1/0/7		6	GroupValueWrite	 	$08 | Pois																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																			
8	20.11.2022 14.17.15,874	väylästä		Matala	01.01.05		1/0/8		6	GroupValueWrite	 5.001 percentage (0..100%)	$41 | 25 %																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																			
9	20.11.2022 14.17.17,655	väylästä		Matala	01.01.18		1/0/5		6	GroupValueWrite	 	$00 | Pois																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																			
10	20.11.2022 14.17.17,974	väylästä		Matala	01.01.05		1/0/6		6	GroupValueWrite	 	$00 | Pois																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																			
11	20.11.2022 14.17.18,013	väylästä		Matala	01.01.05		1/0/8		6	GroupValueWrite	 5.001 percentage (0..100%)	$00 | 0 %																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																			

The group addres report shows that wallswitch has four GAs

1/0/5 	302 KEITTIĂ– KATTOSPOT ON/OFF 		        switch 
1/0/6 	302 KEITTIĂ– KATTOSPOT ON/OFF STATUS 		switch 
1/0/7 	302 KEITTIĂ– KATTOSPOT SĂ„Ă„TĂ– 			    dimming control 
1/0/8 	302 KEITTIĂ– KATTOSPOT %ARVO/STATUS 		    percentage (0..100%)

If I have understood right the channel config should be following

UID: knx:device:e898d943ef:03625e0af6
label: DIMinBOX DX2 1.1.5
thingTypeUID: knx:device
configuration:
  pingInterval: 600
  address: 1.1.5
  readInterval: 0
  fetch: false
bridgeUID: knx:ip:e898d943ef
channels:
  - id: "301"
    channelTypeUID: knx:dimmer
    label: 301 MH1 PISTORASIA ON/OFF
    description: ""
    configuration:
      switch: 1/0/0+1/0/1
      position: 1/0/3
  - id: "302"
    channelTypeUID: knx:dimmer
    label: 302 KEITTIĂ– KATTOSPOT ON/OFF
    description: ""
    configuration:
      position: 1/0/8
      switch: 1/0/5+1/0/6

So any idea what is gone wrong with my configuration?

First: Please always consider to open a new thread, rather than use a (very, very) old one.

Second: a wallswitch does the control of the dimmer in a different way than openHAB.
Every knx dimmer has at least five communication objects, which are (CO numbers may vary):

  • Command ON/OFF (DPT 1.001) (CO 1)
  • State ON/OFF (DPT 1.001) (CO 2)
  • Command relative dimming (DPT 3.007) (CO 3)
  • Command absolute brightness (DPT 5.001) (CO 4)
  • State absolute brightness (DPT 5.001) (CO 5)

All of them should use a different group address, for example:

  • CO 1: 0/0/1
  • CO 2: 0/0/2
  • CO 3: 0/0/3
  • CO 4: 0/0/4
  • CO 5: 0/0/5

There are two different types of dimmer control via CO 3, this is start-stop-dimming or steptype dimming. For start-stop dimming, there is one “start dimming” telegram and one “stop dimming” telegram with direction. For steptype dimming the telegram is sent cyclical.

Now, the wallswitch will use this configuration:

  • Short press: toggle, 0/0/1,0/0/2 (state is used to determine the next command for short press. Think of a central off option, a second wallswitch, scenes, control via openHAB…)
  • Long press: 0/0/3 (you have to setup whether steptype or start-stop ist used, must be the same type as in the dimmer actuator.

On the other hand, openHAB will use different group addresses:

  • switch: 0/0/1 (NO return GA, as we are using the position for state)
  • position: 0/0/4+<0/0/5

and that’s it. openHAB will send an ON or OFF via 0/0/1. When using the slider in the UI, openHAB will send an absolute value like 68% through 0/0/4.
openHAB will receive the level whenever it’s changed, may it be through a wallswitch or openHAB itself via 0/0/5. openHAB will send a read request when system is started to get information about the current state (this is the <)

Thank you Udo for your quick reply. Next time I will open a new thread, no problem.

I’ve asked local electrician, who did installation and programming of knx devices to our house, to provide group address report on a pdf-file. According that report there is 5 different GAs to dimmers, like you told, but on this case the 5th isn’t configured on any of the dimmers.

1/0/5 302 KEITTIĂ– KATTOSPOT ON/OFF                     switch No No
1/0/6 302 KEITTIĂ– KATTOSPOT ON/OFF STATUS              switch No No
1/0/7 302 KEITTIĂ– KATTOSPOT SĂ„Ă„TĂ–                      dimming control No No
1/0/8 302 KEITTIĂ– KATTOSPOT %ARVO/STATUS               percentage(0..100%)No No
1/0/9 302 KEITTIĂ– KATTOSPOT %STATUS VARA               -

Finnish word “VARA” means spare, GA 1/0/9 is not configured or not in use.

Telegram provided on my previous message confirms that absolute telegram is send from openhab to knx bus, but because lack of the fifth GA the absolute position is not confirmed. Is this assumption correct?

I took a screen capture from ETS, my version is in finnish, but capture is taken from the diagnosis tab. It shows that GAs 1/0/4 or 1/0/9 isn’t configured.

image

Seems reasonable. But if you have ETS, why not adding the state to an unused group address?

That idea really did cross my mind few times, only thing that has prevented me so far is lack of knowledge and skills on ETS. I have unlicensed or free version of ETS installed, but as far as I know programming on single devices should be possible.

May be after few ETS tutorial videos on Youtube I’ll manage to program missing GAs to dimmer devices.

I did find ETS project parser on github and output of knx project file also confirms my assumption that percentage status GAs are empty.

"GA-79": {
"name": "302 KEITTIĂ– KATTOSPOT ON/OFF",
"identifier": "GA-79",
"raw_address": 2053,
"address": "1/0/5",
"dpt_type": {
"main": 1,
"sub": 1
},
"communication_object_ids": [
"M-0071_A-5441-12-E7E0_O-20_R-34",
"M-0071_A-5181-36-7D87_O-29_R-24"
],
"description": ""
},
"GA-80": {
"name": "302 KEITTIĂ– KATTOSPOT ON/OFF STATUS",
"identifier": "GA-80",
"raw_address": 2054,
"address": "1/0/6",
"dpt_type": {
"main": 1,
"sub": 1
},
"communication_object_ids": [
"M-0071_A-5441-12-E7E0_O-23_R-67",
"M-0071_A-5441-12-E7E0_O-20_R-34"
],
"description": ""
},
"GA-81": {
"name": "302 KEITTIĂ– KATTOSPOT SĂ„Ă„TĂ–",
"identifier": "GA-81",
"raw_address": 2055,
"address": "1/0/7",
"dpt_type": {
"main": 3,
"sub": 7
},
"communication_object_ids": [
"M-0071_A-5441-12-E7E0_O-21_R-64",
"M-0071_A-5181-36-7D87_O-30_R-23"
],
"description": ""
},
"GA-82": {
"name": "302 KEITTIĂ– KATTOSPOT %ARVO/STATUS",
"identifier": "GA-82",
"raw_address": 2056,
"address": "1/0/8",
"dpt_type": {
"main": 5,
"sub": 1
},
"communication_object_ids": [
"M-0071_A-5441-12-E7E0_O-24_R-55",
"M-0071_A-5181-36-7D87_O-28_R-21"
],
"description": ""
},
"GA-83": {
"name": "302 KEITTIĂ– KATTOSPOT %STATUS VARA",
"identifier": "GA-83",
"raw_address": 2057,
"address": "1/0/9",
"dpt_type": null,
"communication_object_ids": [],
"description": ""

i see a lot of people asking about this it all depends on your dimmer some have the function to send the switch status at certain value or after the absolute has settled. i had no problem with weinzler zennio or Schneider even setting the status group adress for the switch.