So one of the basic nodes in node-red is the inject node which helps to start a flow. In "edit inject node" tab you can enable the repeat option and choose an interval between the consequent injections. My question is how can I stop this repetition when it has already started. It doesn't seem that there is any available option like this. More specific I would like to stop the repetition on two cases, either when a specific condition is met, or when a specific amount of time has passed.
The short answer is you don't.
The slightly longer answer is:
You can place a switch node after the inject node that can be used to gate the output based on a condition, which can include the state of a context variable. How you change that context variable is up to you, but another inject node and a Change node is probably the simplest.
Check this post on Node-RED forum: How to stop a inject node from working
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.