[SOLVED] Inconsistent switch display

I have defined a several switches some connected to MQTT, ZWave or virtual and I find they all display differently in the sitemap. Some have ON/OFF next to the switch, others don’t. Is there a reason for this?

Show your Item definitions.

Here are some of my items:

Switch Hallway_Light "Hallway Lights" <light> (Lights,Hallway) ["Lighting"] {channel="zwave:device:15a1034526a:node2:switch_binary2"}
Switch Outside_Light "Outside Light" <light> (Lights,Outside) ["Lighting"] {channel="zwave:device:15a1034526a:node2:switch_binary1"}
Switch Outside_LightOverride "Outside light override" <light> (Lights,Outside) { expire="1h,command=OFF"}
Switch	FF_Hall_Light	"Upstairs Hall Light" <light> (Lights,Hallway) ["Lighting"] { channel="mqtt:topic:mosquitto:sonoff6737:power" }
Switch	Family_Bathroom_Light	"Family Bathroom Light" <light> (Lights) ["Lighting"] { channel="mqtt:topic:mosquitto:sonoff5855:power" }
Switch	Bedroom1_Light	"Bedroom 1 Light"  <light> (Lights) ["Lighting"] {channel="mqtt:topic:mosquitto:sonoff5091:power" }
Switch	Utility_Light	"Utility Light"  <light> (Lights) ["Lighting"] {channel="mqtt:topic:mosquitto:sonoff5229:power" }

And part of the sitemap:

Switch item=Bedroom1_Light
Switch item=Family_Bathroom_Light
Switch item=FF_Hall_Light
Switch item=Hallway_Light
Switch item=Utility_Light
Switch item=Outside_LightOverride

In general, if you do want to display a text value you would add some formatting to the Item label
Switch Hallway_Light “Hallway Lights [%s]” …
where %s is for a string

Some bindings (zwave for example) now supply default strings for this purpose. If you don’t want those, I believe a null format [] can eliminate


Great thanks, I added [%s] to the items with missing state and they all display similar now.
It looks like the MQTT binding items default to displaying the state and virtual and zwave items default to not displaying state.

Thanks for the help