Question about item state in oh-slider-item

I’m experimenting with MainUI at the moment and trying to make nice controls for my lights. I suspect I will eventually create a personal widget, but I’m still playing with the basics to see what I can achieve.

If I add a slider card (oh-slider-card) then I can get a nice controller like this;


If I put this into a list using the oh-slider-item then I can get something like this;

The main difference on the slider is that it shows the item state at the right hand side of the slider. I can’t see any documentation for this. Can it be turned on or off? It’s actually quite useful. What I would ideally like is if it said ‘On’ when the state is 100, ‘Off’ when the state is 0, and ‘X%’ when the state is between 1 and 99.

Can oh-slider-item be configured like this? Also, can oh-slider-card display the item state in the same way?

In this case I think you can control how that number appears by setting the State Description Item metadata, though I don’t know if you can use an expression there. If you can’t do that, set the State Description to a space and then configure the after property with an expression to present the Item’s state as desired. See oh-slider-item - Slider List Item | openHAB for all the properties on the oh-slider-item widget. Note that you might have to do this by editing the YAML. Not all the possible properties are available in the UI forms.

You could do that with a JS transformation that evaluated state, returned On/Off strings for 0 and 100, returned Fault string or similar for NULL/UNDEF, and returned NN% string for any other numeric.