Adjust node time delay via dashboard GUI

727 views
Skip to first unread message

Shane Ringrose

unread,
Feb 6, 2017, 4:48:09 PM2/6/17
to Node-RED
Hi all

I can't find any examples of how to adjust any node setting (e.g. time ) via the dashboard text input?

Is this possible?

If so are there any examples?

Thanks

Dave C-J

unread,
Feb 6, 2017, 5:03:57 PM2/6/17
to node...@googlegroups.com
The Dashboard is just a dashboard to interact with the the flow running in the Node-RED runtime. The Editor is the way to edit nodes directly. You can design a flow such that the dashboard can send messages to the runtime to change it's behaviour but that is up to you.

Shane Ringrose

unread,
Feb 6, 2017, 5:31:36 PM2/6/17
to Node-RED
Thanks Dave

After some research I suspected this might be the case

 You can design a flow such that the dashboard can send messages to the runtime to change it's behaviour

Fingers crossed somebody can post an example on how to do this.

Thanks 

Dave C-J

unread,
Feb 6, 2017, 5:44:02 PM2/6/17
to node...@googlegroups.com
well you can send (just about) any message you like from most of the widgets... but it depends what you want to change in the editor. The Info panel in the editor will tell you what each node expects and thus any inputs you can send it. You mentioned time... but none of the default nodes accept a a time input (I think - no doubt someone will correct me).

Shane Ringrose

unread,
Feb 7, 2017, 3:35:11 AM2/7/17
to node...@googlegroups.com
I've go a loop (timer) and I want to fire it every few seconds which could be adjustable.

[{"id":"cfbe0792.bc6fe8","type":"switch","z":"353988b4.572778","name":"","property":"status1","propertyType":"global","rules":[{"t":"eq","v":"start","vt":"str"}],"checkall":"true","outputs":1,"x":115,"y":519,"wires":[["fa67f70a.968418"]]},{"id":"8f2d6b2a.efd608","type":"switch","z":"353988b4.572778","name":"","property":"count","propertyType":"msg","rules":[{"t":"lt","v":"6","vt":"num"},{"t":"else"}],"checkall":"false","outputs":2,"x":452,"y":465,"wires":[["97ea5918.742e08"],["5d315df9.bb14e4"]]},{"id":"97ea5918.742e08","type":"delay","z":"353988b4.572778","name":"","pauseType":"delay","timeout":"2","timeoutUnits":"seconds","rate":"1","nbRateUnits":"1","rateUnits":"second","randomFirst":"1","randomLast":"5","randomUnits":"seconds","drop":false,"x":422.765625,"y":216.75,"wires":[["cfbe0792.bc6fe8"]]},{"id":"fa67f70a.968418","type":"function","z":"353988b4.572778","name":"","func":"// initialise the counter to 0 if it doesn't exist already\nvar count = flow.get('count')||0;\ncount += 1;\n// store the value back\nflow.set('count',count);\n// make it part of the outgoing msg object\nmsg.count = count;\nmsg.payload = true;\nreturn msg;","outputs":1,"noerr":0,"x":272,"y":512,"wires":[["8f2d6b2a.efd608","fca7a1e6.76b68"]]},{"id":"5d315df9.bb14e4","type":"change","z":"353988b4.572778","name":"","rules":[{"t":"set","p":"count","pt":"flow","to":"0","tot":"num"}],"action":"","property":"","from":"","to":"","reg":false,"x":610,"y":498,"wires":[["97ea5918.742e08"]]}]

Inline image 1

I want to change this time via GUI

Inline image 2

Shane Ringrose 

Ph 09 4338933 | Cell 022 391 0652
shane.r...@gmail.com

On Tue, Feb 7, 2017 at 11:43 AM, Dave C-J <dce...@gmail.com> wrote:
well you can send (just about) any message you like from most of the widgets... but it depends what you want to change in the editor. The Info panel in the editor will tell you what each node expects and thus any inputs you can send it. You mentioned time... but none of the default nodes accept a a time input (I think - no doubt someone will correct me).

--
http://nodered.org
 
Join us on Slack to continue the conversation: http://nodered.org/slack
---
You received this message because you are subscribed to a topic in the Google Groups "Node-RED" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/node-red/xnGHTeSv0sE/unsubscribe.
To unsubscribe from this group and all its topics, send an email to node-red+unsubscribe@googlegroups.com.
To post to this group, send email to node...@googlegroups.com.
Visit this group at https://groups.google.com/group/node-red.
To view this discussion on the web, visit https://groups.google.com/d/msgid/node-red/CACXWFwJo3B1a0ePLDgVgjGtkDxhDSK70LyK5hxxuXZajLgzucA%40mail.gmail.com.

For more options, visit https://groups.google.com/d/optout.

Mark Setrem

unread,
Feb 7, 2017, 4:20:37 AM2/7/17
to Node-RED
I can think of two different ways you could achieve what you want to do

1) have a drop down list of the "delays" you want and then use a switch node to redirect to the correct delay

or

2) Have a loop set for the smallest increment delay you need and then an a loop. If delaywanted> delaydone increment delaydone and loop through delay node again

Shane Ringrose

unread,
Feb 8, 2017, 2:40:54 AM2/8/17
to Node-RED
Hi Mark

Thanks for the excellent tips

I can see my flows are going to get very big

Julian Knight

unread,
Feb 9, 2017, 8:12:20 AM2/9/17
to Node-RED
Sometimes, using JavaScript code in a function node is easier.

In the case where you want a variable input to effect some change, code can be much easier to manage. so if you don't want to juggle nodes, you might want to write just a bit of code to do it instead.
Reply all
Reply to author
Forward
0 new messages