# The \`filter\` node (or the old \`RBE\` node)

**URL:** <https://discourse.nodered.org/t/the-filter-node-or-the-old-rbe-node/56371>\
**Category:** General\
**Created:** [10 January 2022 02:02 UTC](https://discourse.nodered.org/t/the-filter-node-or-the-old-rbe-node/56371 "2022-01-10T02:02:22Z")\
**Posts on this page:** 18\
**Page:** 1

<div class="post-metadata">

**Author:** ![Trying\_to\_learn](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/trying_to_learn/32/28400_2.png) [@Trying\_to\_learn](https://discourse.nodered.org/u/Trying_to_learn)\
**Post date:** [10 January 2022 02:02 UTC](https://discourse.nodered.org/t/the-filter-node-or-the-old-rbe-node/56371/1 "2022-01-10T02:02:22Z")

</div>

I haven't used it much, but am/was helping someone with their question and wrote a small flow for them as an example.

```auto
[{"id":"581f105619104477","type":"rbe","z":"437e4108076e5928","name":"","func":"narrowbandEq","gap":"123","start":"1","inout":"out","septopics":true,"property":"payload","topi":"topic","x":430,"y":830,"wires":[["efa5c2e3feaba7eb"]]},{"id":"28ea8176f333dba5","type":"inject","z":"437e4108076e5928","name":"","props":[{"p":"payload"},{"p":"topic","vt":"str"}],"repeat":"","crontab":"","once":false,"onceDelay":0.1,"topic":"","payload":"-127","payloadType":"num","x":240,"y":790,"wires":[["581f105619104477"]]},{"id":"9f9494fc438016cd","type":"inject","z":"437e4108076e5928","name":"","props":[{"p":"payload"},{"p":"topic","vt":"str"}],"repeat":"","crontab":"","once":false,"onceDelay":0.1,"topic":"","payload":"20","payloadType":"num","x":240,"y":830,"wires":[["581f105619104477"]]},{"id":"0dd225f37914946e","type":"inject","z":"437e4108076e5928","name":"","props":[{"p":"payload"},{"p":"topic","vt":"str"}],"repeat":"","crontab":"","once":false,"onceDelay":0.1,"topic":"","payload":"11","payloadType":"num","x":240,"y":870,"wires":[["581f105619104477"]]},{"id":"3f2c03f6c720f8e8","type":"inject","z":"437e4108076e5928","name":"","props":[{"p":"payload"},{"p":"topic","vt":"str"}],"repeat":"","crontab":"","once":false,"onceDelay":0.1,"topic":"","payload":"40","payloadType":"num","x":240,"y":910,"wires":[["581f105619104477"]]},{"id":"efa5c2e3feaba7eb","type":"debug","z":"437e4108076e5928","name":"","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"false","statusVal":"","statusType":"auto","x":610,"y":830,"wires":[]}]

```

It is to filter messages with value of `-127`.

The node is set to `123` and is _narrow band_ mode.

I set the `initial value` to `1` so that is a reference point - or so I thought.

Thing is if I press the `-127` button after a `DEPLOY` the `-127` gets through.  
But if I `DEPLOY` and press any of the other ones then the `-127`, the `-127` is blocked.

## WHY?

Is this a bug (probably not) or am I reading the docs wrong?

---

<div class="post-metadata">

**Author:** ![Trying\_to\_learn](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/trying_to_learn/32/28400_2.png) [@Trying\_to\_learn](https://discourse.nodered.org/u/Trying_to_learn)\
**Post date:** [10 January 2022 03:52 UTC](https://discourse.nodered.org/t/the-filter-node-or-the-old-rbe-node/56371/2 "2022-01-10T03:52:20Z")

</div>

To further confuse me, I am not understanding this:

![menus](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/3X/4/6/4624a79db3d23bd9454478e5524534fd213cfb96.png)

This is/was the `RBE` node.

~~So what is the purpose of the first one compared to the second~~

Ok. That way you use the first one as a starting point. Kinda get it.

The wording of the next is also (to me) confusing.

`block unless value changes....`  
`block if value changes.............`

My take is that you are either allowing small or big changes to pass.

So shouldn't it be

`block if change is greater than ....` blocks changes that exceed a value

`block if change is less than .....` blocks changes that are less than a value.

Rather than confuse people with the unless/if condition used here/now.

And the two options `is greater than` and `is greater than or equal to`.  
Ok, that's a file line. But....

You are receiving ..... values.

A suggestion would be to have the "is greater than / is less than" options.  
You enter a value.  
And there is a tick box to include that value.

Sorry. I am discussing (not blaming, or what ever) how I think the description is confusing with the wording and an alternate way to have the "or equal to" bit.  
That isn't too critical. I'm just mentioning it.

P.S.  
The amount value/field. Is it `%` or number? Or can it be either (qualified by how it is entered as either a value or with the trailing `%` sign?  
This too is not really explained in the documentation.

Thoughts?

---

<div class="post-metadata">

**Author:** ![Sean-McG](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/sean-mcg/32/54677_2.png) [@Sean-McG](https://discourse.nodered.org/u/Sean-McG)\
**Post date:** [10 January 2022 04:38 UTC](https://discourse.nodered.org/t/the-filter-node-or-the-old-rbe-node/56371/3 "2022-01-10T04:38:26Z")

</div>

> [@Trying\_to\_learn](#):
>
> block if change is greater than

I think you are misunderstanding this, forget what you think now and read it again 😉  
This means if the value has gone up OR down, by a fixed number or by a percentage amount.

---

<div class="post-metadata">

**Author:** ![Trying\_to\_learn](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/trying_to_learn/32/28400_2.png) [@Trying\_to\_learn](https://discourse.nodered.org/u/Trying_to_learn)\
**Post date:** [10 January 2022 04:42 UTC](https://discourse.nodered.org/t/the-filter-node-or-the-old-rbe-node/56371/4 "2022-01-10T04:42:05Z")

</div>

I get that it is both up or/and down.

But the way it is written is confusing.

I think that keeping the wording the same/similar how I showed it is easier to read.

---

<div class="post-metadata">

**Author:** ![Sean-McG](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/sean-mcg/32/54677_2.png) [@Sean-McG](https://discourse.nodered.org/u/Sean-McG)\
**Post date:** [10 January 2022 04:42 UTC](https://discourse.nodered.org/t/the-filter-node-or-the-old-rbe-node/56371/5 "2022-01-10T04:42:42Z")

</div>

If you only want to block 1 number -127 just use a switch node set to != -127

---

<div class="post-metadata">

**Author:** ![Trying\_to\_learn](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/trying_to_learn/32/28400_2.png) [@Trying\_to\_learn](https://discourse.nodered.org/u/Trying_to_learn)\
**Post date:** [10 January 2022 04:44 UTC](https://discourse.nodered.org/t/the-filter-node-or-the-old-rbe-node/56371/6 "2022-01-10T04:44:36Z")

</div>

Again, I agree.

But if you run the flow I posted it is confusing why it does what it does.

From a fresh DEPLOY and I press the `-127` button, it is accepted.

But if I press another button first, them the `-127` button, it is blocked.

Why?

I make the `start value` set to `1`. `1` to `-127` is \> what I set as the limit.

---

<div class="post-metadata">

**Author:** ![Sean-McG](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/sean-mcg/32/54677_2.png) [@Sean-McG](https://discourse.nodered.org/u/Sean-McG)\
**Post date:** [10 January 2022 04:53 UTC](https://discourse.nodered.org/t/the-filter-node-or-the-old-rbe-node/56371/7 "2022-01-10T04:53:32Z")

</div>

As soon as you send a value, that is the value used for the next operation

---

<div class="post-metadata">

**Author:** ![Trying\_to\_learn](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/trying_to_learn/32/28400_2.png) [@Trying\_to\_learn](https://discourse.nodered.org/u/Trying_to_learn)\
**Post date:** [10 January 2022 04:55 UTC](https://discourse.nodered.org/t/the-filter-node-or-the-old-rbe-node/56371/8 "2022-01-10T04:55:27Z")

</div>

Here are two screen shots of the _problem_:

Fresh DEPLOY.

 ![Screenshot from 2022-01-10 15-52-00](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/3X/b/2/b2b33d2a631cab4f9ce56670e2388121f9fa229f.png)

You can see the `-127` is blocked.

Now changing the value in the node to a number LESS than 127 and DEPLOYing.

 ![Screenshot from 2022-01-10 15-52-46](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/3X/2/3/2349898c767429008bb3a94b3a77e13ce6d490cd.png)

You can see that the `-127` is passed.

---

<div class="post-metadata">

**Author:** ![Trying\_to\_learn](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/trying_to_learn/32/28400_2.png) [@Trying\_to\_learn](https://discourse.nodered.org/u/Trying_to_learn)\
**Post date:** [10 January 2022 04:56 UTC](https://discourse.nodered.org/t/the-filter-node-or-the-old-rbe-node/56371/9 "2022-01-10T04:56:48Z")

</div>

![Screenshot from 2022-01-10 15-55-38](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/3X/7/2/72c912e5ce0103acd268d2451a63abdb5a0b634b.png)

What can I say?

Start at `1`.... Range set to `124`. Inject `-127`.... That is outside the range/scope.

Why is it passed to the output?

---

<div class="post-metadata">

**Author:** ![Sean-McG](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/sean-mcg/32/54677_2.png) [@Sean-McG](https://discourse.nodered.org/u/Sean-McG)\
**Post date:** [10 January 2022 05:15 UTC](https://discourse.nodered.org/t/the-filter-node-or-the-old-rbe-node/56371/10 "2022-01-10T05:15:15Z")

</div>

Agreed it does seem to ignore the start value.  
Perhaps @dceejay can clarify this ?

---

<div class="post-metadata">

**Author:** ![Trying\_to\_learn](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/trying_to_learn/32/28400_2.png) [@Trying\_to\_learn](https://discourse.nodered.org/u/Trying_to_learn)\
**Post date:** [10 January 2022 05:15 UTC](https://discourse.nodered.org/t/the-filter-node-or-the-old-rbe-node/56371/11 "2022-01-10T05:15:50Z")

</div>

I shall hope he looks at this thread.

---

<div class="post-metadata">

**Author:** ![Colin](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/colin/32/17040_2.png) [@Colin](https://discourse.nodered.org/u/Colin)\
**Post date:** [10 January 2022 11:22 UTC](https://discourse.nodered.org/t/the-filter-node-or-the-old-rbe-node/56371/12 "2022-01-10T11:22:17Z")

</div>

Am I understanding correctly that you are saying that if you import the flow in the first post, Deploy and press the -127 inject then it blocks the -127 message? For me it does not block the message.

What version of node-red are you using?

---

<div class="post-metadata">

**Author:** ![cymplecy](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/cymplecy/32/2773_2.png) [@cymplecy](https://discourse.nodered.org/u/cymplecy)\
**Post date:** [10 January 2022 12:32 UTC](https://discourse.nodered.org/t/the-filter-node-or-the-old-rbe-node/56371/13 "2022-01-10T12:32:17Z")

</div>

> [@Trying\_to\_learn](#):
>
> Thing is if I press the `-127` button after a `DEPLOY` the `-127` gets through.

No - he said it does not block

---

<div class="post-metadata">

**Author:** ![Colin](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/colin/32/17040_2.png) [@Colin](https://discourse.nodered.org/u/Colin)\
**Post date:** [10 January 2022 13:56 UTC](https://discourse.nodered.org/t/the-filter-node-or-the-old-rbe-node/56371/14 "2022-01-10T13:56:35Z")

</div>

Oh yes, you are right. Too much haste and not enough care on my part.  
That does appear to be a fault in the node, unless we are misunderstanding something.

---

<div class="post-metadata">

**Author:** ![drmibell](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/drmibell/32/8424_2.png) [@drmibell](https://discourse.nodered.org/u/drmibell)\
**Post date:** [10 January 2022 16:46 UTC](https://discourse.nodered.org/t/the-filter-node-or-the-old-rbe-node/56371/15 "2022-01-10T16:46:24Z")

</div>

I agree that something is wrong. When set to "block if value change is greater or equal to", the node seems to ignore the `Start value`. If set to "block if value change is greater than", the results appear (on a quick look) to be correct.

---

<div class="post-metadata">

**Author:** ![Trying\_to\_learn](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/trying_to_learn/32/28400_2.png) [@Trying\_to\_learn](https://discourse.nodered.org/u/Trying_to_learn)\
**Post date:** [10 January 2022 20:06 UTC](https://discourse.nodered.org/t/the-filter-node-or-the-old-rbe-node/56371/16 "2022-01-10T20:06:01Z")

</div>

What is even more weird is if I make the value 120 it _IS_\* blocked.

So there is something sneaky going on.

To recap:  
Fresh deploy.  
~~The switch node is set to `121` (greater than `120`)~~  
And the `START VALUE` is set to `1`.

I inject `-127` it is passed.

The injection is outside the range of what should be passed.

HOWEVER,  
if I inject one of the other values first the `-127` is blocked. Which is understandable.

So there does seem to be a problem with how the `START VALUE` is parsed.

And then there is the "how things are explained" in the drop down menu.

---

<div class="post-metadata">

**Author:** ![dceejay](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/dceejay/32/38_2.png) [@dceejay](https://discourse.nodered.org/u/dceejay)\
**Post date:** [11 January 2022 13:49 UTC](https://discourse.nodered.org/t/the-filter-node-or-the-old-rbe-node/56371/17 "2022-01-11T13:49:15Z")

</div>

It does indeed appear to be a bug - seems ok in Greater than mode - but fails in Greater than or equal.  
Will fix - PR raised - [Fix for filter node narrrowbandEq mode start condition failure by dceejay · Pull Request #3339 · node-red/node-red · GitHub](https://github.com/node-red/node-red/pull/3339)

---

<div class="post-metadata">

**Author:** ![system](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/1X/d073cd938eafa2e558d7c2cd59003b3ef4963033.png) [@system](https://discourse.nodered.org/u/system)\
**Post date:** [25 January 2022 13:49 UTC](https://discourse.nodered.org/t/the-filter-node-or-the-old-rbe-node/56371/18 "2022-01-25T13:49:20Z")

</div>

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