How to make Hierarchy in a sitemap?

Hi,

I’m relatively new to this, but I was hoping that I could do something like the following:
default.sitemap
defines a bunch of zones

Then each zone will have something within it.

I’ve so-far used groups to do this, but I can’t work out how to use sliders, selections or anything but the default type for the items in a group.

Can anyone help me with this? Am I going about it the wrong way? - I don’t really want a list of 100’s of items in my default sitemap, as this will be horribly unwieldy.

For reference, I’ve a building with 3 floors, more than 10 zones (some are cupboards), most with heating/multiple lighting scenes/controlled power etc, so I was hoping to have effectively a new site-map for each zone, which would allow me to control the specifics, whilst having a few global options at the top level (i.e. house occupied, welcome page, etc).

Simply, you can’t. Groups displays are really just a simple quick means to get started, incapable of fine tuning.

It is the only way to be able to control how/when/where items are displayed

Check out the principles I follow while building sitemaps:

2 Likes

The answers above cover the general approach. I’m afraid you will have to enter every item (pretty much) that you want to view/control into the sitemap file.

You do say you want to have “effectively a new site-map for each zone”. To do this with a sitemap you would use frames. The start of my main sitemap is below with an addition for yours.

sitemap home label="Home"{
// State
    Frame label="Currently"{
	Text item=alarmState valuecolor=[1="green",2="red",3="orange"]
        Text item=sensorOutsideTemp
        Text item=sensorLivingTemp
        Text item=harmonyActivity visibility=[harmonyActivity!="PowerOff"]
        Text item=PlexTVTitle visibility=[PlexTVStatus!="Stopped"]
	Default item=DN_Sonos_Control visibility=[DN_Sonos_State=="PLAYING"]
        Text item=DN_Sonos_CurrentTitle visibility=[DN_Sonos_State=="PLAYING"]
        Text item=DN_Sonos_CurrentArtist visibility=[DN_Sonos_State=="PLAYING"]
        Text item=androidApp visibility=[harmonyActivity=="Movies / TV"]

        //Some other items?

    }

// Rooms - you can nest information inside the first frame
	Frame label="Rooms"{

////Living Room
		Text label="Living Room" icon="living"{
 			Frame label="Sonos" {
				Default item=LV_Sonos_Control
				Slider item=denonMainZoneVolume
				Text item=LV_Sonos_CurrentTitle
				Text item=LV_Sonos_CurrentArtist
				Text item=LV_Sonos_CurrentAlbum
			}
                       Frame label="Lights"{
				Switch item=lightLiving1Pwr
				Switch item=lightLiving2Pwr
				Slider item=lightLiving1Tmp
				Slider item=lightLiving2Tmp
				Slider item=lightLiving1Brt
				Slider item=lightLiving2Brt
				Switch item=lightLivingTV1Pwr
				Switch item=lightLivingTV2Pwr
				Slider item=lightLivingTV1Tmp
				Slider item=lightLivingTV2Tmp
				Slider item=lightLivingTV1Brt
				Slider item=lightLivingTV2Brt
			}
			Frame label="Environment" {
				Text item=sensorLivingTemp
				Text item=sensorLivingHumidity
				Text item=sensorLivingPIR
				Text item=sensorWindowLiving1
				Text item=sensorWindowLiving2
				Text item=sensorWindowLiving3
				Text item=sensorWindowLiving4
			}
                 }
         }


//Zone 2
    Frame label="Zone 2"{
        //Zone 2 items
    }

//etc
}

If I got it right, you want sub pages for each zone. See this code snippet:

sitemap demo label="My home automation" {
    Frame label="Date" {
        Text item=Date
    }
    Frame label="Demo" {
        Text item=Multimedia_1 label="Multimedia" icon="video" {
            Slider item=Volume_1
        }
        Text item=Multimedia_2 label="Multimedia" icon="video" {
            Slider item=Volume_2
        }
    }
}

This would be rendered in Basic UI as one Page with two frames:
The first frame contains the date.
The second Frame contains two Text Items, which lead to two sub pages.
Each sub Page contains only one Volume Slider. So, the trick is
text item as a Link to the sub page, which is inside the curly brackets { … }

You can nest this to build more complex sitemaps…

Se my .items -> .sitemaps conversion here: My openHAB-2 story

1 Like

Thanks for all the suggestions. I’ll look through them in detail shortly.

The initial question that comes to mind, is “Is there any way to minimise a frame”

Basically, I’ve no issue with the effort of creating loads of frames, but when I’m using them, if I have to scroll through pages and pages of stuff, I think it’ll be unusable.

So, if I can load a page with everything, and then choose to ‘open’ a frame to see the details for that room, it would be great.

When you go through the various suggestions you’ll realize that the solution is to simply minimize the count of elements you are presenting in one view. Your openHAB setup might consist of hundreds of items but only a few dozens of these are really important on the main screen. Also look into the idea of summarization items I’ve described in my posting linked above! Enjoy building your sitemap!

Thank you for your hins. With you info I can create it like I needed. Thank you.

best regards,
Rene

Hi all,
I’m a newbie and created already my first sitemap, but could not create a hierarchy as in the demo sitemap in the Android app.

Originally I had 3 floors and an outside area but recuced it to 2 floors for keeping it simple for tests.
I wanted a nested hierarchy where I first can click on the floor and then get the rooms shown. Then click on a room and get the items like switches, rollershutter shown.

My sitemap file:
sitemap test label=“test” {
Frame label=“Outside” icon=“garden” {
Group item=OU_FrontYard
Group item=OU_Patio
}

Frame label="Cellar" icon="cellar" {
    Group item=C_Hallway
    Group item=C_LaundryRoom
    Group item=C_Office
    Group item=C_Toilet
    Group item=C_Shed
}

Frame label="Ground Floor" icon="groundfloor" {
    Group item=GF_Wardrobe 
    Group item=GF_Corridor
    Group item=GF_Dining
    Group item=GF_GuestRoom
    Group item=GF_Kitchen
    Group item=GF_LivingRoom
    Group item=GF_Office
    Group item=GF_Patio
}

Frame {
    Text label="Licht" icon="light" {
        Default item=C_Hallway_Light label="Corridor"
        Default item=C_LaundryRoom_Light label="Laundry"
        Default item=C_Toilet_Light label="Toilet"

    }

}

}

My items file:

Group           Home                    "test"              <house>                                        ["Building"]

Group           OU                      "Outside"           <garden>           (Home)                      ["Outdoor"]
Group           C                       "Cellar"            <cellar>           (Home)                      ["Basement"]
Group           GF                      "Ground Floor"      <groundfloor>      (Home)                      ["GroundFloor"]


Group           OU_FrontYard            "Front Yard"        <lawnmower>        (Home, OU)                  ["Garden"]
Group           OU_Patio                "Patio"             <terrace>          (Home, OU)                  ["Outside"]
Group           C_Hallway               "Corridor"          <corridor>         (Home, C)                   ["Corridor"]
Group           C_LaundryRoom           "Laundry"           <washingmachine>   (Home, C)                   ["Room"]
Group           C_Office                "Office"            <office>           (Home, C)                   ["Room"]
Group           C_Toilet                "Toilet"            <toilet>           (Home, C)                   ["Bathroom"]
Group           C_Shed                  "Shed"              <greenhouse>       (Home, C)                   ["Garage"]
Group           GF_Wardrobe             "Wardrobe"          <wardrobe>         (Home, GF)                  ["Wardrobe"]
Group           GF_Corridor             "Corridor"          <corridor>         (Home, GF)                  ["Corridor"]
Group           GF_Dining               "Dining"                               (Home, GF)                  ["Room"]
Group           GF_GuestRoom            "Guests"            <parents_4_3>      (Home, GF)                  ["Room"]
Group           GF_Kitchen              "Kitchen"           <kitchen>          (Home, GF)                  ["Kitchen"]
Group           GF_LivingRoom           "Living Room"       <sofa>             (Home, GF)                  ["LivingRoom"]
Group           GF_Office               "Office"            <office>           (Home, GF)                  ["Room"]
Group           GF_Patio                "Patio"             <terrace>          (Home, GF)                  ["Outside"]


Switch          C_Hallway_Light         "Light"             <light>            (C_Hallway, gLight)         ["Lighting", "Switchable"]         {channel=""}
Switch          C_LaundryRoom_Light     "Light"             <light>            (C_LaundryRoom, gLight)     ["Lighting", "Switchable"]         {channel=""}
Switch          C_Toilet_Light          "Light"             <light>            (C_Toilet, gLight)          ["Lighting", "Switchable"]         {channel=""}
Switch          C_Toilet_Motion         "Motion"            <motion>           (C_Toilet, gMotion)         ["MotionDetector", "Switchable"]   {channel=""}
Switch          GF_GuestRoom_Light      "Light"             <light>            (GF_GuestRoom, gLight)      ["Lighting", "Switchable"]         {channel=""}
Rollershutter   GF_GuestRoom_Shutter    "Shutter"           <rollershutter>    (GF_GuestRoom, gShutter)    ["Rollershutter"]                  {channel=""}
Contact         GF_GuestRoom_Window     "Window"            <window>           (GF_GuestRoom, gWindow)     ["Window"]                         {channel=""}
Switch          GF_Kitchen_Light        "Licht"             <light>            (GF_Kitchen, gLight)        ["Lighting", "Switchable"]         {channel=""}
Switch          GF_Kitchen_Motion       "Motion"            <motion>           (GF_Kitchen, gMotion)       ["MotionDetector", "Switchable"]   {channel=""}
Switch          GF_Kitchen_Fan          "Fan"               <fan_ceiling>      (GF_Kitchen, gFan)          ["Switchable"]                     {channel=""}
Switch          GF_LivingRoom_Light     "Light"             <light>            (GF_LivingRoom, gLight)     ["Lighting", "Switchable"]         {channel=""}
Contact         GF_LivingRoom_Window    "Window"            <window>           (GF_LivingRoom, gWindow)    ["Window"]                         {channel=""}
Contact         GF_LivingRoom_Door      "Door"              <door>             (GF_LivingRoom, gDoor)      ["Door"]                           {channel=""}
Rollershutter   GF_LivingRoom_Shutter   "Shutter"           <rollershutter>    (GF_LivingRoom, gShutter)   ["Rollershutter"]                  {channel=""}
Number          GF_LivingRoom_Heating   "Heating"           <heating>          (GF_LivingRoom, gHeating)   ["HVAC"]                           {channel=""}
Switch          GF_Office_Light         "Light"             <light>            (GF_Office, gLight)         ["Lighting", "Switchable"]         {channel=""}

Group:Switch:OR(ON, OFF)           gLight     "Light"       <light>           (Home)   ["Lighting", "Switchable"]
Group:Switch:OR(ON, OFF)           gMotion    "Motion"      <motion>          (Home)   ["MotionDetector", "Switchable"]
Group:Rollershutter:OR(UP, DOWN)   gShutter   "Shutter"     <rollershutter>   (Home)   ["Rollershutter"]
Group:Contact:OR(OPEN, CLOSED)     gWindow    "Window"      <window>          (Home)   ["Window"]
Group:Switch:OR(ON, OFF)           gFan       "Fan"         <fan_ceiling>     (Home)   ["Switchable"]
Group:Contact:OR(OPEN, CLOSED)     gDoor      "Door"        <door>            (Home)   ["Door"]
Group:Number:AVG                   gHeating   "Heating"     <heating>         (Home)   ["HVAC"]

But Paper-UI (and my Android app) show only a header for each floor and then a 2 column list of all rooms.

I tried to apply the example of Udo_Hartmann where he builds a sitemap with Text items and got this sitemap file:

sitemap test label="test" {
    Frame label="Outside" icon="garden" {
        Group item=OU_FrontYard
        Group item=OU_Patio
    }

    Frame label="Cellar" {
        Group item=C_Hallway {
            Default item=C_Hallway_Light label="Corridor"
        }
        Group item=C_LaundryRoom {
            Default item=C_LaundryRoom_Light label="Laundry"
        }
        Group item=C_Office
        
        Group item=C_Toilet {
            Default item=C_Toilet_Light label="Toilet"
        }   
        Group item=C_Shed
    }

    

    Frame label="Ground Floor" icon="groundfloor" {
        Group item=GF_Wardrobe 
        Group item=GF_Corridor
        Group item=GF_Dining
        Group item=GF_GuestRoom
        Group item=GF_Kitchen
        Group item=GF_LivingRoom
        Group item=GF_Office
        Group item=GF_Patio 
    }
    
}

But the floors are still not expandable :frowning:

Any hints where I did the error ? Unfortunately I can not investigate in the demo files of the app.

1 Like

Thats because you dont use Udo´s example… You dont have the Text under the Frame.

Frame label="Demo" {
        Text item=Multimedia_1 label="Multimedia" icon="video" {
            Slider item=Volume_1
        }
        Text item=Multimedia_2 label="Multimedia" icon="video" {
            Slider item=Volume_2
        }
    }
1 Like

When you add a Group widget with no curly braces, you get a clickable line that will open a subpage with all group members as default widgets.

When you add a sub-section to a Group widget with curly braces { }, you choose not to have that behaviour. The line is still clickable but opens a subpage with only the elements you’ve specified in the braces.

You can create the same visual effect by using Text widget with or without any Group type Items

Text item=banana {
   Switch item=elephant
   Slider item=tiger
}
1 Like

Got it (partially)!
I thought that entering text instead of group items is not what I need

Made from:

    Frame label="Cellar" {
	Group item=C_Hallway {
		Default item=C_Hallway_Light label="Corridor"
	}
	Group item=C_LaundryRoom {
		Default item=C_LaundryRoom_Light label="Laundry"
	}
	Group item=C_Office
	
	Group item=C_Toilet {
		Default item=C_Toilet_Light label="Toilet"
	}   
	Group item=C_Shed
}

the following:

Frame label="Cellar" {
Text item=Cellar {
	Group item=C_Hallway 
	Group item=C_LaundryRoom
	Group item=C_Office
	Group item=C_Toilet
	Group item=C_Shed
}
}

Now I have the nested hierarchy…
With a header that is named like the floor (e.g. Cellar) and that I can hide by not entering a title, underneath on the next line an image like a text page at the beginning, followed by a text item that I could name like I want (e.g. Rooms) and after clicking come the rooms there the rooms.

But to get the hierarchy like in the Demo Example, I followed the instructions on the German page First Steps/Erste Schritte