Define slider behavior

In openHAB two different behavior exist for sending updates:

  1. Send the update when the mouse click/finger touch is released.
  2. Send the update while the slider is still changed.

I tested these sliders:

  • Basic UI: Option 1
  • Config page of Dimmer items in Main UI: Option 2
  • Android app: Recently changed from 1 to 2
  • iOS app has a setting to set option 1 or 2 globally

Option 2 is good for things that can change quickly, e.g. brightness or volume, but not for rollershutters as they cannot move so fast. This option may also cause issues when too many updates are sent in a short time, e.g. here: Setpoint (Slider) could generate unpredictable intermediate value changes events · Issue #3241 · openhab/openhab-android · GitHub

IMO the behavior should be made configurable on per Item basis and all UIs should then respect this setting. Opinions on this?

That’s the default behavior but it can be overridden. The slider widget in MainUI has a releaseOnly option which when set to “true” will wait to send the command on release.

The widget that gets shown on the Config page for an Item is the default widget. If the default widget chosen by the system isn’t what you need, it can be overridden by setting the “default stand alone widget” Item metadata where an oh-slider-card can be chosen and the various properties set.

If this is a widget you want to reuse across multiple Items, the custom propertied can be defined in a custom widget and that applied to the Item as the default stand-alone widget.

I agree that is should be configurable on a per Item basis and MainUI already supports this. So I think all that’s missing is adding a property to sitemaps on the Slider element.

That’s what I think would make sense as well. I’m wondering what a good name would be, though. liveUpdate? updateWhileDragging?
I also wonder whether we shouldn’t, while we’re at it, remove the slightly confusing sendFrequency option, which some people see as related. I think ClassicUI is not a thing anymore, right?

Edit: oh, and BTW, just for completeness: the iOS app has a (global) option to toggle between 1 and 2.

Indeed, ClassicUI was retired with OH 2.

I suppose the name would be dictated by what the default behavior is. If it remains Option 1, than I’d choose liveUpdate for no other reason than it’s shorter. :wink:

If the default behavior changes to Option 2, I’d use the same name as MainUI uses: releaseOnly. Though I’m not recommending changing the default behavior. That would stir an ant nest for no good reason I think.

Too late, that already happened (in the Android app, that is). Technically the current behaviour is undefined/application defined though, which is what triggered this thread: defining a default behavior and an option to override it, which then can/should be implemented by all clients.

The oh-slider-card widget has an option to set the interval between updates:

value: ""
config:
  releaseOnly: false
  commandInterval: 300

Maybe we could use sendFrequency for this? Or add a new parameter commandInterval to the slider for consistent naming?

Poking @J-N-K @Flole @Lolodomo as they worked in Sitemaps recently.