The UoM of an Item was changed by the stepper

I’m beginner and I have a simple question:

I have define an Item as following:

Number:Time DurationTime "Laufzeit [%.0f min]"

Then I have a small widget like this:

uid: widget_XXXX
tags: []
    - context: item
      label: Bewässerungszeit
      name: BewaesserungszeitItem
      required: false
      type: TEXT
  parameterGroups: []
timestamp: Jul 3, 2023, 12:36:14 PM
component: f7-card
config: {}
    - component: oh-list
          - padding
          - component: oh-stepper-item
              autorepeat: true
              autorepeatDynamic: false
              color: blue
              icon: f7:timer
              item: =props.BewaesserungszeitItem
              max: 60
              min: 1
              raised: true
              round: true
              step: 1
              title: Bewässerungszeit (min)

Every change of the value with the help of th wizard, will update the item in command direction and override the UoM to seconds instead of minute.

How can I prevent this?

What is the state description pattern? That’s what really matters in MainUI. The label really only matters for sitemaps.

The pattern field should match the stuff between the [ ].

But no matter what the units are it really shouldn’t matter so long as you are not blindly throwing away the unit before using it (e.g. in a rule).

It’s not overriding the UoM so much as just using the default because no State Description pattern is defined.

Note, this will change somewhat in OH 4 where there will be a unit metadata that dictates the unit that the Item gets set to. So even if a widget or a rule or a Channel updates the Items to seconds, the seconds will always be converted to minutes i the unit is configured for minutes.

Hi Rich!

State description pattern - That was the solution!

I have add following pattern “%d min”, and now it works!