How can I switch an actuator on and off with time delay based on an input value

Initial situation:

I get a value that changes second by second. If the value is above 100 for 5 minutes, I want to switch on a pump. If it is below 100 for 10 minutes, I want to switch the pump off again.

Are there suitable nodes for this or do I have to realize all this in a javascript function node? And does anyone have an idea how this could be easily implemented.

Thanks in advance for the help!

Have a look at the Trigger node. A couple of those might be what you need.

Something like this should work.

[{"id":"1fa1111cce45aaa0","type":"inject","z":"8be23377afc3327e","name":"","props":[{"p":"payload"},{"p":"topic","vt":"str"}],"repeat":"","crontab":"","once":false,"onceDelay":0.1,"topic":"","payload":"50","payloadType":"num","x":370,"y":580,"wires":[["9700b7809f02ede2"]]},{"id":"9700b7809f02ede2","type":"switch","z":"8be23377afc3327e","name":"","property":"payload","propertyType":"msg","rules":[{"t":"gt","v":"100","vt":"num"},{"t":"else"}],"checkall":"true","repair":false,"outputs":2,"x":490,"y":600,"wires":[["abb14cafece37181"],["33d822fda0aead08"]]},{"id":"80f0c534805d7a2a","type":"inject","z":"8be23377afc3327e","name":"","props":[{"p":"payload"},{"p":"topic","vt":"str"}],"repeat":"","crontab":"","once":false,"onceDelay":0.1,"topic":"","payload":"150","payloadType":"num","x":370,"y":640,"wires":[["9700b7809f02ede2"]]},{"id":"abb14cafece37181","type":"change","z":"8be23377afc3327e","name":"","rules":[{"t":"set","p":"payload","pt":"msg","to":"true","tot":"bool"}],"action":"","property":"","from":"","to":"","reg":false,"x":640,"y":560,"wires":[["7288e44d8b9a01e4","157d44e41167208e"]]},{"id":"33d822fda0aead08","type":"change","z":"8be23377afc3327e","name":"","rules":[{"t":"set","p":"payload","pt":"msg","to":"false","tot":"bool"}],"action":"","property":"","from":"","to":"","reg":false,"x":640,"y":640,"wires":[["157d44e41167208e","7288e44d8b9a01e4"]]},{"id":"7288e44d8b9a01e4","type":"trigger","z":"8be23377afc3327e","name":"","op1":"","op2":"","op1type":"nul","op2type":"payl","duration":"10","extend":false,"overrideDelay":false,"units":"s","reset":"true","bytopic":"all","topic":"topic","outputs":1,"x":890,"y":640,"wires":[["8285b6acad2aeb8a"]]},{"id":"157d44e41167208e","type":"trigger","z":"8be23377afc3327e","name":"","op1":"","op2":"","op1type":"nul","op2type":"payl","duration":"5","extend":false,"overrideDelay":false,"units":"s","reset":"false","bytopic":"all","topic":"topic","outputs":1,"x":880,"y":560,"wires":[["8285b6acad2aeb8a"]]},{"id":"8285b6acad2aeb8a","type":"rbe","z":"8be23377afc3327e","name":"","func":"rbe","gap":"","start":"","inout":"out","septopics":false,"property":"payload","topi":"topic","x":1050,"y":600,"wires":[["38fe4a9fec87dab6"]]},{"id":"38fe4a9fec87dab6","type":"debug","z":"8be23377afc3327e","name":"debug 250","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"false","statusVal":"","statusType":"auto","x":790,"y":720,"wires":[]}]

Thanks for the example, now I understand the trigger nodes.

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.