I have the following icons in my images folder.
television.png
television-on.png
television-off.png
I’m seeing switches show television.png when the switch is off and should therefore be television-off.png. Toggling the switch on and off will make it display the correct icon.
Some time later, it will repeat it’s self and the issue returns.
Is the Switch Undefined when it is displaying the wrong icon? For example, did you change a .item file or restart openHAB and do not have persistence with restoreOnStartup for that Item?
It should only be using the television.png when the Switch is undefined.
All Items have an Undefined state in addition to their “working” states. When the Item is first initialized it is set to Undefined. When persistence with restoreOnStartup is configured instead of initializing the Items to Uninitialized it will initialize them to whatever the last saved value in the database is.
When the Switch is Undefined, the sitemap will use television.png. When it is OFF it will use television-off.png. When it is on it will use television-on.png.
The switch element itself will show the Item as OFF or CLOSED for Switches and Contacts. For Numbers and Strings it will show as ‘-’. I’m not sure what it does for sliders and setpoints.