When using a oh-slider widget in Main UI, there is an implicit assumption that the slider moves from low to high from left to right. This makes sense most of the time, but in some cases a binding provides inverted logic.
Take for instance the white spectrum light bulbs from IKEA. The item state moves from 0% (cool white ~ 4000 K) over 50% (warm white ~ 2700 K) to 100% (warm glow ~ 2200 K). So the color temperature decreases as the item state increases.
In a widget, you would see the color temperature decrease from 4000 K to 2200 K as you move the slider from the left (item.state = 0) to the right (item.state = 100).
In an attempt to explore the possibilities I tried setting min to 100 and max to 0 but this effectively blocks the slider at the 100 mark.
For some bindings I know there's a binding/channel-level inverted property (e.g., for Z-Wave blinds), but sometimes you may want both slider directions supported on the same channel, albeit in different widgets.
Your suggestion
I would suggest either one of the following options:
add an inverted property (type: BOOLEAN) to invert the slider logic when set to true (default: false);
invert the slider logic if max < min
add new 'sliderStartState' and 'sliderEndState' properties that would replace min and max (the slider direction would then be inferred from both parameter values)
Your environment
Currently running openHAB3.0.2 on RPi3B+ (openHABian)
Hi!
Sliders support the parameter vertical-reversed, though that only works for vertical sliders. Not sure why it's not available for horizontal sliders - guessing there's a reason.
The problem
When using a
oh-slider
widget in Main UI, there is an implicit assumption that the slider moves from low to high from left to right. This makes sense most of the time, but in some cases a binding provides inverted logic.Take for instance the white spectrum light bulbs from IKEA. The item state moves from 0% (cool white ~ 4000 K) over 50% (warm white ~ 2700 K) to 100% (warm glow ~ 2200 K). So the color temperature decreases as the item state increases.
In a widget, you would see the color temperature decrease from 4000 K to 2200 K as you move the slider from the left (item.state = 0) to the right (item.state = 100).
In an attempt to explore the possibilities I tried setting
min
to 100 andmax
to 0 but this effectively blocks the slider at the 100 mark.For some bindings I know there's a binding/channel-level
inverted
property (e.g., for Z-Wave blinds), but sometimes you may want both slider directions supported on the same channel, albeit in different widgets.Your suggestion
I would suggest either one of the following options:
inverted
property (type: BOOLEAN
) to invert the slider logic when set totrue
(default:false
);max
<min
min
andmax
(the slider direction would then be inferred from both parameter values)Your environment
Currently running openHAB3.0.2 on RPi3B+ (openHABian)
Additional information