Need basic explanation of the new KNX binding

I still need some help in understanding the basics of the new knx binding… i just dont get it :confused:

What I (think) understood so far;

I differentiate channels between channels for KNX components (knx.things and knx.items) and channels for eg zwave components (control.things and knx.items)

Let’s just look at the first case

I have an actuator with 6 channels (1/1/1). I put that one into knx.things… like:

    Thing device aktor1 [
    ] {
        Type switch        : KanalA        "Light"       [ ga="1/0/1" ]
        Type switch        : KanalB        "Light"       [ ga="2/0/1" ]
        Type switch        : KanalC        "Light"       [ ga="3/0/1" ]
        Type switch        : KanalD        "Light"       [ ga="4/0/1" ]
        Type switch        : KanalE        "Light"       [ ga="5/0/1" ]
        Type switch        : KanalF        "Light"       [ ga="6/0/1" ]


Then I would go to knx.items and assign for every switch an item and a channel:

Switch        KanalA         "Light [%s]"               <light>          { channel="knx:device:bridge:aktor1:KanalA" }
Switch        KanalB         "Light [%s]"               <light>          { channel="knx:device:bridge:aktor1:KanalB" }
Switch        KanalC         "Light [%s]"               <light>          { channel="knx:device:bridge:aktor1:KanalC" }
Switch        KanalD         "Light [%s]"               <light>          { channel="knx:device:bridge:aktor1:KanalD" }
Switch        KanalE         "Light [%s]"               <light>          { channel="knx:device:bridge:aktor1:KanalE" }
Switch        KanalF         "Light [%s]"               <light>          { channel="knx:device:bridge:aktor1:KanalF" }

I think sitemap is optional… bute:

  1. Is the above correct?
  2. Where do I have to go when I would like to switch 2 GAs? Just make another GA or is it possible inside OH?
  3. I still dont see the benefits / sin / use of of the channel. But maybe because the above is just wrong :slight_smile:
  4. Is it still possible to split .items in more than 1 file? I’ve got a lot of actuators and want to keep it tidy (~130) - things is not possible iirc…

Thanks a lot in advance!

point 1:

seems ok to me, but:
When defining a channel, it is essential to bind not only the control GA but also the state GA to the channel:

Type switch        : KanalA        "Light"       [ ga="1.001:1/0/1+<1/0/2" ]

(assumed, that KanalA will provide it’s state through GA 1/0/2)

Please, don’t set readInterval, this is not recommended.

point 2:

that is not posssible in knx (you can’t define more than one GA to a switch to be sent to the bus)
But of course you can build groups in openHAB:

Group:Switch gmyTwoSwitches
Switch KanalA "Kanal A [%s]" <light> (gmyTwoSwitches) { channel="knx:device:bridge:aktor1:KanalA" }
Switch KanalB "Kanal B [%s]" <light> (gmyTwoSwitches) { channel="knx:device:bridge:aktor1:KanalB" }

If you do a gmyTwoSwitches.sendCommand(ON), both switches KanalA and KanalB will be switched to ON and both will send their GA to the knx bus.

point 3:

All OH2 Bindings work with things and channels, that is the software abstraction of your hardware.

point 4:

If defining knx Things through .things files, as you have to connect the things to the bridge, sorry this has to be one knx.things file, but this is only true for things with a bridge. (name of things file is free, but its natural to use knx as name…) I don’t see any problem to define 130 things in one file (if built nicely, you will be able to collapse all things in the editor to keep it neat when changing configuration)

Items still can be spread over multiple files.

Thx for your answer… it’s 130 actuators… with 1-20 channels each :slight_smile:

This is how a real example from my installation looks like:

Thing device A2X6F10H_1_1 "AT 1.1" @ "KNX" [ address="1.1.1", fetch=false, pingInterval=600, readInterval=0 ]
                        Type    switch  :       Kanal_11_A      "Keller Licht"   		    [ ga="1/0/0+<1/0/1" ]
                        Type    switch  :       Kanal_11_B      "Gästezimmer Licht"   		[ ga="3/0/0+<3/0/1" ]
                        Type    switch  :       Kanal_11_C      "Gästebad Licht"   		    [ ga="4/0/0+<4/0/3" ]
                        Type    switch  :       Kanal_11_D      "Gästebad Licht Spiegel"	[ ga="4/0/1+<4/0/4" ]
			            Type    switch  :       Kanal_11_E      "Treppenlicht"   		    [ ga="6/0/6+<6/0/14" ]
                        Type    switch  :       Kanal_11_F      "Diele Licht"   		    [ ga="7/0/0+<7/0/2" ]

So I do bind the state GA :wink: - is it necessary to also define the DPT like in you did in your example?

I’m using OH2.4 and found that DPT is not optional *) , if more than one GA is set to a parameter (i.e. ga="1/0/0+<1/0/1"), I’m pretty sure this is a bug.
If it’s working for you, it’s ok without DPT :slight_smile:

*) if not set with DPT, the channel will simply not work at all, so no switching, no updates.

Another questions regarding rollershutters…

I had them in my items like this:

// Wohnzimmer
Rollershutter	EG_Wohnzimmer_Jalousie_Einzel			"Jalousie Wohnzimmer Einzel [%d %%]"	(EG_Wohnzimmer)		{knx="6/1/0, 6/1/1, 6/1/10+6/1/12"}
Rollershutter	EG_Wohnzimmer_Lamellen_Einzel			"Lamellen Wohnzimmer Einzel [%.0f]"		(EG_Wohnzimmer)		{knx="6/1/0, 6/1/1, 6/1/11+6/1/13"}

Rollershutter	EG_Wohnzimmer_Jalousie_Rechts			"Jalousie Wohnzimmer Rechts [%d %%]"	(EG_Wohnzimmer)		{knx="6/1/2, 6/1/3, 6/1/15+6/1/17"}
Rollershutter	EG_Wohnzimmer_Lamellen_Rechts			"Lamellen Wohnzimmer Rechts [%.0f]"		(EG_Wohnzimmer)		{knx="6/1/2, 6/1/3, 6/1/16+6/1/18"}

Rollershutter	EG_Wohnzimmer_Jalousie_Links			"Jalousie Wohnzimmer Links [%d %%]" 	(EG_Wohnzimmer)		{knx="6/1/4, 6/1/5, 6/1/20+6/1/22"}
Rollershutter	EG_Wohnzimmer_Lamellen_Links			"Lamellen Wohnzimmer Links [%.0f]"		(EG_Wohnzimmer)		{knx="6/1/4, 6/1/5, 6/1/21+6/1/23"}

Rollershutter   EG_Wohnzimmer_Jalousie_Alle            	"Jalousie Wohnzimmer Alle [%d %%]"     	(EG_Wohnzimmer) 	{knx="6/1/25, 6/1/26, 6/1/27+6/1/29"}
Rollershutter   EG_Wohnzimmer_Lamellen_Alle            	"Lamellen Wohnzimmer Alle [%.0f]"      	(EG_Wohnzimmer) 	{knx="6/1/25, 6/1/26, 6/1/28+6/1/30"}

So “Einzel”, “Rechts” and “Links”. But I also head an item switching all three together (“Alle”).

Do I define them in the “things” to create a channel for them? Or is it better to group them in the items file? Would it even work in the things file?

atm the things looks like this:

Type    rollershutter   :       Kanal_7_A_1     "Büro Jalousie"                   [ upDown="2/1/0", stopMove="2/1/1", position="2/1/2+<2/1/5" ]
Type    rollershutter   :       Kanal_7_A_2     "Büro Lamelle"                    [ upDown="2/1/1", stopMove="2/1/1", position="2/1/3+<2/1/6" ]
Type    rollershutter   :       Kanal_7_B_1     "Gästezimmer 1 Jalousie"          [ upDown="3/1/0", stopMove="3/1/1", position="3/1/2+<3/1/5" ]
Type    rollershutter   :       Kanal_7_B_2     "Gästezimmer 1 Lamelle"           [ upDown="3/1/1", stopMove="3/1/1", position="3/1/3+<3/1/6" ]
Type    rollershutter   :       Kanal_7_C_1     "Gästebad 1 Jalousie"             [ upDown="4/1/0", stopMove="4/1/1", position="4/1/2+<4/1/4" ]
Type    rollershutter   :       Kanal_7_C_2     "Gästebad 1 Lamelle"              [ upDown="4/1/1", stopMove="4/1/1", position="4/1/3+<4/1/5" ]
Type    rollershutter   :       Kanal_7_D_1     "Flur Süd Jalousie"               [ upDown="5/1/0", stopMove="5/1/1", position="5/1/2+<5/1/5" ]
Type    rollershutter   :       Kanal_7_D_2     "Flur Süd Lamelle"                [ upDown="5/1/1", stopMove="5/1/1", position="5/1/3+<5/1/6" ]
Type    rollershutter   :       Kanal_7_E_1     "Wohnzimmer Links Jalousie"       [ upDown="6/1/4", stopMove="6/1/5", position="6/1/20+<6/1/22" ]
Type    rollershutter   :       Kanal_7_E_2     "Wohnzimmer Links Lamelle"        [ upDown="6/1/5", stopMove="6/1/5", position="6/1/21+<6/1/23" ]
Type    rollershutter   :       Kanal_7_F_1     "Wohnzimmer Rechts Jalousie"      [ upDown="6/1/2", stopMove="6/1/3", position="6/1/15+<6/1/17" ]
Type    rollershutter   :       Kanal_7_F_2     "Wohnzimmer Rechts Lamelle"       [ upDown="6/1/3", stopMove="6/1/3", position="6/1/16+<6/1/18" ]   

There is no way to get a state for a knx group, so your items for “alle” are wrong in the first place. you can send commands to the group, but you can’t reveive a valid state for these items.

There should be no big difference between a knx group and a openHAB group, but the openHAB group is much more adaptable, e.g. you can do something like that in rules:

    logInfo("rule","Der aktuelle Zustand von {} ist {}",,m.state)

this code will log a line for each member of the group gShutterWohnzimmer with its name and its actual state.