Hi,
I need a inject node with a interval every 10 sec, this should only need to work when payload is 0
kind regards
Hi,
I need a inject node with a interval every 10 sec, this should only need to work when payload is 0
kind regards
There are many approaches to tackle this but one is to use a Trigger node instead since the Inject node doesnt accept an input.
Test flow :
[{"id":"a47e0c17.5bf2b8","type":"trigger","z":"981a2a72.4329f","name":"","op1":"","op2":"0","op1type":"pay","op2type":"str","duration":"-10","extend":false,"overrideDelay":false,"units":"s","reset":"","bytopic":"all","topic":"topic","outputs":1,"x":590,"y":1260,"wires":[["ca255ae1.5f2d88"]]},{"id":"6291a8b6.587d78","type":"inject","z":"981a2a72.4329f","name":"0","props":[{"p":"payload"},{"p":"topic","vt":"str"}],"repeat":"","crontab":"","once":false,"onceDelay":0.1,"topic":"","payload":"0","payloadType":"num","x":250,"y":1240,"wires":[["a12ef40f.d79278"]]},{"id":"75073b67.090034","type":"inject","z":"981a2a72.4329f","name":"1","props":[{"p":"payload"},{"p":"topic","vt":"str"}],"repeat":"","crontab":"","once":false,"onceDelay":0.1,"topic":"","payload":"1","payloadType":"num","x":250,"y":1300,"wires":[["a12ef40f.d79278"]]},{"id":"a12ef40f.d79278","type":"function","z":"981a2a72.4329f","name":"","func":"if (msg.payload == 0) {\n return msg\n}\nelse {\n msg.reset = true\n return msg;\n}","outputs":1,"noerr":0,"initialize":"","finalize":"","libs":[],"x":400,"y":1260,"wires":[["a47e0c17.5bf2b8"]]},{"id":"ca255ae1.5f2d88","type":"debug","z":"981a2a72.4329f","name":"","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"false","statusVal":"","statusType":"auto","x":800,"y":1260,"wires":[]}]
Thanks a lot !!
This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.