Skip to content
This repository has been archived by the owner on May 7, 2020. It is now read-only.

Classic UI: custom icons depending on state are not working #1034

Closed
lolodomo opened this issue Feb 14, 2016 · 13 comments
Closed

Classic UI: custom icons depending on state are not working #1034

lolodomo opened this issue Feb 14, 2016 · 13 comments

Comments

@lolodomo
Copy link
Contributor

I defined an item of type Number:

Number WifiNetatmoInt "Wifi sonde Netatmo [%d / 4]" <wifi> (GNetatmo) {netatmo="xx:xx:xx:xx:xx:xx#WifiStatus"}

In the folder "conf/icons/classic", I put 5 files: wifi-1.png, wifi-2.png, wifi-3.png, wifi-4.png and wifi.png.
When my item is not yet set, the displayed icon is wifi.png, that's ok.
Then when my item value is set to 3 (for example), the expected result would be that classic UI displayed the icon wifi-3.png. In fact, it just displayed the icon wifi.png.
It seems that classic UI does not take into account the current state of the item to select the icon.
I tried to free my browser web cache to check if the icon is updated. Nothing.
I already tried to change my item like that but it changed nothing:

Number WifiNetatmoInt "Wifi sonde Netatmo [%d]" <wifi> (GNetatmo) {netatmo="xx:xx:xx:xx:xx:xx#WifiStatus"}

It is a bug only in OH 2.0, the same item is correctly displayed with the correct icon in OH 1.8.1.

@kaikreuzer
Copy link
Contributor

Could you give an example using the official demo setup, so that it is easy for others to reproduce?

@lolodomo
Copy link
Contributor Author

I have not used the demo setup since ages. Not obvious. It will probably require a change in items/sitemap except if the demo setup already use custom icons.

Note that the problem is identical in the Android application. It seems that you already identified this issue in the Android app: openhab/openhab-android#145

kaikreuzer added a commit that referenced this issue Mar 1, 2016
@maggu2810
Copy link
Contributor

Is it correct that this is solved by #1115?

@lolodomo
Copy link
Contributor Author

lolodomo commented Mar 5, 2016

@clinique: I can confirm that your PR fixed my issue with dynamic icons (tested in distro 172). But to work well, I absolutely need to define a file "wifi.png". If this file is missing, the icon is not displayed even when the value is set to a value corresponding to a PNG file present in the directory conf/icons/classic.
This "default" file was not required in openHAB 1.
If behaviour is considered as expected and not as an issue, that may be something to mention as differences between OH1 and OH2 in the documentation.

@kaikreuzer
Copy link
Contributor

If behaviour is considered as expected and not as an issue, that may be something to mention as differences between OH1 and OH2 in the documentation.

Yes, this is expected. Would be great if you could do a PR for updating the documentation!

@lolodomo
Copy link
Contributor Author

lolodomo commented Mar 5, 2016

@kaikreuzer : PR created openhab/openhab-distro#152
I don't want to document too much as my English is not really good :)

@lolodomo
Copy link
Contributor Author

lolodomo commented Mar 5, 2016

@kaikreuzer @clinique what is the folder for custom icons for Basic UI ?
con/icons/basic ?

@kaikreuzer
Copy link
Contributor

No, con/icons/classic. The classic does not refer to the ui, but to the icon set (https://www.eclipse.org/smarthome/documentation/features/ui/iconset/classic/readme.html).

@lolodomo
Copy link
Contributor Author

lolodomo commented Mar 5, 2016

@kaikreuzer @clinique in this case, unfortunately it does not work in Basic UI while it is now working in Classic UI (distro 172).
Do you want a new issue ?

@clinique
Copy link
Contributor

clinique commented Mar 7, 2016

@lolodomo : I think that Basic UI needs SVG format icons. Have you tested that ?

@lolodomo
Copy link
Contributor Author

lolodomo commented Mar 7, 2016

No I only tested with PNG files.
If SVG format is required for Basic UI, that is another point to mention in the migration documentation, if possible wirh a link to a free tool allowing PNG to SVG conversion.

@kaikreuzer
Copy link
Contributor

FTR: openhab/openhab-distro#152 (comment)

a free tool allowing PNG to SVG conversion.

This is technical simply not possible. You cannot meaningfully convert bitmaps into vector graphics.

@lolodomo
Copy link
Contributor Author

lolodomo commented Mar 7, 2016

Ok, after switching from SVG to PNG in Basic UI setup, it works almost as expected. Only icon refresh when page is opened is not working.

reitermarkus pushed a commit to reitermarkus/smarthome that referenced this issue Jun 7, 2016
Signed-off-by: Gaël L'hopital <glhopital@gmail.com>
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants