Sitemap Icon - not shown correctly

Hi, i’m not sure if this is a limitation of OH or a bug or i’m doing something wrong…

I have a group where all zwave battery states are shown…so the icon of the group is a battery symbol. As battery only presents an empty icon it looks rather “invisible”…so my great idea was to take the “battery-80” icon which has more color and an easy step to take…

My line looks like this:

Group item=MyBattery label=“Battery State” icon=“battery-80”

BUT…nothing changed.

Any idea what the reason can be. Is it not possible - cannot believe. Thanks if someone knows what I did wrong here…
(btw, its Openhab 2.1)

Define your group like

Group:Number:AVG gBattery <battery>

and you will have a group battery symbol representing the average of all group members.

Edit:
corresponding sitemap entry:

Group item=gBattery label="Batteriestatus [%d %%]"

1 Like

WOW, thanks first of all for this valuable input. Seriously, today i was thinking about something similar :slight_smile:
but had no idea how do get started.

I would rather prefer to have the minimum-batt_stat to be represented…of e.g., three items are in the group and the lowest has 10%…it should show the 10%…so to always see how the worst battery driven item is performing.
My guess - it works with something like: Group:Number:MIN gBattery (???)

And finally, any idea why the other “code” does not work as expected with the 80% icon.

Regards Norbert

Openhab Docs help :slight_smile:
http://docs.openhab.org/configuration/items.html#groups

Maybe you have an answer for this final question:
---- And finally, any idea why the other “code” does not work as expected with the 80% icon.

hm - strange…

I now did as follows:
Group:Number:MIN MyBattery (All)

in the group there are:

image

with the same result in icon:
image

Anything special i need to setup in the sitemap?

almost there, forgot to put the value in the label…

BUT still the icon is not shown correct…

image

The hyphen - in an icon filename has special meaning, i.e. for selection as in battery-80 , battery-100 etc.
So don’t use the special character when defining the default iconfile in an Item definition.
Take a copy of the image you want, call it say batteryspecial.png or whatever, and use that iconfile instead as a custom icon.

You might need to clear the cache of your browser as well or restart OpenHAB. With groups it’s sometimes a bit weird, but also on my Mac I must clear the Safari cache when changing icons to see the result immediately. A simple refresh of the page is not enough. :roll_eyes:

P.S.: What is the “web radio” in your sitemap and how does it work? :wink:

@ Antares…you are correct!!! I also did restart openhab completely and after an hour (as the batt states came in) now it all is updated as it should and shown correctly in terms of icon. I guess also the “battery-80” would have worked if i had restarted/cleared the cache…good to know!!!

@rossko57…I understand what you mean in terms of organization to not “dirty” make use of icons that are part of a defined group. But even if i’m not the developer here - its a simple image file, so if directly addressed it should not be any kind of problem for Openhab. Right?

I don’t know. The hyphen in filename has a special meaning.

In order for it to “work” as you wanted, the code in Openhab’s client and the code in all the various UIs that creates the target icon filename (e,g by adding “-80” to a stem filename) would all have to handle it in the same way.

As coping with a hyphen inside a default icon filename is essentially an exception, I would not expect consistency. The problem is that it is not directly addressed, the code makes up the target filename using the Item’s state.

Regarding the Webradio…

Nice gadget - using a RaspberryPi2 with OpenWRT (in order to not crash SD cards all the time via Raspian) and MPD…via MPD client i simply control the channel and whatever you want that is supported by MPD client.

Is there a solution for this issue?

I’m using the material icons set for OpenHAB and actually I don’t want to change the names so they are compatible with the original framework…

thx,
Dave