Icon Animations - Transformation

Hey guys,

i like to use some of the builtin Icons in Paperui with animation (like Switch). Works actually fine, but they appear to not work if the value (KNX) is not “ON / OFF” but like “OPEN / CLOSED”.

I try to transform that with a MAP-File, but that only affects the Label on Sitemap.

How can i get the Icon-Animation running exactly, if the values doesnt match the icon-animation-expectation?

thanks

A virtual switch driven by rules? Just display the virtual switch.

that means im not using transform in a wrong way - its not possible that way and i HAVE TO use virtual switch stuff?

I have not added any transforms so I do not know the answer. Perhaps @rlkoshak knows.

See https://www.openhab.org/docs/configuration/items.html#dynamic-icons, you need to make copies of the icons with “open” and “closed” appended to the name instead of “on” and “off”.

2 Likes

Do i find somewhere the original files to copy and rename? my icons/classic - folder is empty?

I found the icons on github, but are they also locally stored somewhere?

What didnt work: copy switch-icons and rename them to “switch-closed” and “switch-open”. It will usually take the standard-icon which is the “closed-look” so the red one

What didnt work either: copy switch-icons and rename to “switch_oc-closed” and “switch_oc-open”.

What did work: copy switch-icons and rename to something else like “switchoc-closed” and “switchoc_open”

Don’t forget, for any custom icon set you must always have a default icon even if you do not expect to see it.
There must be a “switchoc” to go with “switchoc-closed” and “switchoc-open”

Yes, the standard icons are combined into one big file somewhere. You only need to put your custom icins in that folder.

thx. i think the problem was the “_” in the name. If i use “switchoc” (as well as “switchoc-open” and “…-closed” it works. If i use switch_oc it doesnt.

Is there any way of updating the mapping i did before (transform / map) to get open to on and closed to off?
Because i removed the map at item and sitemap but it still shows the “OFF” Text at basicui (browser and apps).

How does your Item look like ? How is it in the Sitemap ? And how does your .map File looks ?

The thing is, i removed (!) all mapping-stuff but still it shows it in the UI

ITEM
Contact i_1_1_41_Status_Regensensor_Heizung { channel=“knx:device:bridge:Regensensor:t_1_1_41_Status_Regensensor_Heizung”}

SITEMAP
Text item=i_1_1_41_Status_Regensensor_Heizung label=“Betrieb Heizung Regensensor” icon=switchoc

MAPPING-File (Open Closed mapping to On Off) - purpose was to get the original icon running even if the status is Open or Closed
CLOSED=OFF
OPEN=ON
NULL=undefiniert

Also it looks like that any custom-icons are only shown if using a pc with a browser. In iOS-App it doesnt show any icon instead of the custom ones. Is that correct? Any option to get custom icons running in mobile apps?

Shows what “it” ? It’s not clear what you have got and what you expect.

Contact Items have states of OPEN or CLOSED. You can’t change that, that’s what they do.

You can use a MAP in an Item’s label to change the displayed text into “banana” and “custard” if you like. It only changes the text displayed, the Item state is still OPEN/CLOSED.

Dynamic icons are selected by raw state, not transform. someicon-closed still applies if you use a text transform to “banana”.

You must always have a default version of an icon, with no hyphen part. Always.
someicon.svg
someicon-closed.svg
someicon-open.svg

Some browsers and apps use .png format icons, some use .svg format icons. You may need to look further into that if you use different UIs.
There are defaults that you can select for BasicUI. Older IoS apps only use .png if I recall correctly.

oh sorry,

i mean that on sitemap i see the icon, my label and then the Text “OFF” instead of NOTHING (i mean nothing, like void, empty space).
Usually you dont see any text besides your label - only if i use MAP, an additional text will appear (at least in this case as it is a Contact-Item - for a Switch it would just change the switch - where i click to turn on/off from an icon to a text)

You want to suppress the value text? Put an empty format [] in your Item label, or in your sitemap widget label if you override the Item label.

Text item=i_1_1_41_Status_Regensensor_Heizung label=“Betrieb Heizung Regensensor []” icon=switchoc

Perfect, thanks

Why i had to put empty format in after using map / transform and remove that stuff again?

Sorry for late reply, but I was outside the house 'til now.
As I can see rossko57 already answered to all your questions, and I can confirm that the IOS-App doesn’t show “self-made” SVG-Icons.

Thanks, but infact it seems to work. But the ios app had PNG by default and i just copied a SVG Custom icon. After changing setting to svg the ios app displays my custom icon.

1 Like

I understand that i need to have a format to show a format. I am just wondering why the item didnt show any format first (so just “blabla”) - which is totally normal afaik,
then i added mapping and it showed “blabla OFF” or “blabla ON” and then
i removed mapping again but it still showed “blabla OFF” and “blabla ON” instead of just “blabla”.

Is that understandable? :slight_smile:

Thx for this information. I now changed it in IOS-App too and everythings ok for me now too.

Cheers,
Peter

There are caches in play at both ends of the service.