Changing pattern of stepper card

I’m currently migrate to OH3. First of all, I’m really excited, it’s a huge step forward!

Now I have a question regarding the stepper-card.
I have a number item that stores the time in minutes when the irrigation should start.

In the sitemap it looks like this:

Setpoint item=WateringAutomatic_Start label="Start der Bewässerung [JS(numberToClock.js):%s]" icon="myclock" minValue=0 maxValue=1425 step=2

image

I’ve tried the same in OH3:

How can I show the transformed string inside the stepper?

State description looks like this:

numberToClock.js:

(function(i) {
    var hours = Math.floor(i / 60);
    var minutes = i % 60;

    hours = (hours < 10) ? "0" + hours : hours;
    minutes = (minutes < 10) ? "0" + minutes : minutes;

    return hours + ":" + minutes + " Uhr";
})(input)

Javascript transformation is working, because when I use the label-card, it looks correct:

Thank you very much for your help!

1 Like

What’s the default standalone widget configuration?

Ah sorry, I forgot. It’s a simple stepper-card:

value: oh-stepper-card
config:
  step: 15
  min: 0
  max: 1425

Is there any option in UI form to change the label or something like that? I’ve never used a stepper card but I would expect there to be an option to set how the middle number is displayed. In that field you’d want to enter something like =items.MyItemName.displayState.

@Integer Did you even succeed? I need kind of the same approach

Unfortunately, this does not seem to work. I tried changing it to a f7-stepper and then I was able to modify values to displayState (although I used the option-field in the meta state descriptor, same effect though). However, then my buttons didn’t work anymore…

It would be great if this was supported.
I have the exact same issue.