Frame icon="icon" possible?

The documentation seems to convey that you can do something like this…

sitemap default label="Main Menu"
{
	Frame label="Master Bedroom" icon="garage" {
        

where you can set the icon (and item) for the Frame. I don’t think this is possible, although it would be cool. I think the documentation means to say

sitemap default label="Main Menu"
{
	Frame label="Master Bedroom" {
		Switch item=MBedroomLight icon="set icon here"
	}

I know for sure it is possible to supply the icon and label for a Frame just as your example provides.

The documentation indicates that it is also possible to supply an Item and the Frame will use the Item’s label and icon instead.

This has been supported for a long time, including OH 1.x.

Alright. Why doesn’t is work for me!

	Frame label="Garage" icon="garage" {
		Text label="Garage" icon="garage" {
			Text item=GTemperature
			Text item=GHumidity
			Text item=GDoor

It appears to be mostly working for you. The only thing I see missing is the icon for the frame.

Do you really mean to do the following?

Frame label="Garage" {
    Text item=GTemperature
    Text item=GHumidity
    Text item=GDoor
}

Or do you mean this?

Text label="Garage" icon="garage" {
    Frame label="Garage" icon="garage" {
        Text item=GTemperature
        Text item=GHumidity
        Text item=GDoor
    }
}

A Frame just wraps the stuff in { } in a white box. The Text element followed by a { creates a subpage for the stuff in { }.

At the moment the ONLY thing I see working differently from expected is the lack of the icon for the Frame, which may be something BasicUI doesn’t support.

Yeah, everything works except for the Frame icon. I do then use Frame/Text and not Text/Frame purposely, although as my config evolves that changes.

I’ve tried it on Firefox and IE, Classic and Basic. None work.

You need to use a Text label for the main label, and then frames inside.

e.g.

sitemap home label="Home"
{
////Lighting
	Text label="Lights" icon="light_control"{
		Switch item=Lights mappings=[OFF="All Off"]
		Group item=LightsLiving
}

Then from the Home sitemap, you’ll see a frame labelled Lights, with the light_control icon. Entering into this frame will not bring the light_control icon into the head of this page, but will show you the Switch and Group items nested into the Text label.

Clear as mud?

That’s (kind of) a way to get it to work, I get that. But there is a difference between a Text element pointing to more elements and a Frame which can hold more than one element, all of which could point to more.

A text element as the top level element can hold as many items as you want. Whether those elements are Frames or Items doesn’t matter.

Another example from my home sitemap:

sitemap home label="Home"
{
////Bedroom 3
    Text label="Spare Bedroom" icon="bed"{
        Frame label="Lights" {
                Slider item=Light_Bed3
        }
        Frame label="Heating"{
                Switch item=Heating_Bed3
        }
        Frame label="Environment" {
                Text item=sensor_Bed3Temp
                Text item=sensor_Bed3Humidity
                }
        }
}

I’m seeing a bunch of these in the logs…

Cannot get service reference for transformation service of type MMAP
couldn't transform value in label because transformationService of type 'MMAP' is unavailable
Cannot get service reference for transformation service of type MMAP
couldn't transform value in label because transformationService of type 'MMAP' is unavailable

You have a mapping which is spelled wrong. MMAP is not MAP.

Unfortunately there are two ways that a Frame has been referenced in other threads, one of which isn’t technically correct.

A Frame provides a way to visually group a bunch of Items on the sitemap together by making it look like all the Items are in the same white box.

What is sometimes called a sub-frame though I wish there were a better term for it, is when you use a Text Item with the { }. This creates the little “>” that you can click on and open a separate page which itself may contain one or more Frames. Inside these frames will be additional Items, including potentially another Text Item with {} to go another page deeper.

What I believe @awsnap is after is to have the white box with both a nice title AND an icon, not a sub-frame which opens up another page.

Unfortunately this doesn’t seem to work in BasicUI (the icon part).

1 Like

As in I have a line like “[MMAP(condition.map):%s]” ? I only call a map twice and they are both correct. It looks like you need to have text in front of MAP, “Text [MAP(map.map):%s]”

Ok, what DOES it work in, because I haven’t found it.

I may have to go the Text route to solve this. Does this mean that the documentation is wrong, or it just doesn’t work for me?

You can try it in ClassicUI and see if the Frame icon works there. I’ve never tried to use icons in a Frame so I don’t know.

I doubt the documentation is wrong. Either it works in ClassicUI, only works with OH 1.x, or there is bug which makes it no longer work which needs to be fixed.

I mentioned above that I tried in two browsers, two UIs, and iOS. I guess I’ll see if anyone else chimes in and if not, report it.

Yes but a Frame will keep them together on the same page, a Text will not.

EDIT For future readers:
Refer to @ThomDietrich 's response below regard MMAP bug.


Search your code for ‘mmap’ I suspect you have an Item labelled like so:

Switch    sensor_ShedPIR    "Shed [MAP(switch.mmap): %s]"

Which should read:

Switch    sensor_ShedPIR    "Shed [MAP(switch.map): %s]"

Nope. MAP seems to require preceding text.

This is an excerpt from my home sitemap with images to show how the icons work for me with Basic UI.

I set icon values in the items which are found in items files. If the sitemap which has a text label for a frame also needs an icon, then I set this icon on the sitemap. I believe this is the only way to do it as Frames and Items are not mutually inclusive.

sitemap home label="Home"
{
// Monitoring
    Frame label="Monitoring"{
////Presence
    Text label="Presence" icon="presence"{
        Frame label="Presence"{
            Switch item=present mappings=[ON="Occupied", OFF="Empty"] 
        }
        Frame label="People" {
            Text label="Paul Data" icon="man"{
                Frame label="Presence" {
                    Switch item=phone_Paul
                    Switch item=ownTracks_Paul
                }
                Frame label="Data" {
                    Text item=ownTracks_PaulLat
                    Text item=ownTracks_PaulLon
                    Text item=ownTracks_PaulAcc
                    Text item=ownTracks_PaulBatt
                }
                Frame label="Heating" {
                    Setpoint item=Heating_PaulSetpoint label="Heating Setpoint [%.1f °C]" minValue=18 maxValue=24 step=1
                }
            }
            Text label="Emily Data" icon="female"{
                Frame label="Presence" {
                    Switch item=phone_Emily
                    Switch item=ownTracks_Emily
                }
                Frame label="Data" {
                    Text item=ownTracks_EmilyLat
                    Text item=ownTracks_EmilyLon
                    Text item=ownTracks_EmilyAcc
                    Text item=ownTracks_EmilyBatt
                }
                Frame label="Heating" {
                    Setpoint item=Heating_EmilySetpoint label="Heating Setpoint [%.1f °C]" minValue=18 maxValue=24 step=1
                }
            }
            Frame label="Map"{
                Webview url="http://192.168.1.20:8080/static/map.html" height=11
            }
        }
        Frame label="Rooms" {
            Text item=Door_Front
            Text item=Door_Side
            Text item=sensor_DiningPIR
            Text item=sensor_HallPIR
            Text item=sensor_ShedPIR
            Text item=sensor_CarportPIR
            Text item=sensor_FrontDoorPIR
            Text item=camera_CarportMotion
            Text item=camera_FrontDoorMotion
        }
    }
}
}

Monitoring Frame visible on Home sitemap:

Presence frame within the Paul Data frame.

Paul Data frame visible within the Monitoring frame

2 Likes

So you’re of the mindset that the documentation is wrong?

I’d like to use this feature to provide just a little more info on the higher pages before diving deeper. Frame would show the condition icon for weather, then Text within Frame would show temperature PLUS lead you to a deeper page, ALL while allowing you to have two Text’s under that one Frame. It’s honestly not a gigantic deal, but the documentation SAYS it can do it AND @rlkoshak does too.

In OH2 I cannot get it to work as per the docs. So yes, I believe that you cannot set a Frame icon in OH2 and BasicUI. I’ve never thought this was possible to be honest, but never read the docs…

I always treated Frame labels like the chapter headings in a book. They don’t necessarily hold any relevant data, but point and direct the reader to the content within.

I can have:

Frame item=weatherDetailed  label="weather"

Which will populate the Frame with the value inside the Item weatherDetailed

So I agree that the frame Item and Label settings do work.

What you really want to do is not give the frames icons, but rather not use frames at all, and simply nest your items directly under the sitemap.