Slider trigger only when mouse up?

Hi folks,
First of all congratulations for this amazing community.
My name is Pedro and it’s the first time I’m here to ask you for a little tip.

Currently I’m using OpenHAB in a Raspberry Pi and that RPi as a MQTT broker.
I have a nodemcu with ESPEasy and currently I’m using a MOSFET to control a voltage flow trough a PWM signal sended to nodemcu using MQTT from a Dimmer item in OpenHAB.

My little question is, how/what can I do for the slider send the command for MQTT while I’m sliding it and not only when I release the mouse/finger?

I hope I have explained it correctly.

Thanks

  • Platform information:
    • Hardware: RPi
    • openHAB version: 2

Use a Setpoint and use the up and down arrows. The Slider will only send the new value when you release the mouse button to avoid overwhelming the network or your devices.

Yes it makes sense. Do you think I can build a function to when release the slider it fades the light until the new set value? For example, if I slide from 0 to 100 it starts to send 0,5,10,15…100… that way I can have a “fake” fade in/out in the light and can use the slider :smiley:

Depends on the capabilities of your hardware. It is really hard to do smooth dimming with wireless technologies because it is really easy to overwhelm the transceivers. On a good day, you will get one or two commands to the light per second. Sometimes better, usually worse. This is true for Zigbee, Zwave, RF433, and Wifi devices.

To do this right you will want to use something like Design Pattern: Cascading Timers to gradually dim the light.