Pause incoming payload with function and switch node


i want to Pause a payload coming from mqtt with a switch (Off mode), and want to continue payload coming from mqtt with switch (On mode)



Do you mean you want just to filter out values from mqtt while the switch is off, or do you mean you want to queue them up and then release them all when the switch goes on?

1 Like


Assuming you are happy to just drop any incoming messages while paused. Simply use a global or flow variable set to true/false and add a test in a function node or use a switch node.

If using a function node, don't forget to move the return msg default statement to inside the test so that the default is that nothing is passed.

1 Like


@DevThePhoenix You might take a look at the gate and q-gate nodes. They were designed for this sort of thing.

1 Like


yes and it is already done, yesterday night. thanks for the replying my dear tech family.



so thank you drmibell it was a great node just came to know this thanks a lot it solves a lot of problems.