Nothing should have changed about the way you can choose an icon in the items file. What is wrong with the <humidity>
setting?
The icon doesn’t change according to the value of the humidity. The same goes for the light switches in the openhab android app, they remain off regardless of the state of the switch.
I’ll need some time to verify and analyze this. May I ask you to enter an issue at https://github.com/openhab/openhab2/issues for further tracking? Thanks!
I am seeing strange icon behavior as well. Some of the icons are giving 404s on both the mobile app and Classic UI. When I go to the actual URL being requested, I see the path is /icon/xyz.png but the folder on the system is icons/xyz.png note the plural difference.
Let’s take battery.png as an example. battery.png exists in the icons folder, but when I specify in a items file the flag, it does not get served, and is instead a 404. This makes sense if the path were all that was going on. There seems to be more though. The application is finding things requested at /icon even though that folder does not exist in the installed system. This folder must then be part of the app/jar file tree, and contain a subset of the icons in the icons system folder.
I have not looked very deep in the source code, but did find this comment in the IconForwarder:
- This servlet answers requests to /images (which was the openHAB 1 location for icons)
- with HTTP 301 (permanently moved) with the new location /icon
ClassicIconProvider says:
- This icon provider provides the classic icons (dating from openHAB 1). They are packaged
- within this bundle and served from there.
with:
URL iconResource = context.getBundle().getEntry(“icons” + File.separator + resourceName);
@Kai can you shed a little light?
I may be barking up the wrong tree. I seem to be comparing classicUI using png to other UIs using .svg
/icon/humidity?state=79&format=svg
is how it is displayed in the new BasicUI
/icon/humidity.png
is how it is displayed in ClassicUI.
These two images are different though, even when displaying the same value. One picture has a water droplet on it. It seems strange to me that they would be different… I am not using any custom icon sets. Should these not be the same image? If they are different, could this be part of the problem @frankose is seeing?
(edited for clarity)
It is clear that they are different. If you want the same image, you should try
/icon/humidity?state=79&format=svg
/icon/humidity-79.png
and
/icon/humidity?format=svg
/icon/humidity.png
Then you will have identical results, because the requests are asking for the same (either with a given state 79 or for the fallback icon).
since that link is not valid anymore I tried to find again all avaiable icons
I can use for BASIC UI.
Anybody a hint?
well sorry gotta ask one more question in this thread
there are many icons that differ from OH1 to OH2
e.g.
bedroom oh1
bedroom oh2
sind in both cases its icon=“bedroom” … how can I have the oh1 style?
many icons look better there
You could come up with a contribution for an alternative iconset, which can be made available as a bundle (see https://github.com/kaikreuzer/openhab-core/tree/master/bundles/org.openhab.ui.iconset.classic).
Is there a way to stop openhab from requesting a state as part of the Get of the icon?
For example:
I have an icon EcoBeeTemp - the state of it changes based on the value.
I don’t care for the icon to change each time. I just want it to request EcoBeeTemp.svg
http://192.168.1.241/icon/EcoBeeTemp?state=73.3&format=svg1
When i trace it in the browser i see:
The query string goes out with the following parameters:
state=73.3
format=svg
My item is defined as follows:
Number remoteSensors_EcoBee_capability_temperature (gRemoteSensors) { ecobee="<[xxxxxxxxx#remoteSensors(EcoBee).capability(temperature).value]" }
There is lessthan EcoBeeTemp greaterthan in there after temperature but it gets cut out when i post it here in brackets
Use the </>
button to format your item, then it should work.
Or try the "“openHAB *items code fences”.
</>
button: <code goes here>
item fences:
<code goes here>
indent preformatted text by 4 spaces Number remoteSensors_ecobee_capability_temperature <EcoBeeTemp> (gRemoteSensors){ ecobee="<[xxxxxxxxxx#remoteSensors(ecobee).capability(temperature).value]" }
Hello Kai,
is there an updated link - this runs in 404-error (page not found).
Thanks Georg
I added some new icons for the Astro Binding into openhab/conf/icons/classic. They are SVG files and the are dynamic name-state.svg and everything works fine on the webview with the Basic Ui but the Android mobile app, does not show the icons. They are 256x256 pixels and not 32x32 … Can this be the reason or is something else wrong?
Ok, I just found this topic: SVG icons in the android app
Digging there …
EDIT: Digging successful. I have documented my solution how to display SVG icons in the Android app in the topic above. Check out my post in that thread if you have a similar problem.
I think the current link for these icons is https://www.openhab.org/docs/configuration/iconsets/classic/
Is there a link for the svg icons too?