Remove item state from a label?

How do you remove the item state from a label?
I have tried overriding the label to not have [] in the sitemap and the state is still appended to the end of my label.

Check your item definition for the [%s] in the item name

Thanks… if I remove the [] from the item definition then it seems to just pull from whatever is defined to the channel definition of the binding itself.

Is there no way in the sitemap to say that you don’t want state?

Either you have Simple Mode turned on in which case OH is defining the label for you, or you have a [%s] in the Item definition or the sitemap entry. The sitemap entry takes precedence.

Post your item definition and relevant sitemap entry.

Thanks for the help. I checked in paperUI and simple mode is not turned on.


Number Thermostats_Downstairs_System_Mode "System Mode" { channel="omnilink:thermostat:home:downstairs:system_mode" }


Selection item=Thermostats_Downstairs_System_Mode mappings=[0="Off",1="Heat",2="Cool",3="Auto",4="Emergency Heat"]

Rendered view has a [3] next to System Mode in the label:

I have also tried adding a label to the sitemap and it doesn’t change the outcome:

Selection label="System Mode" item=Thermostats_Downstairs_System_Mode mappings=[0="Off",1="Heat",2="Cool",3="Auto",4="Emergency Heat"]

Your other Selection sitemap Items appear to show the same behaviour. Maybe it is a UI issue. Try a simple text display as well of your suspect Item temporarily, just to show the removal of [] is working as you expected.

1 Like

I agree with rossko57, this appears to be something weird going on with the Selection. I’ve never used one so have no experience to say whether this is expected behavior, a regression, or something else.

The example in the docs does not show this behavior.

Does it only show the [3] in Habdroid or does it also show when you go to it in the browser?

The inconsistency with your UI is something I have experienced. You will have different outcomes in different UI’s (basic/classic, iOS, android). Unfortunately, the different UIs do not behave similarly with some items. I can point many other differences in UI behavior (eg: setpoint item being updated in basic/classic UI, but not in iOS without a refresh, etc.).
As @rlkoshak said, I think you will have a different outcome in the web browser compared to the HABdroid!

Best regards,

As predicted, in the basic UI I do not experience this behavior:

There were a couple of suggestions above, here are the combined results:

Selection item=Thermostats_Downstairs_System_Mode mappings=[0="Off",1="Heat",2="Cool",3="Auto",4="Emergency Heat"]
Text item=Thermostats_Downstairs_System_Mode label="System Mode"
Selection item=Thermostats_Downstairs_System_Mode label="foo []" mappings=[0="Off",1="Heat",2="Cool",3="Auto",4="Emergency Heat"]

It appears if I put [] in the label text it doesn’t do the state placement at the end…

Is this a defect in habdroid?

Yes. You should file an issue.