How to reset the Filter (old RBE) node?

Hi everyone...

Not sure if this is a bug or my stupidity :man_shrugging:t3:
Probably the latter...

In the Node info in Node-red, it says you can pass a msg.reset to reset the filter node. I tried it, but I can't get it to work...

The online documentation doesn't mention the reset function at all - node-red-node-rbe

I even saw this thread - How to reset rbe? - but even following this doesn't work... I do realise this may be old...

So the question is... Did the reset function get removed when it changed from RBE to Filter?

No the reset option is still present.

You need to set msg.reset to any value except false and 0.

If there is a msg.topic value set then it will only clear the filter for messages sent with that topic. If there is no msg.topic attached to the message used to reset then it should clear all the current filter values.

Here is an example that resets the rbe, you can reset by topic or if no topic specified, reset all topics. I often forget the rbe/filter node filters the payloads by topic to.

[{"id":"b2eb4dca.ed2c1","type":"inject","z":"c74669a0.6a34f8","name":"topic 1 value 1","props":[{"p":"payload"},{"p":"topic","vt":"str"}],"repeat":"","crontab":"","once":false,"onceDelay":0.1,"topic":"1","payload":"1","payloadType":"num","x":200,"y":2400,"wires":[["460e158e.569cec"]]},{"id":"460e158e.569cec","type":"rbe","z":"c74669a0.6a34f8","name":"","func":"rbe","gap":"","start":"","inout":"out","property":"payload","x":410,"y":2400,"wires":[["9feea51b.32922"]]},{"id":"9feea51b.32922","type":"debug","z":"c74669a0.6a34f8","name":"","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"false","statusVal":"","statusType":"auto","x":580,"y":2400,"wires":[]},{"id":"e59d5bf.098c2a8","type":"inject","z":"c74669a0.6a34f8","name":"topic 2 value 1","props":[{"p":"payload"},{"p":"topic","vt":"str"}],"repeat":"","crontab":"","once":false,"onceDelay":0.1,"topic":"2","payload":"1","payloadType":"num","x":190,"y":2440,"wires":[["460e158e.569cec"]]},{"id":"222b099b.6f1806","type":"inject","z":"c74669a0.6a34f8","name":"reset all topics","props":[{"p":"reset","v":"any value you wish","vt":"str"},{"p":"topic","vt":"str"}],"repeat":"","crontab":"","once":false,"onceDelay":0.1,"topic":"","x":140,"y":2540,"wires":[["460e158e.569cec"]]},{"id":"346fe934.fa43fe","type":"inject","z":"c74669a0.6a34f8","name":"reset topic 1","props":[{"p":"reset","v":"any value you wish","vt":"str"},{"p":"topic","vt":"str"}],"repeat":"","crontab":"","once":false,"onceDelay":0.1,"topic":"1","x":140,"y":2580,"wires":[["460e158e.569cec"]]}]

This was written on a 1.3 node-red, but as far as i am aware the reset is still there in V2

it is in the help pane for the node in the editor
image

Hi Colin, yes, I just couldn't get it working as I was just passing msg.reset without the 0 or false

In the Node info in Node-red, it says you can pass a msg.reset to reset the filter node. I tried it, but I can't get it to work...

Thank you very much everyone for the quick replies :grin:

Got it sorted now. I think my rbe nodes went a little fruity when I updated to Node 2.0 :man_shrugging:t3:
Soon as I added a new filter node and tried it, it worked. But not with my old nodes from the previous version of Node-red...

But thank you nonetheless :grin:

1 Like

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