KNX1 to KNX2 Migration Steps

openhab2
knx
knx2
Tags: #<Tag:0x00007fd313b179f0> #<Tag:0x00007fd313b178b0> #<Tag:0x00007fd313b17770>

(Angelos) #1

Starting with openHAB 2.3 Snapshot build #1230, the new KNX v2 binding has become generally available.

I will type up here my experiences from the migration steps that I performed to move from my existing KNX v1 configuration to the new KNX v2 stuff.

Multiple edits to follow :slight_smile:

Step 0) Read https://www.openhab.org/addons/bindings/knx/

Step 1) Backup your existing configuration files !!!

  • $OPENHAB_CONF/services/knx.cfg
  • $OPENHAB_CONF/items/knx.items

Step 2) Uninstall KNX1 binding and install KNX2 binding.
Check your $OPENHAB_CONF/services/addons.cfg also (if you use the bindings = line)

Step 3) Create a new $OPENHAB_CONF/things/KNX.things file and define your system.
Sample with one Bridge, one Actuator with 4 channels below:

Bridge	knx:ip:GIRA2167 "GIRA KNX/IP Router" @ "KNX" [
	type="ROUTER",
	ipAddress="224.0.23.12",
	portNumber=3671,
	localIp="172.16.13.100",
	readingPause=50,
	responseTimeout=10,
	readRetriesLimit=3,
	autoReconnectPeriod=1,
	localSourceAddr="1.2.200" ]
	{
                Thing device GW90741_4 "Switch Actuator 4" @ "KNX" [ address="1.1.4", fetch=false, pingInterval=600, readInterval=0 ]
                {
                        Type    switch  :       Channel_41      "Channel 4.1"   [ ga="1/0/12+<1/2/12" ]
                        Type    switch  :       Channel_42      "Channel 4.2"   [ ga="1/0/13+<1/2/13" ]
                        Type    switch  :       Channel_43      "Channel 4.3"   [ ga="1/0/14+<1/2/14" ]
                        Type    switch  :       Channel_44      "Channel 4.4"   [ ga="1/0/15+<1/2/15" ]
                }
	}

Step 4) Create a new $OPENHAB_CONF/items/KNX.items file and define your first item and link it to the correct Thing’s channel above

Switch	P06_Small_LED		"P06 Small LED"		<switch>	(gGF_P06_Office,gGF_Lights,gKNX)	{ channel="knx:device:GIRA2167:GW90741_4:Channel_42" }

With regards to naming the new Things, Channels and Items, I used the following concept:

  • For the Bridge and the Things: Use the Product IDs of the physical devices
  • For the Thing Channel Names: Use the Channel IDs of the Actuators (Switch and Shutter)
  • Use Logical names for the Items and link them to the Thing Channels

Mid_Panel.pdf (261.5 KB)

Full Config:
/etc/openhab2/things/KNX.things

Bridge	knx:ip:GIRA2167 "GIRA KNX/IP Router" @ "KNX" [
	type="ROUTER",
	ipAddress="224.0.23.12",
	portNumber=3671,
	localIp="172.16.13.100",
	readingPause=50,
	responseTimeout=10,
	readRetriesLimit=3,
	autoReconnectPeriod=1,
	localSourceAddr="1.2.200" ]
	{
		Thing device GW90741_1 "Switch Actuator 1" @ "KNX" [ address="1.1.1", fetch=false, pingInterval=600, readInterval=0 ]
		{
			Type	switch	:	Ch_11		"Channel 1.1"		[ ga="1/0/8+<1/2/8" ]
			Type	switch	:	Ch_12		"Channel 1.2"		[ ga="1/0/9+<1/2/9" ]
			Type	switch	:	Ch_13		"Channel 1.3"		[ ga="1/0/10+<1/2/12" ]
			Type	switch	:	Ch_14		"Channel 1.4"		[ ga="1/0/11+<1/2/11" ]
		}
		Thing device GW90741_2 "Switch Actuator 2" @ "KNX" [ address="1.1.2", fetch=false, pingInterval=600, readInterval=0 ]
		{
			Type	switch	:	Ch_21		"Channel 2.1"		[ ga="1/0/6+<1/2/6" ]
			Type	switch	:	Ch_22		"Channel 2.2"		[ ga="1/0/7+<1/2/7" ]
			Type	switch	:	Ch_23		"Channel 2.3"		[ ga="1/0/1+<1/2/1" ]
			Type	switch	:	Ch_24		"Channel 2.4"		[ ga="1/0/2+<1/2/2" ]
		}
		Thing device GW90741_3 "Switch Actuator 3" @ "KNX" [ address="1.1.3", fetch=false, pingInterval=600, readInterval=0 ]
		{
			Type	switch	:	Ch_31		"Channel 3.1"		[ ga="1/0/3+<1/2/3" ]
			Type	switch	:	Ch_32		"Channel 3.2"		[ ga="1/0/4+<1/2/4" ]
			Type	switch	:	Ch_33		"Channel 3.3"		[ ga="1/0/5+<1/2/5" ]
			Type	switch	:	Ch_34		"Channel 3.4"		[ ga="1/0/14+<1/2/14" ]
		}
		Thing device GW90741_4 "Switch Actuator 4" @ "KNX" [ address="1.1.4", fetch=false, pingInterval=600, readInterval=0 ]
		{
			Type	switch	:	Ch_41		"Channel 4.1"		[ ga="1/0/12+<1/2/12" ]
			Type	switch	:	Ch_42		"Channel 4.2"		[ ga="1/0/13+<1/2/13" ]
			Type	switch	:	Ch_43		"Channel 4.3"		[ ga="1/0/14+<1/2/14" ]
			Type	switch	:	Ch_44		"Channel 4.4"		[ ga="1/0/15+<1/2/15" ]
		}
		Thing device GW90741_5 "Switch Actuator 5" @ "KNX" [ address="1.1.5", fetch=false, pingInterval=600, readInterval=0 ]
		{
			Type	switch	:	Ch_51		"Channel 5.1"		[ ga="1/0/16+<1/2/16" ]
			Type	switch	:	Ch_52		"Channel 5.2"		[ ga="1/0/17+<1/2/17" ]
			Type	switch	:	Ch_53		"Channel 5.3"		[ ga="1/0/18+<1/2/18" ]
			Type	switch	:	Ch_54		"Channel 5.4"		[ ga="1/0/19+<1/2/19" ]
		}
		Thing device GW90741_6 "Switch Actuator 6" @ "KNX" [ address="1.1.6", fetch=false, pingInterval=600, readInterval=0 ]
		{
			Type	switch	:	Ch_61		"Channel 6.1"		[ ga="1/1/0+<1/2/20" ]
			Type	switch	:	Ch_62		"Channel 6.2"		[ ga="1/1/1+<1/2/21" ]
			Type	switch	:	Ch_63		"Channel 6.3"		[ ga="1/1/2+<1/2/22" ]
			Type	switch	:	Ch_64		"Channel 6.4"		[ ga="1/1/9+<1/2/29" ]
		}
		Thing device GW90741_7 "Switch Actuator 7" @ "KNX" [ address="1.1.7", fetch=false, pingInterval=600, readInterval=0 ]
		{
			Type	switch	:	Ch_71		"Channel 7.1"		[ ga="1/1/3+<1/2/23" ]
			Type	switch	:	Ch_72		"Channel 7.2"		[ ga="1/1/4+<1/2/24" ]
			Type	switch	:	Ch_73		"Channel 7.3"		[ ga="1/1/7+<1/2/27" ]
			Type	switch	:	Ch_74		"Channel 7.4"		[ ga="1/1/8+<1/2/28" ]
		}
		Thing device GW90741_8 "Switch Actuator 8" @ "KNX" [ address="1.1.8", fetch=false, pingInterval=600, readInterval=0 ]
		{
			Type	switch	:	Ch_81		"Channel 8.1"		[ ga="1/1/10+<1/2/30" ]
			Type	switch	:	Ch_82		"Channel 8.2"		[ ga="1/1/11+<1/2/31" ]
			Type	switch	:	Ch_83		"Channel 8.3"		[ ga="1/1/12+<1/2/32" ]
			Type	switch	:	Ch_84		"Channel 8.4"		[ ga="1/1/13+<1/2/33" ]
		}
		Thing device GW90741_9 "Switch Actuator 9" @ "KNX" [ address="1.1.9", fetch=false, pingInterval=600, readInterval=0 ]
		{
			Type	switch	:	Ch_91		"Channel 9.1"		[ ga="1/1/5+<1/2/25" ]
			Type	switch	:	Ch_92		"Channel 9.2"		[ ga="1/1/6+<1/2/26" ]
			Type	switch	:	Ch_93		"Channel 9.3"		[ ga="1/0/35+<1/2/35" ]
			Type	switch	:	Ch_94		"Channel 9.4"		[ ga="1/0/36+<1/2/36" ]
		}
		Thing device GW90857_10 "Shutter Actuator 10" @ "KNX" [ address="1.1.10", fetch=false, pingInterval=600, readInterval=0 ]
		{
			Type	rollershutter :	Ch_101		"Channel 10.1"		[ upDown="2/1/0", stopMove="2/1/1", position="2/3/10+<2/2/10" ]
			Type	rollershutter :	Ch_102		"Channel 10.2"		[ upDown="2/1/2", stopMove="2/1/3", position="2/3/12+<2/2/12" ]
			Type	rollershutter :	Ch_103		"Channel 10.3"		[ upDown="2/1/4", stopMove="2/1/5", position="2/3/14+<2/2/14" ]
			Type	rollershutter :	Ch_104		"Channel 10.4"		[ upDown="2/1/6", stopMove="2/1/7", position="2/3/16+<2/2/16" ]
		}
		Thing device GW90857_11 "Shutter Actuator 11" @ "KNX" [ address="1.1.11", fetch=false, pingInterval=600, readInterval=0 ]
		{
			Type	rollershutter :	Ch_111		"Channel 11.1"		[ upDown="2/1/8", stopMove="2/1/9", position="2/3/18+<2/2/18" ]
			Type	rollershutter :	Ch_112		"Channel 11.2"		[ upDown="2/0/0", stopMove="2/0/1", position="2/3/0+<2/2/0" ]
			Type	rollershutter :	Ch_113		"Channel 11.3"		[ upDown="2/0/2", stopMove="2/0/3", position="2/3/2+<2/2/2" ]
			Type	rollershutter :	Ch_114		"Channel 11.4"		[ upDown="2/0/4", stopMove="2/0/5", position="2/3/4+<2/2/4" ]
		}
		Thing device GW90857_12 "Shutter Actuator 12" @ "KNX" [ address="1.1.12", fetch=false, pingInterval=600, readInterval=0 ]
		{
			Type	rollershutter :	Ch_121		"Channel 12.1"		[ upDown="2/0/6", stopMove="2/0/7", position="2/3/6+<2/2/6" ]
			Type	rollershutter :	Ch_122		"Channel 12.2"		[ upDown="2/0/8", stopMove="2/0/9", position="2/3/8+<2/2/8" ]
		}
		Thing device PM30D01_C "3P Energy Meter Current" @ "KNX" [ address="1.1.32", fetch=false, pingInterval=600, readInterval=10 ]
		{
			Type	number	:	Ch_CL1		"Channel CL1"		[ ga="14.019:<3/1/1" ]
			Type	number	:	Ch_CL2		"Channel CL2"		[ ga="14.019:<3/1/2" ]
			Type	number	:	Ch_CL3		"Channel CL3"		[ ga="14.019:<3/1/3" ]
		}
		Thing device PM30D01_V "3P Energy Meter Voltage" @ "KNX" [ address="1.1.32", fetch=false, pingInterval=600, readInterval=300 ]
		{
			Type	number	:	Ch_VL1N		"Channel VL1N"		[ ga="14.028:<3/2/1" ]
			Type	number	:	Ch_VL2N		"Channel VL2N"		[ ga="14.028:<3/2/2" ]
			Type	number	:	Ch_VL3N		"Channel VL3N"		[ ga="14.028:<3/2/3" ]
			Type	number	:	Ch_VL12		"Channel VL12"		[ ga="14.028:<3/2/4" ]
			Type	number	:	Ch_VL23		"Channel VL23"		[ ga="14.028:<3/2/5" ]
			Type	number	:	Ch_VL31		"Channel VL31"		[ ga="14.028:<3/2/6" ]
		}
		Thing device PM30D01_P "3P Energy Meter Power" @ "KNX" [ address="1.1.32", fetch=false, pingInterval=600, readInterval=300 ]
		{
			Type	number	:	Ch_ACPSum	"Channel ACPSum"	[ ga="14.056:<3/3/1" ]
			Type	number	:	Ch_ACPL1	"Channel ACPL1"		[ ga="14.056:<3/3/2" ]
			Type	number	:	Ch_ACPL2	"Channel ACPL2"		[ ga="14.056:<3/3/3" ]
			Type	number	:	Ch_ACPL3	"Channel ACPL3"		[ ga="14.056:<3/3/4" ]
			Type	number	:	Ch_APPSum	"Channel APPSum"	[ ga="14.056:<3/3/5" ]
			Type	number	:	Ch_APPL1	"Channel APPL1"		[ ga="14.056:<3/3/6" ]
			Type	number	:	Ch_APPL2	"Channel APPL2"		[ ga="14.056:<3/3/7" ]
			Type	number	:	Ch_APPL3	"Channel APPL3"		[ ga="14.056:<3/3/8" ]
			Type	number	:	Ch_RPSum	"Channel RPSum"		[ ga="14.056:<3/3/9" ]
			Type	number	:	Ch_RPL1		"Channel RPL1"		[ ga="14.056:<3/3/10" ]
			Type	number	:	Ch_RPL2		"Channel RPL2"		[ ga="14.056:<3/3/11" ]
			Type	number	:	Ch_RPL3		"Channel RPL3"		[ ga="14.056:<3/3/12" ]
			Type	number	:	Ch_PFSum	"Channel PFSum"		[ ga="14.056:<3/3/13" ]
			Type	number	:	Ch_PFL1		"Channel PFL1"		[ ga="14.056:<3/3/14" ]
			Type	number	:	Ch_PFL2		"Channel PFL2"		[ ga="14.056:<3/3/15" ]
			Type	number	:	Ch_PFL3		"Channel PFL3"		[ ga="14.056:<3/3/16" ]
		}
		Thing device PM30D01_E "3P Energy Meter Energy" @ "KNX" [ address="1.1.32", fetch=false, pingInterval=600, readInterval=300 ]
		{
			Type	number	:	Ch_AEISum	"Channel AEISum"	[ ga="13.010:<3/4/1" ]
			Type	number	:	Ch_AEIL1	"Channel AEIL1"		[ ga="13.010:<3/4/2" ]
			Type	number	:	Ch_AEIL2	"Channel AEIL2"		[ ga="13.010:<3/4/3" ]
			Type	number	:	Ch_AEIL3	"Channel AEIL3"		[ ga="13.010:<3/4/4" ]
			Type	number	:	Ch_AEESum	"Channel AEESum"	[ ga="13.010:<3/4/5" ]
			Type	number	:	Ch_AEEL1	"Channel AEEL1"		[ ga="13.010:<3/4/6" ]
			Type	number	:	Ch_AEEL2	"Channel AEEL2"		[ ga="13.010:<3/4/7" ]
			Type	number	:	Ch_AEEL3	"Channel AEEL3"		[ ga="13.010:<3/4/8" ]
			Type	number	:	Ch_REISum	"Channel REISum"	[ ga="13.012:<3/4/9" ]
			Type	number	:	Ch_REIL1	"Channel REIL1"		[ ga="13.012:<3/4/10" ]
			Type	number	:	Ch_REIL2	"Channel REIL2"		[ ga="13.012:<3/4/11" ]
			Type	number	:	Ch_REEL3	"Channel REEL3"		[ ga="13.012:<3/4/16" ]
		}
		Thing device PM30D01_F "3P Energy Meter Frequency" @ "KNX" [ address="1.1.32", fetch=false, pingInterval=600, readInterval=300 ]
		{
			Type	number	:	Ch_FR		"Channel FR"		[ ga="14.033:<3/5/1" ]
		}
	}

/etc/openhab2/items/KNX.items

/* GW90741_1 */
Switch	P11_Small_LED			"P11 Small LED"		<switch>	(gGF_P11_Living,gGF_Lights,gKNX)	{ channel="knx:device:GIRA2167:GW90741_1:Ch_11" }
Switch	P11_Large_LED			"P11 Large LED"		<switch>	(gGF_P11_Living,gGF_Lights,gKNX)	{ channel="knx:device:GIRA2167:GW90741_1:Ch_12" }
Switch	P11_Light				"P11 Dining Light"	<switch>	(gGF_P11_Living,gGF_Lights,gKNX)	{ channel="knx:device:GIRA2167:GW90741_1:Ch_13" }
Switch	P11_Terrace_Light		"P11 Terrace Light"	<switch>	(gGF_P11_Living,gGF_Lights,gKNX)	{ channel="knx:device:GIRA2167:GW90741_1:Ch_14" }
/* GW90741_2 */
Switch	P08_Terrace_Large_LED	"P08 Terrace Large LED"	<switch>	(gGF_P08_Kitchen,gGF_Lights,gKNX)	{ channel="knx:device:GIRA2167:GW90741_2:Ch_21" }
Switch	P08_Terrace_Small_LED	"P08 Terrace Small LED"	<switch>	(gGF_P08_Kitchen,gGF_Lights,gKNX)	{ channel="knx:device:GIRA2167:GW90741_2:Ch_22" }
Switch	P10_Light				"P10 Light"		<switch>	(gGF_P10_CompRoom,gGF_Lights,gKNX)	{ channel="knx:device:GIRA2167:GW90741_2:Ch_23" }
Switch	P09_Light				"P09 Light"		<switch>	(gGF_P09_TechRoom,gGF_Lights,gKNX)	{ channel="knx:device:GIRA2167:GW90741_2:Ch_24" }
/* GW90741_3 */
Switch	P08_LED					"P08 LED"		<switch>	(gGF_P08_Kitchen,gGF_Lights,gKNX)	{ channel="knx:device:GIRA2167:GW90741_3:Ch_31" }
Switch	P08_Ventilator			"P08 Ventilator"	<switch>	(gGF_P08_Kitchen,gGF_Lights,gKNX)	{ channel="knx:device:GIRA2167:GW90741_3:Ch_32" }
Switch	P08_Light				"P08 Light"		<switch>	(gGF_P08_Kitchen,gGF_Lights,gKNX)	{ channel="knx:device:GIRA2167:GW90741_3:Ch_33" }
Switch	E09_Master_Terrace		"E09 Master Terrace"	<switch>	(gFF_E09_Bedroom,gFF_Lights,gKNX)	{ channel="knx:device:GIRA2167:GW90741_3:Ch_34" }
/* GW90741_4 */
Switch	P06_Large_LED			"P06 Large LED"		<switch>	(gGF_P06_Office,gGF_Lights,gKNX)	{ channel="knx:device:GIRA2167:GW90741_4:Ch_41" }
Switch	P06_Small_LED			"P06 Small LED"		<switch>	(gGF_P06_Office,gGF_Lights,gKNX)	{ channel="knx:device:GIRA2167:GW90741_4:Ch_42" }
Switch	P07_Large_LED			"P07 Large LED"		<switch>	(gGF_P07_Guest,gGF_Lights,gKNX)		{ channel="knx:device:GIRA2167:GW90741_4:Ch_43" }
Switch	P07_Small_LED			"P07 Small LED"		<switch>	(gGF_P07_Guest,gGF_Lights,gKNX)		{ channel="knx:device:GIRA2167:GW90741_4:Ch_44" }
/* GW90741_5 */
Switch	P03_Wh_Light			"P03 Wh. Light"		<switch>	(gGF_P03_Warehouse,gGF_Lights,gKNX)	{ channel="knx:device:GIRA2167:GW90741_5:Ch_51" }
Switch	P05_Light				"P05 Light"		<switch>	(gGF_P05_Laundry,gGF_Lights,gKNX)	{ channel="knx:device:GIRA2167:GW90741_5:Ch_52" }
Switch	P04_LED					"P04 LED"		<switch>	(gGF_P04_Bath,gGF_Lights,gKNX)		{ channel="knx:device:GIRA2167:GW90741_5:Ch_53" }
Switch	P04_Mirror				"P04 Mirror"		<switch>	(gGF_P04_Bath,gGF_Lights,gKNX)		{ channel="knx:device:GIRA2167:GW90741_5:Ch_54" }
/* GW90741_6 */
Switch	E04a_Mirror				"E04a Mirror"		<switch>	(gFF_E04a_MBath,gFF_Lights,gKNX)	{ channel="knx:device:GIRA2167:GW90741_6:Ch_61" }
Switch	E04a_LED				"E04a LED"		<switch>	(gFF_E04a_MBath,gFF_Lights,gKNX)	{ channel="knx:device:GIRA2167:GW90741_6:Ch_62" }
Switch	E04b_Light				"E04b Light"		<switch>	(gFF_E04b_Dressing,gFF_Lights,gKNX)	{ channel="knx:device:GIRA2167:GW90741_6:Ch_63" }
Switch	E07_Light				"E07 Light"		<switch>	(gFF_E07_Dressing,gFF_Lights,gKNX)	{ channel="knx:device:GIRA2167:GW90741_6:Ch_64" }
/* GW90741_7 */
Switch	E05_LED					"E05 LED"		<switch>	(gFF_E05_SBath,gFF_Lights,gKNX)		{ channel="knx:device:GIRA2167:GW90741_7:Ch_71" }
Switch	E05_Mirror				"E05 Mirror"		<switch>	(gFF_E05_SBath,gFF_Lights,gKNX)		{ channel="knx:device:GIRA2167:GW90741_7:Ch_72" }
Switch	E06_Large_LED			"E06 Large LED"		<switch>	(gFF_E06_S,gFF_Lights,gKNX)		{ channel="knx:device:GIRA2167:GW90741_7:Ch_73" }
Switch	E06_Small_LED			"E06 Small LED"		<switch>	(gFF_E06_S,gFF_Lights,gKNX)		{ channel="knx:device:GIRA2167:GW90741_7:Ch_74" }
/* GW90741_8 */
Switch	E08_LED					"E08 LED"		<switch>	(gFF_E08_Bath,gFF_Lights,gKNX)		{ channel="knx:device:GIRA2167:GW90741_8:Ch_81" }
Switch	E08_Mirror				"E08 Mirror"		<switch>	(gFF_E08_Bath,gFF_Lights,gKNX)		{ channel="knx:device:GIRA2167:GW90741_8:Ch_82" }
Switch	E09_Small_LED			"E09 Small LED"		<switch>	(gFF_E09_Bedroom,gFF_Lights,gKNX)	{ channel="knx:device:GIRA2167:GW90741_8:Ch_83" }
Switch	E09_Large_LED			"E09 Large LED"		<switch>	(gFF_E09_Bedroom,gFF_Lights,gKNX)	{ channel="knx:device:GIRA2167:GW90741_8:Ch_84" }
/* GW90741_9 */
Switch	E03_Large_LED			"E03 Large LED"		<switch>	(gFF_E03_M,gFF_Lights,gKNX)	{ channel="knx:device:GIRA2167:GW90741_9:Ch_91" }
Switch	E03_Small_LED			"E03 Small LED"		<switch>	(gFF_E03_M,gFF_Lights,gKNX)	{ channel="knx:device:GIRA2167:GW90741_9:Ch_92" }
Switch	P01_Exterior_Light		"P01 Exterior Light"	<switch>	(gGF_P01_Windfang,gGF_Lights,gKNX)	{ channel="knx:device:GIRA2167:GW90741_9:Ch_93" }
/* Switch	P01_Free			"P01 Free"		<switch>	(gGF_P01_Windfang,gGF_Lights,gKNX)	{ channel="knx:device:GIRA2167:GW90741_9:Ch_94" } */

/* GW90857_10 */
Rollershutter	E06_J6			"E06 S J6"		<rollershutter>	(gFF_E06_S,gShutters,gKNX)		{ channel="knx:device:GIRA2167:GW90857_10:Ch_101" }
Rollershutter	E03_J7			"E03 M J7"		<rollershutter>	(gFF_E03_M,gShutters,gKNX)		{ channel="knx:device:GIRA2167:GW90857_10:Ch_102" }
Rollershutter	E09_J8			"E09 Bedroom J8"	<rollershutter>	(gFF_E09_Bedroom,gShutters,gKNX)	{ channel="knx:device:GIRA2167:GW90857_10:Ch_103" }
Rollershutter	E09_J9			"E09 Bedroom J9"	<rollershutter>	(gFF_E09_Bedroom,gShutters,gKNX)	{ channel="knx:device:GIRA2167:GW90857_10:Ch_104" }
/* GW90857_11 */
Rollershutter	E09_J10			"E09 Bedroom J10"	<rollershutter>	(gFF_E09_Bedroom,gShutters,gKNX)	{ channel="knx:device:GIRA2167:GW90857_11:Ch_111" }
Rollershutter	P11_J1			"P11 Living J1"		<rollershutter>	(gGF_P11_Living,gShutters,gKNX)		{ channel="knx:device:GIRA2167:GW90857_11:Ch_112" }
Rollershutter	P11_J2			"P11 Living J2"		<rollershutter>	(gGF_P11_Living,gShutters,gKNX)		{ channel="knx:device:GIRA2167:GW90857_11:Ch_113" }
Rollershutter	P11_J3			"P11 Living J3"		<rollershutter>	(gGF_P11_Living,gShutters,gKNX)		{ channel="knx:device:GIRA2167:GW90857_11:Ch_114" }
/* GW90857_12 */
Rollershutter	P06_J4			"P06 Office J4"		<rollershutter>	(gGF_P06_Office,gShutters,gKNX)		{ channel="knx:device:GIRA2167:GW90857_12:Ch_121" }
Rollershutter	P07_J5			"P07 Guest J5"		<rollershutter>	(gGF_P07_Guest,gShutters,gKNX)		{ channel="knx:device:GIRA2167:GW90857_12:Ch_122" }

Edit KNX2 Things and items in Textfiles
(Angelos) #2

So far, so good with KNX2 !

All works perfect, very fast and without echos!


(Thomas Binder) #3

Thanks for your thoughts and help here.
I’ll take the Migration for a bit of a complete roundup for my KNX-Installation. As I did some adjustments over the last years, I bet it’s time to refactor my KNX-Installation and then the OH2 KNX2 configuration.

…I’m a bit scared, though! :wink:

For easier setups, is there something like a KNX1 => KNX2 migration tool somewhere? In my house I have like hundreds of GAs and stuff and if it weren’t for me refactoring the whole thing, a simpler migration than to rewrite the files would be great? is this possible at all?


(Angelos) #4

don’t be… it will take you some time to migrate but it’s fun ! (grab a laaaarge cup of coffee first :smile:)

Not really… What can help is VSCode. I didn’t use it during the rewrite of my flat config files (I should have)
@Udo_Hartmann used it to migrate his setup and it helped him.


(Thomas Binder) #5

allright…then I’ll try it…
but not now - it’s sunny outside. :sun_with_face:


(Angelos) #6

Found an interesting scenario that might help others also

Use Case: Poll/Read a device (Energy Meter) with multiple outputs (each linked to a GA) at different intervals

In KNX1 world, you would define the poll/read interval on the Item configuration itself. For example:

Number	CL1			"Current Phase 1 [%.4f A]"	<energy>	(gEnergy)		{knx="<(10)14.019:3/1/1"}

This config would poll/read every 10 seconds the data reading from GA 3/1/1 with a DTP of 14.019

With KNX2 you must define the polling interval on the Thing level. This applies to all Channels (and as a result: to all items linked to them).

In order to have different poll/read intervals, you need to define multiple Things and group the desired Channels under them.

Example of 2 separate Things (using the same Physical Address) to poll/read at different intervals the desired readings:

		Thing device PM30D01_C "3P Energy Meter Current" @ "KNX" [ address="1.1.32", fetch=false, pingInterval=600, readInterval=10 ]
		{
			Type	number	:	Ch_CL1		"Channel CL1"		[ ga="14.019:<3/1/1" ]
			Type	number	:	Ch_CL2		"Channel CL2"		[ ga="14.019:<3/1/2" ]
			Type	number	:	Ch_CL3		"Channel CL3"		[ ga="14.019:<3/1/3" ]
		}
		Thing device PM30D01_V "3P Energy Meter Voltage" @ "KNX" [ address="1.1.32", fetch=false, pingInterval=600, readInterval=300 ]
		{
			Type	number	:	Ch_VL1N		"Channel VL1N"		[ ga="14.028:<3/2/1" ]
			Type	number	:	Ch_VL2N		"Channel VL2N"		[ ga="14.028:<3/2/2" ]
			Type	number	:	Ch_VL3N		"Channel VL3N"		[ ga="14.028:<3/2/3" ]
			Type	number	:	Ch_VL12		"Channel VL12"		[ ga="14.028:<3/2/4" ]
			Type	number	:	Ch_VL23		"Channel VL23"		[ ga="14.028:<3/2/5" ]
			Type	number	:	Ch_VL31		"Channel VL31"		[ ga="14.028:<3/2/6" ]
		}

In this case, I poll/read Current (A) every 10 secs through Thing PM30D01_C and I poll/read Voltage (V) every 5 mins through Thing PM30D01_V.

Of course, the associated/linked Items are:

/* Eelectron Three Phase Energy Meter PM30D01 KNX */
/* Current Measurement */
Number	CL1	"Current Phase 1 [%.4f A]"		<energy>	(gEnergy)	{ channel="knx:device:GIRA2167:PM30D01_C:Ch_CL1" }
Number	CL2	"Current Phase 2 [%.4f A]"		<energy>	(gEnergy)	{ channel="knx:device:GIRA2167:PM30D01_C:Ch_CL2" }
Number	CL3	"Current Phase 3 [%.4f A]"		<energy>	(gEnergy)	{ channel="knx:device:GIRA2167:PM30D01_C:Ch_CL3" }
/* Voltage Measurement */
Number	VL1N	"L1-N Voltage [%.2f V]"		<energy>	(gEnergy)	{ channel="knx:device:GIRA2167:PM30D01_V:Ch_VL1N" }
Number	VL2N	"L2-N Voltage [%.2f V]"		<energy>	(gEnergy)	{ channel="knx:device:GIRA2167:PM30D01_V:Ch_VL2N" }
Number	VL3N	"L3-N Voltage [%.2f V]"		<energy>	(gEnergy)	{ channel="knx:device:GIRA2167:PM30D01_V:Ch_VL3N" }
Number	VL12	"L1-2 Voltage [%.2f V]"		<energy>	(gEnergy)	{ channel="knx:device:GIRA2167:PM30D01_V:Ch_VL12" }
Number	VL23	"L2-3 Voltage [%.2f V]"		<energy>	(gEnergy)	{ channel="knx:device:GIRA2167:PM30D01_V:Ch_VL23" }
Number	VL31	"L3-1 Voltage [%.2f V]"		<energy>	(gEnergy)	{ channel="knx:device:GIRA2167:PM30D01_V:Ch_VL31" }

@george.erhan


(Thomas Binder) #7

just out of curiosity: Why do you poll a KNX device? I’d like to think, KNX devices themselves push their data on the respected GA if there’s something new (or in regular intervals) - at least my devices do that. So, sorry for that dumb question, but why do you even poll a “relatively smart” device?


(Angelos) #8

to periodically collect data to graph
By default, the energy meter will not transmit any info (unless configured to do so).
This is a bit different from a status update from a Switch Actor (which will transmit the new status on the GA)


(Thomas Binder) #9

ok, this is what I was looking for. Normally I would expect to configure the KNX device (the energy meter in that case) to send periodically its information (at least the GIRA energy meter 2175/3310 can send). so, if you can’t configure the device to do so for some reason, polling would be the last resort.

Thanks for clarifying!


(Christian) #10

Hi there,

first of all, thanks for tutorial. I followed it and got it “working”, but sending commands is very, very slow. I don’t know what the root cause is, but having a look at the logs;

2018-06-01 10:48:28.013 [WARN ] [ip.KNXnet/IP Tunneling 10.0.0.2:3671] - response timeout waiting for confirmation
tuwien.auto.calimero.KNXTimeoutException: no confirmation reply received for 1.1.100->1.1.2 L_Data.req, system priority hop count 6 repeat, tpdu 81

it seems there is an issue with “status polling” (don’t know how to put it better).

I created a Bridge knx:ip:JUNGIPS200REG "JUNG KNX/IP Gateway" and used the same parameters as in the 1.X binding (my interface is shown in PaperUI as online).

Next I added a Thing device JUNG_S2 "[S2] JUNG 2316.16REGHE" @ "KNX" [ address="1.1.2", fetch=true, pingInterval=600, readInterval=0 ], that has a Type switch : Channel_S2_12 "S2/C12" [ ga="3/1/40+<3/1/43" ] (this thing is also shown in PaperUI, but marked as “OFFLINE”)

Last, but not least I have a Switch OG_Buero_LEU_Deckenspots "Büro Spots [%s]" <light> (gOG, gOGbuero, gLicht, gLichtOG) { channel="knx:device:JUNGIPS200REG:JUNG_S2:Channel_S2_12" }

It doesn’t matter from which device I’m sending commands (tested with PC/BasicUI and openHAB for iOS)… they are somehow “recognised”, but with a latency of 5-12 seconds.

For the moment I did a rollback to a snapshot I created before upgrading.


(Angelos) #11

Post you KNX.things file to check it

Did you experience timeouts before with knx1?


(Christian) #12

hi @Dim!

thanks for reply. no, no timeouts with knx1 - works/ed like a charm.

Bridge knx:ip:JUNGIPS200REG “JUNG KNX/IP Gateway” @ “KNX” [
// Network address of the KNX/IP gateway
ipAddress=“10.0.0.2”,
// Port number of the KNX/IP gateway
portNumber=3671,
// Network address of the local host to be used to set up the connection to the KNX/IP gateway
localIp=“10.0.0.14”,
// The IP connection type for connecting to the KNX bus (TUNNEL or ROUTER)
type=“TUNNEL”,
// Time in milliseconds of how long should be paused between two read requests to the bus during initialization
readingPause=50,
// Timeout in seconds to wait for a response from the KNX bus
responseTimeout=10,
// Limits the read retries while initialization from the KNX bus
readRetriesLimit=3,
// Seconds between connect retries when KNX link has been lost (0 means never)
autoReconnectPeriod=1,
// The group address for identification of this KNX/IP gateway within the KNX bus
localSourceAddr=“1.1.100”
]
{
Thing device JUNG_S2 “[S2] JUNG 2316.16REGHE” @ “KNX” [ address=“1.1.2”, fetch=true, pingInterval=600, readInterval=0 ]
{
Type switch : Channel_S2_01 “S2/C01” [ ga=“3/1/20+<3/1/23” ]
Type switch : Channel_S2_02 “S2/C02” [ ga=“3/1/25+<3/1/28” ]
Type switch : Channel_S2_03 “S2/C03” [ ga=“2/1/110+<2/1/113” ]
Type switch : Channel_S2_04 “S2/C04” [ ga=“2/1/35+<2/1/38” ]
Type switch : Channel_S2_05 “S2/C05” [ ga=“2/1/115+<2/1/118” ]
Type switch : Channel_S2_06 “S2/C06” [ ga=“2/1/30+<2/1/33” ]
Type switch : Channel_S2_07 “S2/C07” [ ga=“2/1/20+<2/1/23” ]
Type switch : Channel_S2_08 “S2/C08” [ ga=“2/1/55+<2/1/58” ]
Type switch : Channel_S2_09 “S2/C09” [ ga=“3/1/0+<3/1/3” ]
Type switch : Channel_S2_10 “S2/C10” [ ga=“2/1/95+<2/1/98” ]
Type switch : Channel_S2_11 “S2/C11” [ ga=“1/1/0+<1/1/3” ]
Type switch : Channel_S2_12 “S2/C12” [ ga=“3/1/40+<3/1/43” ]
Type switch : Channel_S2_13 “S2/C13” [ ga=“1/1/15+<1/1/18” ]
Type switch : Channel_S2_14 “S2/C14” [ ga=“3/1/15+<3/1/18” ]
Type switch : Channel_S2_15 “S2/C15” [ ga=“2/1/120+<2/1/123” ]
// Type switch : Channel_S2_16 “S2/C16” [ ga=“1/0/15+<1/2/15” ]
}
}


(Angelos) #13

i don’t see anything wrong with your config…

Maybe there is an issue with KNX2… not sure.
I saw some posts from other people also experiencing timeouts on GroupRead operations with KNX2 while never had a problem with KNX1…

You can try to open up a github issue here: https://github.com/openhab/openhab2-addons/issues

Ps: Use Code Fences to post configs/logs/etc


(Christian) #14

Hi @Dim!

Thanks for your reply & sorry for not using forum-syntax. You see what’s really weird is that I can actually send commands on “Channel_S2_14” (that are my office spots), but the latency between switching and actually a reaction from my actuator is approx. 8 seconds. If I immediately want to turn them off again, that command is basically “lost” and if I wait, lets say 10 seconds, it takes again some seconds until the light goes off again.

If I perform the same task with my running OH2.2 installation (/w KNX 1.X binding), everything is very performant.

Regarding your idea with the github issue - I found https://github.com/openhab/openhab2-addons/issues/3364, the guy who opened the thread received the same errors as me. It was updated on 26th March but I’m afraid it’s still open. I’ll keep my eyes open, if I find a solution I’ll post it here of course.


Weird behavior of OH2.3 with KNX 2 Binding
(Tom Wouters) #15

Hi

I’m also trying to migrate my KNX1.13 to KNX 2.x, but i was not able to uninstall the KNX Binding (1.x) in the PAPER UI, it stays in the list. Do i have to uninstall it in a different way?

Thanks,

Tom


(Angelos) #16

Enable Legacy Bindings


(Tom Wouters) #17

Angelos,

Thanks for the response, but not the solution.

They were already included.

Do have to go to the karaf console to uninstall it?

Tom


(Angelos) #18

are you using the addons.cfg file?
you could try the console but this shouldn’t happen… any entries in openhab.log when you try to uninstall it?

try uninstalling knx2 and then knx1 (then install knx2)


(Tom Wouters) #19

A simple upgrade to the latest openhab version did an update in the bindings list in the PaperUI, finally i got rid of the KNX1 version . Thanks, now let’s migrate…


(Alex B.) #20

Hi all,

wanted to share an experience I made with migrating to KNX2.
I have a bunch of GAs that are not tied to a specific target device (e.g., light config for all switches in the house). With KNX1 a no-brainer, but things are needed with KNX2 binding. Intuitively, I put these GAs into a new device thinging and - as the binding help page said is optional - I left out the bus address for this device thing. Obviously because there is not “the bus address” but multiple.

What can I say… didn’t work. I was not able to send out telegrams. ETS did not see anything coming from OH. Finally, I added a fake address to the KNX device thing. And it works…

Intended? Bug?

BR,
Fuzzy


Send value to KNX