I created an own icon for a wind rose with red arrow for direction.
Saved files as
windrose.png
windrose-0.png
windrose-22.png
windrose-45.png
…
Until
windrose-360.png
As shown in screenshot dynamic item only works for degrees until 100. the degrees over 100 (next would be windrose-112.png) Fall back to windrose without arrow: windrose.png
Could it be openhab only supports dynamic from 0 to 100?
It’s not a bug. So far as I know, there is no current intention to support numeric dynamic icons beyond range 0-100.
You can have unlimited icons using alpha suffixes. I wonder if you can workaround by displaying String item with a text value of “220” or whatever?
Doing it that way, you would not get the numeric magic feature of finding the “next lowest” icon, e.g. value 22 finds icon-20.svg Alpha suffix would need to be exact match.
Most people with compass displays seem to use strings “NNW” etc.
How to use that with dynamic icons?
I uses @vzorglub windrose script which report with compass displays. But I cant figure how to use these for dynamic icon like JensH is trying.
What do you start out with? Your Item has a string state of e.g. “NNW” ?
You’d make a set of items like rose-nnw.svg, rose-n.svg, rose-nw.svg etc.(note lowercase only - you must also have a default rose.svg)
It’s in the docs
Ahh just ignore my stupid question… Suddenly I had a thought that it was only possible to use numbers for dynamic icons… Makes no sense, since I have custom made icons using on/off as well… Guess it was a temporary brain damage
Got to add a new comment on this anyway… I´ve ran into a strange issue with dynamic icons…
Last night I created 35 icons to make it dynamic for openweather wind direction… I have made dynamic icons before… But either I´m becoming totally blind, or there is a issue with dynamic icons in openhab 2.5M1 build 1575.
Problem is - I cant get it to work. BasicUI reads the default (new) icon allright, but all icons with suffics doesnt show… I tried both using Windrose.js as well as creating a scale. None of it works…
Strange thing though… First I created a few icons just to test. It was working fine. Then suddenly it didnt anymore. And I have no idea why… Either something is wrong, or I made an mistake I simply cant see.
So I guess I need some fresh eyes on this:
Here is a screendump of the sitemap (BasicUI) with the icon involved (red circle):
Something is messed up though, cause I now get a strange error in another sitemap (not the one involved with the icons). Will post this other issue in a new thread.
Dynamic icons work in general, but there are simple rules (like the non-obvious default icon requirement). There are many places a mess up can linger - browser cache, apache, blah. It will come out in the end if you’ve got everything right now
Thats it, I believe I got everything right… It´s not a cache issue… Just tried from my phone as well as a tablet… I´ve ran out of ideas… This is really frustrating.