OH3 - Different dimmer range in main ui

I started migrating some dimmer items of shelly devices to OH3 and I noticed that the sliders have different dimmer ranges by default.

Dimmer  ShellyRGBW201_White  "White"  (ShellyRGBW201)  ["Control","Light"]  {widgetOrder="06", channel="shelly:shellyrgbw2-color:01:color#white"}
Dimmer  ShellyRGBW201_Gain   "Gain"   (ShellyRGBW201)  ["Control","Light"]  {widgetOrder="07", channel="shelly:shellyrgbw2-color:01:color#gain"}

Both of the shown ranges should be 0-100 but the white channel has a range of 0-255.
In the OH2 sitemaps, both items had a 0-100 range.

Is there a way to manually change the dimmer range in the main ui or the item config or is this depending on what information the item receives from the thing it’s connected to?

Yes on both counts. If the provided range is wrong you can override it with either the “stateDescription” or the “default standalone/list item/cell widget” (widget, listWidget, cell Widget namespaces) on the item.

I think the way to go would be overriding the stateDescription since this occurs in the automatically generated equipment / property tab and not in the custom pages.

However I’m not quite sure how to override the stateDescription. I only found some information about the stateDescription in the developer docs but nothing on how to do this with things / items configuration, if this could work that way at all and I don’t misinterpreted it.

Got it. I added the stateDescription in my textual config and now the main ui displays the correct dimmer range.

Dimmer  ShellyRGBW201_White  "White"  (ShellyRGBW201)  ["Control"] {widgetOrder="06", channel="shelly:shellyrgbw2-color:01:color#white", stateDescription=" "[ min=0, max=100 ]}
1 Like