Multiple Sitemaps

When configuring OpenHab, I like the ability to separate things, items, and rules files for different services, categories of objects I’m working with.

sonoff.items, tesla.items, etc
sonoff.things, telsa.things, etc
sonoff.rules

Openhab automatically combines all of the items, things and rules and makes them available. That gives me some flexibility for source control, disabling certain classes of objects, etc.

That doesn’t work the same way with sitemaps. If you have multiple sitemaps, you have choose of the them before you can see the items (unless I’m missing something).

Is there a way to have configuration from multiple sitemaps combined into one? If not automatically, perhaps with some sort of include syntax?

// this file is home.sitemap
sitemap home label="My Home" {
    include file="sonoff.siteparts"
    include file="tesla.siteparts"
    // etc
}

Nope. Sitemap syntax has not developed for some time now.

Personally i dont like to have different sitemaps. Instead i work with framing to hide stuff i dont want to see in the first sitemap look. But when you need to have controls you can click on it and all the option show.

Maybe you allready tried that and isnt what you are looking for.
example:

When i click on lights all my lights show up in a new frame and i can control them if i have to or when the scenes or not working.

example:

Code example:

Text item=lightdummy label="Lights"  labelcolor=["gold"]
 	{Frame label="Kitchen"{
 		Slider item= Kitchendimmer
   		Slider item= KitchenKleur
   		Setpoint item=KitchenKleur label="Kitchen Color Temperature [%.1f %%]" minValue=0 maxValue=100 step=20
   		Switch item= Kitchen }
   		
   		Frame label="Living Room"{
		Switch item= Huiskamer_lichten 
		Switch item= esp_00_switch label="Bed light" 
		Switch item= esp_01_switch label="Couch light"
		Switch item= Lights label="Big Lights" icon= bulb 
		Slider item= Huiskamerdimmer 

Not sure if this answers your question but do with it what you want :smiley:

1 Like

No you cannot use include or similar, but you can use groups.
Either use an existing group item (then it’s not sorted but you don’t need to specify items to display again) or explicitly define the items you want to display, here’s two examples.
You can combine Group {} and Frame {}

            Group item=USV label="USV" icon="it_ups" {
                    Text item=USV_Status label="USV Status [MAP(ups.map):%s]" icon="it_ups"
                    Text item=USV_Alarm
                    Text item=USV_Batterie_Ladezustand
                    Text item=USV_Batterie_Laufzeit
                    Text item=USV_Leistung
                    Text item=USV_Eingang_Last

                    Text item=USV_Eingang_Stromstaerke
                    Text item=USV_Eingang_Stromstaerke_Status
                    Text item=USV_Eingang_Qualitaet
                    Text item=USV_Ausgaenge_Stromstaerke
                    Text item=USV_Last
                    Text item=USV_Testergebnis
            }

        Text item=AVR_Status label="AVR [%s]" icon="receiver" {
                Frame {
                        Text item=AVR_Status label="Anzeige [%s]"
                        Text item=AVR_PlayingListeningMode label="Listening Mode [MAP(avrplayinglisteningmode.map): %d]"
                        Switch item=AVR_Power label="AV Receiver" icon="switch"
                        Switch item=AVR_Mute mappings=[ON="Mute", OFF="Un-Mute"] icon="soundvolume_mute"
                        Switch item=AVR_Source label="Quelle [%d]" icon="category_group" mappings=[05="TV/SAT", 19="TV/HDMI1", 22="Dream/HDMI4", 25="BlueRay" ]
                        Setpoint item=AVR_Volume_perc label="Lautstärke [%.0f %%]" icon="soundvolume"
                }
        }

PS: sitemap is just remote control. But openHAB Home Automation is about right that, automation.
All I’m trying to say here is: don’t waste your time here, better invest that into some rule writing.

Thanks for the various suggestions. My reasoning for using separate sitemaps was to have separate “sitemap” files as I’m working through the setup of different devices. Ultimately, I’ll need to work through the UI consequences of a simple combination of different sitemap fragments.

For now, I will write a bash script that creates the full sitemap file from the existing sitemap parts.