Setup in multiple files

I just ran a test on my OpenHab 2.1 environment. For the test, I have 1 switch.

Item file 1:
Group test "Test"
Group test2 "Test2"
Switch Light_Power (test, test2, test3) {channel=“zwave:device:XXXXXXXX:node2:switch_binary”, autoupdate=“true”}

Item file 2:
Group test3 "Test3"
Group:Switch:AND(ON,OFF) test4

With this setup, groups test, test2, and surprisingly test4 work fine but I cannot trigger the switch via group test3 from within Basic UI as well as HabPanel.

What’s interesting though is that in HABpanel if I create a switch and type in the group name, typing in t-e-s-t shows 4 things:
test
test2
test4
Light_Power

If I type the 5th character so it reads test3, it still shows Light_Power which indicates that HABpanel can resolve the group test3, but I can’t select it.

All of this is useful information but none of it is relevant rules triggering when the Thing is offline.

But if you are triggering rules based on updates to a group, realize that only test4 can be used as defined above. The rest won’t trigger rules because they don’t have a state. Only Groups with a type get updated when their members update.

There have been some reports that changes to Groups are not being reflected until OH is restarted. Try a restart and see if that works.

Thanks. Regarding the restart, I should have added that there were many restarts in my process… close to 10…

Errors in the logs?

I will recreate and rerun my test tonight and take a look at the logs… I was working on my automatic backup solution last night so I didn’t have time to cross check the logs.

I understood that we can use different items files and rules files.
Can I also use two different things file?
I have a bus which I need to access for different functions. The only problem is a few physical switches have Physical address “1.1.9” while few have “1.1.10”.

This was my initial things file with just one localSourceAddr.

Bridge knx:ip:bridge [
    ipAddress="127.0.0.1",
    portNumber=3671,
    localIp="192.168.1.22", 
    type="TUNNEL",
    ignorelocalevents=true,
    readingPause=50, 
    responseTimeout=10, 
    readRetriesLimit=3, 
    autoReconnectPeriod=1,
    localSourceAddr="1.1.9"
   ] {
      Thing knx:device:bridge:generic {
       Type switch-control        : controlSwitch1        "Control Switch Left1"        [ ga="<0/0/51" ]
       Type switch-control        : controlSwitch2        "Control Switch Left2"        [ ga="<0/0/52" ]
       Type switch-control        : controlSwitch3        "Control Switch Left3"        [ ga="<0/0/53" ]
       Type switch-control        : controlSwitch4        "Control Switch Others"       [ ga="<0/0/54" ]
       Type switch-control        : controlSwitch5        "Control Switch Centre"       [ ga="<0/0/55" ]
  }
}

When I try to modify it as below:

    Thing knx:device:bridge:generic "Address 1" @ "KNX" [
    ipAddress="127.0.0.1",
    portNumber=3671,
    localIp="192.168.1.22",
    type="TUNNEL",
    ignorelocalevents=true,
    readingPause=50,
    responseTimeout=10,
    readRetriesLimit=3,
    autoReconnectPeriod=1,
    localSourceAddr="1.1.9"
   ] {
       Type switch-control        : controlSwitch1        "Control Switch Left1"        [ ga="<0/0/51" ]
       Type switch-control        : controlSwitch2        "Control Switch Left2"        [ ga="<0/0/52" ]
       Type switch-control        : controlSwitch3        "Control Switch Left3"        [ ga="<0/0/53" ]
       Type switch-control        : controlSwitch4        "Control Switch Others"       [ ga="<0/0/54" ]
       Type switch-control        : controlSwitch5        "Control Switch Centre"       [ ga="<0/0/55" ]
       Type switch-control        : f1                    "Signal Switch for Left1"     [ ga="<0/0/3" ]
       Type switch-control        : f2                    "Signal Switch for Left2"     [ ga="<0/0/4" ]
       Type switch-control        : f3                    "Signal Switch for Left3"     [ ga="<0/0/5" ]
       Type switch-control        : f4                    "Signal Switch for Others"    [ ga="<0/0/6" ]
       Type switch-control        : f5                    "Signal Switch for Centre"    [ ga="<0/0/7" ]

       Type dimmer-control        : dimmer1               "Dimmer for Left_Lights1"     [ ga="<0/0/3" ]
       Type dimmer-control        : dimmer2               "Dimmer for Left_Lights2"     [ ga="<0/0/4" ]
       Type dimmer-control        : dimmer3               "Dimmer for Left_Lights3"     [ ga="<0/0/5" ]
       Type dimmer-control        : dimmer4               "Dimmer for Centre_Lights"    [ ga="<0/0/6" ]
       Type dimmer-control        : dimmer5               "Dimmer for Other_Lights"     [ ga="<0/0/7" ]
     }        
Thing knx:device:bridge:generic "Address 2" @ "KNX"[
    ipAddress="127.0.0.1",
    portNumber=3671,
    localIp="192.168.1.22",
    type="TUNNEL",
    ignorelocalevents=true,
    readingPause=50,
    responseTimeout=10,
    readRetriesLimit=3,
    autoReconnectPeriod=1,
    localSourceAddr="1.1.10"
    ] {
         Type switch-control    : controlSwitch6               "All Lights"       [ ga="<0/0/16" ]
         Type switch-control    : controlSwitch10              "Projector"        [ ga="0/0/1+<0/0/2" ]
       }
 

I get the following error:

==> /var/log/openhab2/events.log <==
2018-09-05 09:13:45.028 [hingStatusInfoChangedEvent] - 'knx:device:bridge:generic' changed from UNINITIALIZED to INITIALIZING
2018-09-05 09:13:45.034 [hingStatusInfoChangedEvent] - 'knx:device:bridge:generic' changed from INITIALIZING to UNINITIALIZED (HANDLER_INITIALIZING_ERROR): The bridge must not be null and must be initialized


If I use two different things file, I get the following error:

2018-09-05 09:39:57.765 [WARN ] [ore.common.registry.AbstractRegistry] - ThingImpl with key 'knx:device:bridge:generic' already exists from provider GenericThingProvider! Failed to add a second with the same UID from provider GenericThingProvider!

What should I do?

Duplicate Thing i.d. look problematic to me. Try knx:device:bridge:thisbidge, knx:device:bridge:thatbridge or similar.

As I already stated in another thread, I doubt that it is possible to split knx things configuration in multiple files but only one bridge.
If you really want to use multiple bridges, you have to use different names (i.e.

knx:device:bridge:generic <-- this is the name of the bridge, so 
                              don't name it generic but bridge1 or bridge2

EDIT: oh, much too late…

Thank you

Thank you… I’ll try doing this

I tried using Bridge1 and Bridge2 names but only one bridge works at a time.

==> /var/log/openhab2/events.log <==
2018-09-30 09:29:35.876 [hingStatusInfoChangedEvent] - 'knx:ip:bridge' changed from UNINITIALIZED to INITIALIZING
2018-09-30 09:29:35.959 [hingStatusInfoChangedEvent] - 'knx:ip:bridge' changed from INITIALIZING to UNKNOWN
2018-09-30 09:29:36.040 [hingStatusInfoChangedEvent] - 'knx:device:bridge:bridge2' changed from UNINITIALIZED to INITIALIZING
2018-09-30 09:29:36.073 [hingStatusInfoChangedEvent] - 'knx:device:bridge:bridge2' changed from INITIALIZING to OFFLINE (BRIDGE_OFFLINE)
2018-09-30 09:29:36.080 [hingStatusInfoChangedEvent] - 'knx:device:bridge:bridge1' changed from UNINITIALIZED to INITIALIZING
2018-09-30 09:29:36.083 [hingStatusInfoChangedEvent] - 'knx:device:bridge:bridge1' changed from INITIALIZING to OFFLINE (BRIDGE_OFFLINE)
2018-09-30 09:29:36.224 [hingStatusInfoChangedEvent] - 'knx:ip:bridge' changed from UNKNOWN to ONLINE
2018-09-30 09:29:36.234 [hingStatusInfoChangedEvent] - 'knx:device:bridge:bridge1' changed from OFFLINE (BRIDGE_OFFLINE) to ONLINE
2018-09-30 09:29:36.236 [hingStatusInfoChangedEvent] - 'knx:device:bridge:bridge2' changed from OFFLINE (BRIDGE_OFFLINE) to ONLINE

Although both are shown as online I can see only the second bridge in my Paper UI.
My things file is as below:

Bridge knx:ip:bridge [
    ipAddress="127.0.0.1",
    portNumber=3671,
    localIp="192.168.1.22", 
    type="TUNNEL",
    ignorelocalevents=true,
    readingPause=50, 
    responseTimeout=10, 
    readRetriesLimit=3, 
    autoReconnectPeriod=1
] {
      Thing knx:device:bridge:bridge1 [ localSourceAddr="1.1.9"]
      {
       Type switch-control        : controlSwitch1        "Control Switch Left1"        [ ga="<0/0/51" ]
       Type switch-control        : controlSwitch2        "Control Switch Left2"        [ ga="<0/0/52" ]
       Type switch-control        : controlSwitch3        "Control Switch Left3"        [ ga="<0/0/53" ]
       Type switch-control        : controlSwitch4        "Control Switch Others"       [ ga="<0/0/54" ]
       Type switch-control        : controlSwitch5        "Control Switch Centre"       [ ga="<0/0/55" ]
       Type switch-control        : f1                    "Signal Switch for Left1"     [ ga="<0/0/3" ]
       Type switch-control        : f2                    "Signal Switch for Left2"     [ ga="<0/0/4" ]
       Type switch-control        : f3                    "Signal Switch for Left3"     [ ga="<0/0/5" ]
       Type switch-control        : f4                    "Signal Switch for Others"    [ ga="<0/0/6" ]
       Type switch-control        : f5                    "Signal Switch for Centre"    [ ga="<0/0/7" ]

       Type dimmer-control        : dimmer1               "Dimmer for Left_Lights1"     [ ga="<0/0/3" ]
       Type dimmer-control        : dimmer2               "Dimmer for Left_Lights2"     [ ga="<0/0/4" ]
       Type dimmer-control        : dimmer3               "Dimmer for Left_Lights3"     [ ga="<0/0/5" ]
       Type dimmer-control        : dimmer4               "Dimmer for Centre_Lights"    [ ga="<0/0/6" ]
       Type dimmer-control        : dimmer5               "Dimmer for Other_Lights"     [ ga="<0/0/7" ]
     }        
     Thing knx:device:bridge:bridge2 [ localSourceAddr="1.1.10"]
     {
                 Type switch-control    : controlSwitch6               "All Lights"       [ ga="<0/0/16" ]
		 Type rollershutter       : screen          "Projector"         [ ga="0/0/1" ]
                 Type switch-control    : cs1             "Projector1"        [ ga="<0/0/1" ]
		 Type switch-control    : cs2             "Projector2"        [ ga="<0/0/2" ]
		 
		 Type rollershutter    : blinds1         "Blinds1"           [ ga="<0/0/" ]
		 Type rollershutter    : blinds2         "Blinds2"           [ ga="<0/0/" ]
		 Type rollershutter    : blinds3         "Blinds3"           [ ga="<0/0/" ]
		 
		 Type switch-control    : rs1             "Roller1"           [ ga="<0/0/ " ]
		 Type switch-control    : rs11             "Roller11"           [ ga="<0/0/ " ]
		 Type switch-control    : rs2             "Roller2"           [ ga="<0/0/ " ]
		 Type switch-control    : rs21             "Roller21"           [ ga="<0/0/ " ]
		 Type switch-control    : rs3             "Roller3"           [ ga="<0/0/ " ]
		 Type switch-control    : rs31             "Roller31"           [ ga="<0/0/ " ]
       }
  }

What else can I change?

No, I guess you misunderstood the concept :slight_smile:

If you want to use two bridges, you have to define two bridges. You have to setup the devices to use the different bridges:

Bridge knx:ip:bridge [
 ipAddress="127.0.0.1",
 localIp="192.168.1.22", 
 type="TUNNEL" ]
 {
  Thing device device1 [ 
   localSourceAddr="1.1.9" ] 
   {
    Type switch-control : controlSwitch1 "Control Switch Left1" [ ga="<0/0/51" ]
    Type switch-control : controlSwitch2 "Control Switch Left2" [ ga="<0/0/52" ]
   }
 }

Bridge knx:ip:bridge2 [
 ipAddress="192.168.10.200",
 localIp="192.168.1.22", 
 type="TUNNEL" ]
 {
  Thing device device1 [
   localSourceAddr="1.1.10" ]
   {
    Type switch-control : controlSwitch6 "All Lights" [ ga="<0/0/16" ]
    Type rollershutter  : screen         "Projector"  [ ga="0/0/1" ]
   }
  }

As you can see, there is no need to name the devices different, as openHAB can differ them by the bridge.

Please be aware that this scenario is for multiple knx universes which aren’t coupled (this is a very rare scenario, but openHAB does allow this)

If you’re just using one knx universe and want more than one device, the configuration is much more simple:

Bridge knx:ip:bridge [
 ipAddress="127.0.0.1",
 localIp="192.168.1.22", 
 type="TUNNEL" ]
 {
  Thing device device1 [
   localSourceAddr="1.1.9" ]
   {
    Type switch-control : controlSwitch1 "Control Switch Left1"  [ ga="<0/0/51" ]
    Type switch-control : controlSwitch2 "Control Switch Left2" [ ga="<0/0/52" ]
   }
   Thing device device2 [
    localSourceAddr="1.1.10" ]
    {
     Type switch-control : controlSwitch6 "All Lights" [ ga="<0/0/16" ]
     Type rollershutter  : screen         "Projector"  [ ga="0/0/1" ]
    }
 }

But as this time both devices are bound to the same bridge, you have to use different device names (should be obvious).

Please take notice of the different definition for the bridge and the thing. While the former is defined with colons ( : ) the latter is defined without…

2 Likes

Oh My Bad! Thank you so much :slight_smile:

I tried with this method as well but still nothing works. My Paper UI does not show any device.

Well, what’s the content of your things file now?

Bridge knx:ip:bridge [
    ipAddress="127.0.0.1",
    portNumber=3671,
    localIp="192.168.1.22", 
    type="TUNNEL",
    ignorelocalevents=true,
    readingPause=50, 
    responseTimeout=10, 
    readRetriesLimit=3, 
    autoReconnectPeriod=1
   ] {
      Thing device device1 [
         localSourceAddr="1.1.9" ]
      {
       Type switch-control        : controlSwitch1        "Control Switch Left1"        [ ga="<0/0/51" ]
       Type switch-control        : controlSwitch2        "Control Switch Left2"        [ ga="<0/0/52" ]
       Type switch-control        : controlSwitch3        "Control Switch Left3"        [ ga="<0/0/53" ]
       Type switch-control        : controlSwitch4        "Control Switch Others"       [ ga="<0/0/54" ]
       Type switch-control        : controlSwitch5        "Control Switch Centre"       [ ga="<0/0/55" ]
       Type switch-control        : f1                    "Signal Switch for Left1"     [ ga="<0/0/3" ]
       Type switch-control        : f2                    "Signal Switch for Left2"     [ ga="<0/0/4" ]
       Type switch-control        : f3                    "Signal Switch for Left3"     [ ga="<0/0/5" ]
       Type switch-control        : f4                    "Signal Switch for Others"    [ ga="<0/0/6" ]
       Type switch-control        : f5                    "Signal Switch for Centre"    [ ga="<0/0/7" ]

       Type dimmer-control        : dimmer1               "Dimmer for Left_Lights1"     [ ga="<0/0/3" ]
       Type dimmer-control        : dimmer2               "Dimmer for Left_Lights2"     [ ga="<0/0/4" ]
       Type dimmer-control        : dimmer3               "Dimmer for Left_Lights3"     [ ga="<0/0/5" ]
       Type dimmer-control        : dimmer4               "Dimmer for Centre_Lights"    [ ga="<0/0/6" ]
       Type dimmer-control        : dimmer5               "Dimmer for Other_Lights"     [ ga="<0/0/7" ]

       Type dimmer-control        : ld1      "Brighten_L1"  [ ga="<0/0/3" ]
       Type dimmer-control        : ld2      "Brighten_l2"  [ ga="<0/0/4" ]
       Type dimmer-control        : ld3      "Brighten_L3"  [ ga="<0/0/5" ]  
       Type dimmer-control        : ld4      "Brighten_O"   [ ga="<0/0/6" ]
       Type dimmer-control        : ld5      "Brighten_C"   [ ga="<0/0/7" ]
      }
    Thing device device2 [
         localSourceAddr="1.1.10" ]
        {
                 Type switch-control    : controlSwitch6               "All Lights"       [ ga="<0/0/16" ]
		 Type rollershutter     : screen          "Projector"         [ ga="0/0/1" ]
                 Type switch-control    : cs1             "Projector1"        [ ga="<0/0/1" ]
		 Type switch-control    : cs2             "Projector2"        [ ga="<0/0/2" ]
		 
		 Type rollershutter    : blinds1         "Blinds1"           [ ga="<0/0/42" ]
		 Type rollershutter    : blinds2         "Blinds2"           [ ga="<0/0/44" ]
		 Type rollershutter    : blinds3         "Blinds3"           [ ga="<0/0/46" ]
		 
		 Type switch-control    : rs1             "Roller1"           [ ga="<0/0/42" ]
		 Type switch-control    : rs11             "Roller11"           [ ga="<0/0/47" ]
		 Type switch-control    : rs2             "Roller2"           [ ga="<0/0/44" ]
		 Type switch-control    : rs21             "Roller21"           [ ga="<0/0/49" ]
		 Type switch-control    : rs3             "Roller3"           [ ga="<0/0/46" ]
		 Type switch-control    : rs31             "Roller31"           [ ga="<0/0/46" ]
        } 
   }  


I did a short test and in fact I can see both devices and the bridge (of course it’s marked as offline…) So I can reassure that the configuration is ok.

Please take a look at Paper UI -> Configuration -> Things. The Bridge and Devices should appear in this list.

There was some linking problem. The items were not getting linked to the respective channels.
A restart of the openhab service and manual linking was all that was required.
Thank you so much for your help :slight_smile:
Sorry for bothering you so many times :see_no_evil:

You’re welcome!