Can't get icons to represent state

Hi!

I can’t get custom Icon to change depending on state.

This is what I have:

washers_states.map

0=Off
1=Idle
2=Active
3=Complete

Items

Number DishWasherState                "State is [MAP(washers_states.map):%s]"  <dishwasher> (gInitializeZero,gRestore)

Sitemap

 Text item=DishWasherState label="Dishwasher"

Files in /etc/openhab2/icons/classic:

-rw-r--r-- 1 openhab openhab 637 Dec 15 11:01 dishwasher-0.png
-rw-r--r-- 1 openhab openhab 637 Dec 15 11:01 dishwasher-1.png
-rw-r--r-- 1 openhab openhab 637 Dec 15 11:01 dishwasher-2.png
-rw-r--r-- 1 openhab openhab 663 Dec 15 11:01 dishwasher-3.png
-rw-r--r-- 1 openhab openhab 637 Dec 15 11:30 dishwasher.png

Result is the dishwasher.png no matter what the state is.
Feels like I have missed something simple? It should work right?

Regards, S

In Basic UI, the icons must match the mapped state, not the raw state. In other words you need:

  • dishwasher-off
  • dishwasher-idle
    and so on.
1 Like

Thanks Rich! Spot on.
(Tried with upper case letters, which didn’t work)

Regards, S