Dynamic icons Contact icons on a switch

Is it posible to get a dynamic icon door ect. (open/close) to response to a switch item on/off? My IHC controller has defined the door, window and lock contacts as switches rather than contacts. But i would like to show an “open door”-icon when the switch is off and a “closed door”-icon", when the switch is on.
I would prefer to use the inbuilt classic icons, rather than add more myself, as i think the visual part becomes very messy, when mixing up random stuff from the internet.

I got it working by adding my own “door”, “door-on”, “door-of” icons, but as i said - they do not look like the same design as the rest. So is there anyway to convert the open/closed signal on the classic icons to react to on/off?

Did you add the door icon from the classic icons or from elsewhere?
Can you give more detail or post a picture to describe how they look different?

If the icon is from other than classic see this post for how to use the classic icon’s to show door open and closed.

You can also try using the MAP transformation in your items file to change ON/OFF to OPEN/CLOSED. This might change the look to be similar to the rest?

Example

Switch Your_Item "Your Switch Item [MAP(door.map):%s]" <door>

door.map file

ON=OPEN
OFF=CLOSE

EDIT: If using MAP transformation be sure to add this via PaperUI > Addons > Transformations and create the door.map file in /etc/openhab2/transform (linux system)

1 Like