Trigger node function

2,158 views
Skip to first unread message

Hermann

unread,
Jun 25, 2015, 2:25:24 PM6/25/15
to node...@googlegroups.com
I quote from the trigger node info file:
By setting the first output to nothing, and selecting extend timer - a watchdog timer can be created.
No output will happen as long as repeated inputs occur within the timeout period.

The picture trigger2.jpg shows the configuration of the trigger node.
trigger1.jpg shows a test flow with the inject node sending the string xx every second.

According to the above info, the trigger node should never send any output because there is an input every second.
Still in the debug window I see five times xx followed by time out over and over again.
node-red version 0.10.10

Any ideas?

trigger1.JPG
trigger2.JPG

Nicholas O'Leary

unread,
Jun 25, 2015, 2:33:55 PM6/25/15
to Node-RED Mailing LIst
I've just created a similar flow and it works as expected.

Can you share the exact flow so we can try to recreate it?

Nick

--
http://nodered.org
---
You received this message because you are subscribed to the Google Groups "Node-RED" group.
To unsubscribe from this group and stop receiving emails from it, send an email to node-red+u...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Hermann

unread,
Jun 25, 2015, 2:40:45 PM6/25/15
to node...@googlegroups.com
Here it is:

[{"id":"8f892934.d8d5e","type":"inject","name":"","topic":"1s","payload":"xx","payloadType":"string","repeat":"1","crontab":"","once":true,"x":261,"y":139,"z":"ab31f3fd.a0c69","wires":[["9a4a011d.3c743","e9ea0b73.cda1c8"]]},{"id":"122896ef.c32071","type":"debug","name":"time out","active":true,"console":false,"complete":"payload","x":610,"y":138,"z":"ab31f3fd.a0c69","wires":[]},{"id":"9a4a011d.3c743","type":"trigger","op1":"1","op2":"time out","op1type":"nul","op2type":"val","duration":"5","extend":true,"units":"s","name":"","x":447,"y":138,"z":"ab31f3fd.a0c69","wires":[["122896ef.c32071"]]},{"id":"e9ea0b73.cda1c8","type":"debug","name":"","active":true,"console":false,"complete":false,"x":451,"y":210,"z":"ab31f3fd.a0c69","wires":[]}]

Nicholas O'Leary

unread,
Jun 25, 2015, 5:00:12 PM6/25/15
to Node-RED Mailing LIst
Thanks, fix pushed to git.

Hermann

unread,
Jun 25, 2015, 6:16:53 PM6/25/15
to node...@googlegroups.com
Thanks Nick. It works now.
And I learned something new: advantage of === vs. == Didn't know that...

Mark Jacobs

unread,
May 1, 2018, 11:52:20 PM5/1/18
to Node-RED
I guess I am missing something. The info says it can repeat and I can't figure out how to do that. I want it to be a watchdog and when the heartbeat stops repeat a message at intervals until the heartbeat resumes. Any help appreciated.

Thanks

Simon Walters

unread,
May 2, 2018, 2:30:39 AM5/2/18
to Node-RED
I think you need to cascade 2 trigger nodes to get the effect you desire

[{"id":"3fec7c71.e08074","type":"inject","z":"16fe8d0f.9e6ec3","name":"","topic":"","payload":"1","payloadType":"num","repeat":"","crontab":"","once":false,"onceDelay":0.1,"x":130,"y":120,"wires":[["8655b61c.dd0d28","cfb46a2f.3e4a38"]]},{"id":"8655b61c.dd0d28","type":"trigger","z":"16fe8d0f.9e6ec3","op1":"","op2":"fail","op1type":"nul","op2type":"str","duration":"3","extend":true,"units":"s","reset":"","bytopic":"all","name":"","x":380,"y":120,"wires":[["59d20a02.b9e134"]]},{"id":"61cd3c9e.6c3f44","type":"debug","z":"16fe8d0f.9e6ec3","name":"","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"false","x":890,"y":120,"wires":[]},{"id":"59d20a02.b9e134","type":"trigger","z":"16fe8d0f.9e6ec3","op1":"fail","op2":"0","op1type":"str","op2type":"str","duration":"-3","extend":false,"units":"s","reset":"","bytopic":"all","name":"","x":620,"y":200,"wires":[["61cd3c9e.6c3f44"]]},{"id":"cfb46a2f.3e4a38","type":"change","z":"16fe8d0f.9e6ec3","name":"","rules":[{"t":"set","p":"reset","pt":"msg","to":"true","tot":"bool"}],"action":"","property":"","from":"","to":"","reg":false,"x":380,"y":200,"wires":[["59d20a02.b9e134"]]}]


Capture.PNG

Mark Jacobs

unread,
May 2, 2018, 1:07:08 PM5/2/18
to node...@googlegroups.com
That is Great. I tried several variation close to that but what I did not know was the msg.reset is a Boolean true/false. Thank you

On Tue, May 1, 2018 at 11:30 PM, 'Simon Walters' via Node-RED <node...@googlegroups.com> wrote:
I think you need to cascade 2 trigger nodes to get the effect you desire

[{"id":"3fec7c71.e08074","type":"inject","z":"16fe8d0f.9e6ec3","name":"","topic":"","payload":"1","payloadType":"num","repeat":"","crontab":"","once":false,"onceDelay":0.1,"x":130,"y":120,"wires":[["8655b61c.dd0d28","cfb46a2f.3e4a38"]]},{"id":"8655b61c.dd0d28","type":"trigger","z":"16fe8d0f.9e6ec3","op1":"","op2":"fail","op1type":"nul","op2type":"str","duration":"3","extend":true,"units":"s","reset":"","bytopic":"all","name":"","x":380,"y":120,"wires":[["59d20a02.b9e134"]]},{"id":"61cd3c9e.6c3f44","type":"debug","z":"16fe8d0f.9e6ec3","name":"","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"false","x":890,"y":120,"wires":[]},{"id":"59d20a02.b9e134","type":"trigger","z":"16fe8d0f.9e6ec3","op1":"fail","op2":"0","op1type":"str","op2type":"str","duration":"-3","extend":false,"units":"s","reset":"","bytopic":"all","name":"","x":620,"y":200,"wires":[["61cd3c9e.6c3f44"]]},{"id":"cfb46a2f.3e4a38","type":"change","z":"16fe8d0f.9e6ec3","name":"","rules":[{"t":"set","p":"reset","pt":"msg","to":"true","tot":"bool"}],"action":"","property":"","from":"","to":"","reg":false,"x":380,"y":200,"wires":[["59d20a02.b9e134"]]}]


--
http://nodered.org
 
Join us on Slack to continue the conversation: http://nodered.org/slack

---
You received this message because you are subscribed to the Google Groups "Node-RED" group.
To unsubscribe from this group and stop receiving emails from it, 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/f4edd9de-d44e-4654-bc1d-8a4d1a7477b9%40googlegroups.com.
Reply all
Reply to author
Forward
0 new messages