Slider and button define timeout

Likely, this question is asked somewhere already, please help to locate the answer.

I have slider (or numeric) UI node and a switch UI node at the same group in the flow. From this guide I understand that somehow I can write a function which can read slider or numeric node value by switch click.

Slider -- Switch -- Function -- Trigger -- MQTT

Maybe the wiring of nodes is not correct for the purpose. Please, advise.
In the function I tried to read the slider value as following examples:

  1. node.log(flow.get(‘slider’)||‘nc’);
  2. node.log(flow.slider.value||‘nb’);
  3. node.log(flow.slider.msg||‘nd’);
  4. node.log(context.get(‘slider’)||‘na’); // not expected to work

None of these works. I am missing basic understanding of Node-RED: how to read status of other node (from slider) in the flow? How to set specific value to other node (to trigger) in the flow?

Please, help.

Got the answer from this video.
To get value from other node I must parse it and place it in the flow context. Then it’s readable in the flow.

Slider -- Function(parser)
Switch -- Function(reader) -- Trigger -- MQTT

By the way, is there a way to display numerical value of slider while moving it?

Put directly a gauge or a text dashboard nodes at the outlet of the slider and you will see directly the value on the screen

1 Like




Thought exactly about this too. Abandoned this idea since it takes screen "real estate". Meanwhile, going back to numeric input. Although it's less "sexy" than slider, it's more explicit.

Is there a way to add visible separator between elements in group? Like horizontal line...
Tried to put template node with tag <hr> (doesn't work at all) or to add text node with many underscores or equal signs (looks terrible).

Thank you for your help, guys!

by playing with the site spacing controls and theme colours you can put borders round every widget if you like.

Found a method of displaying a slider value in Slider node itself. No waste of screen real estate.
In the field Label of slider node insert your text (if needed) plus a "tag".
Example 1: Label + tag

Slide me: {{value}}

Example 2: Just tag


Maybe this will help someone. :slight_smile: