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

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

[{"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?

To further confuse me, I am not understanding this:

menus

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?

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

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.

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

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.

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

Here are two screen shots of the problem:

Fresh DEPLOY.

You can see the -127 is blocked.

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

You can see that the -127 is passed.

Screenshot from 2022-01-10 15-55-38

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?

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

I shall hope he looks at this thread.

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?

No - he said it does not block

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.

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.

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.

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

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