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

[{"id":"79c56afe.e47eb4","type":"ui_gauge","z":"f2bbe093.4cf9d","name":"","group":"cab40d2.85e94f","order":0,"width":0,"height":0,"gtype":"gage","title":"Gauge","label":"units","format":"{{value}}","min":0,"max":"100","colors":["#00b500","#e6e600","#ca3838"],"seg1":"","seg2":"","x":460,"y":260,"wires":[]},{"id":"5c2784e1.41923c","type":"ui_slider","z":"f2bbe093.4cf9d","name":"","label":"slider","group":"cab40d2.85e94f","order":0,"width":0,"height":0,"passthru":true,"topic":"","min":0,"max":"100","step":1,"x":260,"y":260,"wires":[["79c56afe.e47eb4"]]},{"id":"cab40d2.85e94f","type":"ui_group","z":"","name":"test","tab":"f690bc8b.23aa9","disp":true,"width":"6","collapse":false},{"id":"f690bc8b.23aa9","type":"ui_tab","z":"","name":"test","icon":"dashboard","order":15}]

image

image

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.
image

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

{{value}}

Maybe this will help someone. :slight_smile: