Slider

Slider

Sets a number within a range — brightness, a target temperature, a speed. Like a Switch, it reads and writes.

Live preview · sample data

Settings

FieldWhat it does
EntityThe numeric value to control
Slider labelWording shown beside the slider
MinLowest value
MaxHighest value
Slider stepHow far each notch moves. 1 for whole numbers, 0.5 for halves
Show min and maxPrint the end values under the track
ColorThe track colour
Admin onlyHide it from everyone who isn’t an admin of the device — see Sharing a device

How it works

The handle sits wherever your device last reported the value. Moving it sends the new number down to your firmware:

.entityChanged = [](JsonDoc doc) {
    // read the new value and apply it
},

Report the value back in sendStatus so the slider stays in step:

.sendStatus = [](JsonDoc doc) {
    doc["brightness"] = currentBrightness;
},

Choosing a range

Min and max are display settings — they bound what the slider can send, not what your device accepts. Set them to the range your firmware actually handles, and clamp the value on the device as well if an out-of-range number would cause trouble.

A step that’s too fine sends a lot of updates as the handle moves. If your device does something slow in response, a coarser step gives a better result.