# Slider and button define timeout

**URL:** <https://discourse.nodered.org/t/slider-and-button-define-timeout/126>\
**Category:** General\
**Created:** [12 May 2018 16:49 UTC](https://discourse.nodered.org/t/slider-and-button-define-timeout/126 "2018-05-12T16:49:07Z")\
**Posts on this page:** 7\
**Page:** 1

<div class="post-metadata">

**Author:** ![igrowing](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/igrowing/32/663_2.png) [@igrowing](https://discourse.nodered.org/u/igrowing)\
**Post date:** [12 May 2018 16:49 UTC](https://discourse.nodered.org/t/slider-and-button-define-timeout/126/1 "2018-05-12T16:49:07Z")

</div>

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](https://nodered.org/docs/writing-functions.html#flow-context) 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.

---

<div class="post-metadata">

**Author:** ![igrowing](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/igrowing/32/663_2.png) [@igrowing](https://discourse.nodered.org/u/igrowing)\
**Post date:** [12 May 2018 18:56 UTC](https://discourse.nodered.org/t/slider-and-button-define-timeout/126/2 "2018-05-12T18:56:08Z")

</div>

Got the answer from [this video](https://www.youtube.com/watch?v=bovIZtgL68E).  
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?

---

<div class="post-metadata">

**Author:** ![davidcgu](https://avatars.discourse-cdn.com/v4/letter/d/e8c25b/32.png) [@davidcgu](https://discourse.nodered.org/u/davidcgu)\
**Post date:** [12 May 2018 19:58 UTC](https://discourse.nodered.org/t/slider-and-button-define-timeout/126/3 "2018-05-12T19:58:48Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![davidcgu](https://avatars.discourse-cdn.com/v4/letter/d/e8c25b/32.png) [@davidcgu](https://discourse.nodered.org/u/davidcgu)\
**Post date:** [12 May 2018 20:00 UTC](https://discourse.nodered.org/t/slider-and-button-define-timeout/126/4 "2018-05-12T20:00:09Z")

</div>

[{"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](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/1X/97517254a925c782acf8f4451dd264c6d7da72e4.png)

![image](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/1X/7b1e267b89e9170cada84ba1a095d7156f798d8f.png)

---

<div class="post-metadata">

**Author:** ![igrowing](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/igrowing/32/663_2.png) [@igrowing](https://discourse.nodered.org/u/igrowing)\
**Post date:** [13 May 2018 06:19 UTC](https://discourse.nodered.org/t/slider-and-button-define-timeout/126/5 "2018-05-13T06:19:18Z")

</div>

> [@davidcgu](#):
>
> Put directly a gauge or a text dashboard nodes

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!

---

<div class="post-metadata">

**Author:** ![dceejay](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/dceejay/32/38_2.png) [@dceejay](https://discourse.nodered.org/u/dceejay)\
**Post date:** [13 May 2018 07:33 UTC](https://discourse.nodered.org/t/slider-and-button-define-timeout/126/6 "2018-05-13T07:33:46Z")

</div>

by playing with the site spacing controls and theme colours you can put borders round every widget if you like.  
 ![image](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/1X/e09a23f5ebfef0f20073624e413d38340d9696d5.png)

 ![image](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/1X/302def3d775f7b6e75d2bca9f6201080c150c770.png)

---

<div class="post-metadata">

**Author:** ![igrowing](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/igrowing/32/663_2.png) [@igrowing](https://discourse.nodered.org/u/igrowing)\
**Post date:** [13 May 2018 17:35 UTC](https://discourse.nodered.org/t/slider-and-button-define-timeout/126/7 "2018-05-13T17:35:49Z")

</div>

> [@igrowing](#):
>
> is there a way to display numerical value of slider while moving it?

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