I should open a new topic for my question. I am missing the syntax for a call with an ItemValue which no must be formatted. Tried a lot, it has to be something like that?
Thx for your reply.
But how you would use it?
The Icons are named
Icon batterylevel-100, batterylevel-90 and so on until batterylevel-0
I can’t use notation with state:
-<battery_item>
because it does not return batterylevel-100, it reteurns batterylevel-100**.0** witch is not usable with the batterylevel icon.
I have to clear out the .0
Therefore i thought about the |number:0 but its not working like that?
How would you solve it?
I realy tried all Variation, but i don’t habe any HTML/CSS or Javascript Skills, therefore i just can make a guess
Thx Kim_Andersen
But i don’t have the Item in the .items Folder, i made it with PaperUI
I think i have do it in the HAPPanel Widget… somehow
icon="'battery'"-"battery_item [%.0f %%]" size="25" /></span></div> n
Is it possible to have the PaperUI Items and some Files in the .Items Folder without Problems?
For some Stuff the PaperUI is very easy an useful but to made a lot of items of the same type it would be much faster do use a Items File. But i have read that it isn’t a good idea to mix them, how do you handle it?
You can do it in PaperUI as well… Just cant remember how. I think its the label as well. Give it a try.
You can use PaperUI as well as items files at the same time.
Why it´s no recommended is due to the bad overview… Having tons of items there is no easy way to spot if its a PaperUI or a manual created items. Thats why the recommendation is, either use PaperUI or manual items files.
i try it, but id didn’t work, are u sure that the option is possible?
maybe i did it wrong but it think the Dimension Drop-down menu is for that
But it don’t allow to add some own definition.
Its just a small thing, but its such a pain in the ***!
I can not believe that there is no solution with the item created with PaperUI
he Binding is correct, the Things and Items are correct, just the value isn’t in the right format for dynamic icon… I surely not the only one with this Problem, but i can’t write it right down, that somebody can help me…
Dynamic Icons work fine with numeric Item states, decimal places or not.
If you have images like -20,-40,-60 a value 55.25 will produce image 40
You do have to follow the rules, for example there must be a batterylevel.png (or svg) default, even if you don’t expect to use it, or it all doesn’t work.
Your problem is about using HABpanel, I can’t help with that.
Out of despair I tried another icon with 0-100 scaling (sound volume) with the same item as before and lo and behold, it works! This means that something is wrong with the Battery icon and Battery-level icon.
Therefore, no one could help me.
The display works perfectly with the sound icon and my code … so it should also work with the battery icon.
fif anyone has any ideas, I would be glad.
But think it’s really not my code … or does someone disagree?
I thank you all for the support… really great this forum. Will improve my skills and hope to help other users (in the future). If only 1st level support
Create a small sitemap and test it… If it works using basicUI, then it should work with happanel as well. If not, there iare some issue og setup in habpanel which is wrong somewhere.
I always use BasicUI (sitemap) to test my stuff, even dynamic icons. Its a bit doubble work ofcouse, but it can be worth.
I suppose you might check the filename.
I don’t see any Batterybattery_itemBattery-level or batterylevel icons in the default set, and now you’ve told us you’re not using a custom icon set. https://docs.openhab.org/v2.1/addons/iconsets/classic/readme.html
Hover for image names
Is this how it usually works in HABpanel? Seems odd. In other UIs you just give the root filename for iconset e.g. battery, and its the iconpicker at OH that supplies battery-20.png instead.