Pause incoming payload with function and switch node

#1

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)

0 Likes

#2

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

#3

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

#4

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

1 Like

#5

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

0 Likes

#6

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

0 Likes