Groups in multiple *.items files not working?

Tags: #<Tag:0x00007f2fb0fef1a0> #<Tag:0x00007f2fb0fef060>

I started to split up my configuration to several items files. One of them is one called “Groups.items” where all the groups go. But the others dont seem to get access to it, groups arent working on my sitemap. It only switches to working when copying all the groups definitions to the items files itsself.

Is that intended?

I have not tried it myelf yet, but this issue seems to be connected to a general question I have regarding OpenHAB’s handling of configuration files. So I hope it’s okay to jump in here and maybe the whole thing can be cleared up.

I think it may be related to the way or order in which (item) files are ‘processed’. I am not sure how OpenHAB handles item files when starting up and reading/loading them:

Option 1: Openhab reads item file A (alphabetical order?) and ‘processes’ it. If groups are not yet defined (maybe in item file B) then it will be a problem.

Option 2: All item files are first read and loaded without interpreting them. After that they are ‘processed’. This way all items and types are known.

I hope I’m not completely barking up the wrong tree here :slight_smile:

Which OpenHab Version are you using?

With my OpenHab 2.2 (and it also worked with 2.1) i also do have a Groups.items file and this is working without any issues.

Can you show us your configuration?

Version 2.2.0-1

Groups.items as follows:


//*** Administration & Places -----------------------------------------------
	Group gAdministration "Administration"	
		Group gattic "Dachgeschoss" <attic> (gAdministration)
			Group gDG "Dach" <attic> (gattic)
				Group gDGZR "DG Zimmer R" <office> (gDG)
				Group gDGZL "DG Zimmer L" <office> (gDG)
				Group gDGFloor "DG Flur" <corridor> (gDG)
			Group gDG_Bad "Bad DG" <bath> (gattic)
		Group gfirstfloor "Obergeschoss" <firstfloor> (gAdministration)
			Group gOG_KZL "Kinderzimmer L" <baby_2> (gfirstfloor)
			Group gOG_KZR "Kinderzimmer R" <boy_1> (gfirstfloor)
			Group gOG_SZ "Schlafzimmer" <bedroom> (gfirstfloor)
			Group gOG_Bad "Bad" <bath> (gfirstfloor)
		Group ggroundfloor "Erdgeschoss" <groundfloor> (gAdministration)
			Group gEG "Erdgeschoss" <groundfloor> (ggroundfloor)
		Group gcellar "Keller" <cellar> (gAdministration)
			Group gHeizungskeller "Heizungskeller" <cellar> (gcellar)
			Group gWaeschekeller "Wäschekeller" <cellar> (gcellar)
			Group gSpielkeller "Spielkeller" <cellar> (gcellar)
			Group gKellerflur "Kellerflur" <corridor> (gcellar)
		Group gGarden "Garten" <garden> (gAdministration)
			Group gGarten_hinten "Garten hinten" <garden> (gGarden) 
			Group gGarten_vorne "Garten vorne" <garden> (gGarden)

//*** Funktionen -----------------------------------------------

Group:Switch:OR(ON,OFF) gBatteries "Batteriestatus" <batterylevel> (gAdministration)
Group:Contact:OR(OPEN,CLOSED) gFensterkontakte "Fensterkontakte" <contact> (gAdministration)
Group gHeizung "Heizung" <heating> (gAdministration)
	Group gThermostate "Thermostate" <temperature> (gHeizung)
	Group gModus "Thermostatmodus" <settings> (gHeizung)
Group gLights "Licht" <slider> (gAdministration)
	Group gDimmer "Dimmer" <slider> (gLights)
Group Thermostat "Voice command Thermostat group" (gAdministration)

I have been using it that way since long time ago in openHAB 1.x. I haven’t seen any problems in openHAB 2.x. Have you checked the log to verify that all files are loaded without errors?

My approach is to group different files, so all my Z-Wave items is in one file called zwave.items. The rooms is defined in a file called house.items.

I have tried to prefix my files with a number for grouping load order. It doesn’t seem that it is loaded that way when looking at the log.

I gave it another try, putting all Groups in one item file. While before it worked i now got a problem with the “Administration” group i created and im getting the following error:

2018-01-16 09:46:09.892 [WARN ] [ui.internal.items.ItemUIRegistryImpl] - Dynamic group with label 'Administration' will be ignored, because its item 'gAdministration' does not exist.

I dont know why the Group gAdminsitration isnt recognized any more as i dodnt change code…

To be honest, i don’t have a clue why it is not working…
Have you tried renaming the item, saving and then naming it back again?

Could it be possible that you have a group with the same name created via PaperUI?

1 Like

I renamed the groups.items to group.items and it works… strange.

THanks for Help, problem solved!

1 Like

I found that new .item files were not recognized. I renamed the file and it worked. Renamed it to the original name and it continued to work.

This applied to a new file, groups.items (not working), renamed to group.items (working) and then back to groups.items (still works!)