Bug in RBE node?

The rbe node has a mode "block if value change greater than".

(It also as a similar "greater or equal" mode, but here I am referring explicitly to the "greater than" mode only, without any "or equal" addition.)

I want to use it to let only messages pass that contain the same value as the previous incoming message. Therefore I configure the rbe node to "block if value change greater than" 0 "compared to last input value".

The effect is that the rbe node does not let any message pass, at all.

If I change the comparison for the value change from 0 to e.g. 0.000000000001, then it works as intended.

edit:
This is a minimal example demonstrating the problem, pasted as suggested below:

[{"id":"480ae6de.258fb","type":"tab","label":"Flow 2","disabled":false,"info":""},{"id":"5f7764b8.b5ffb4","type":"inject","z":"480ae6de.258fb","name":"","topic":"","payload":"0.5","payloadType":"num","repeat":"","crontab":"","once":false,"onceDelay":0.1,"x":90,"y":80,"wires":[["b852b54b.f343c8"]]},{"id":"b3b69bb1.4fa6","type":"inject","z":"480ae6de.258fb","name":"","topic":"","payload":"2.5","payloadType":"num","repeat":"","crontab":"","once":false,"onceDelay":0.1,"x":91.08332824707031,"y":139.41665649414062,"wires":[["b852b54b.f343c8"]]},{"id":"dc7c3ce7.aeed48","type":"debug","z":"480ae6de.258fb","name":"","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"false","x":430,"y":180,"wires":[]},{"id":"b852b54b.f343c8","type":"rbe","z":"480ae6de.258fb","name":"Block if value change > 0.0000000000000000000000001","func":"narrowband","gap":"0.0000000000000000000000001","start":"2.5","inout":"in","property":"payload","x":407.00001525878906,"y":111.83334350585938,"wires":[["dc7c3ce7.aeed48"]]},{"id":"d111d796.eca5b","type":"inject","z":"480ae6de.258fb","name":"","topic":"","payload":"0.5","payloadType":"num","repeat":"","crontab":"","once":false,"onceDelay":0.1,"x":90,"y":240,"wires":[["ed07bc1a.acaa38"]]},{"id":"ef05fc10.d1b778","type":"inject","z":"480ae6de.258fb","name":"","topic":"","payload":"2.5","payloadType":"num","repeat":"","crontab":"","once":false,"onceDelay":0.1,"x":91.08332824707031,"y":299.4166564941406,"wires":[["ed07bc1a.acaa38"]]},{"id":"ed07bc1a.acaa38","type":"rbe","z":"480ae6de.258fb","name":"Block if value change > 0","func":"narrowband","gap":"0","start":"2.5","inout":"in","property":"payload","x":307.00001525878906,"y":271.8333435058594,"wires":[["dc7c3ce7.aeed48"]]},{"id":"1f1f8b99.67968c","type":"comment","z":"480ae6de.258fb","name":"Blocks messages unless payload is the same as in previous received message","info":"","x":390,"y":40,"wires":[]},{"id":"dbef54fd.73e498","type":"comment","z":"480ae6de.258fb","name":"Should behave the same but does not","info":"","x":310,"y":320,"wires":[]}]

Is this a bug in the rbe node?

You can paste flows here.

```
your code
```

I imagine its a unknown feature :slight_smile:

(as no-one else has ever tried to use the RBE node to only pass messages that are the same as the previous one - this being the complete opposite of its primary function :slight_smile: )

Reported here: https://github.com/node-red/node-red-nodes/issues/569

I'm confused.

From the start, it won't have a "previous" value. (I'll let that one go)
It gets a message and only passes messages there after that are the same.

Errrr. That doesn't quite make sense.

Here's my take on how to do it.

[{"id":"c35c4d03.0524c8","type":"inject","z":"9c1e5490.5d70b","name":"","topic":"","payload":"0.5","payloadType":"num","repeat":"","crontab":"","once":false,"onceDelay":0.1,"x":90,"y":80,"wires":[["a4ebf5d4.1abc48"]]},{"id":"7985036a.c6a44c","type":"inject","z":"9c1e5490.5d70b","name":"","topic":"","payload":"2.5","payloadType":"num","repeat":"","crontab":"","once":false,"onceDelay":0.1,"x":91.08332824707031,"y":139.41665649414062,"wires":[["a4ebf5d4.1abc48"]]},{"id":"320aebe6.5993e4","type":"debug","z":"9c1e5490.5d70b","name":"","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"false","x":580,"y":180,"wires":[]},{"id":"570bc977.c880d","type":"comment","z":"9c1e5490.5d70b","name":"Blocks messages unless payload is the same as in previous received message","info":"","x":390,"y":40,"wires":[]},{"id":"a4ebf5d4.1abc48","type":"function","z":"9c1e5490.5d70b","name":"Try this","func":"if (msg.topic == \"SET\")\n{\n    context.set(\"value\",msg.payload);\n    return;\n}\nvar x = context.get(\"value\");\nif (x == msg.payload)\n{\n    return msg;\n}\nreturn;","outputs":1,"noerr":0,"x":320,"y":180,"wires":[["320aebe6.5993e4"]]},{"id":"9e4739c2.691818","type":"inject","z":"9c1e5490.5d70b","name":"Set this value as comparison","topic":"SET","payload":"0.5","payloadType":"num","repeat":"","crontab":"","once":false,"onceDelay":0.1,"x":320,"y":230,"wires":[["a4ebf5d4.1abc48"]]}]

With this flow you can set what it is you want the value to be.

Press the two inject nodes a few times to see nothing gets through.
Then press the "set up" node.
Then press the other two inject nodes and see what happens.

The simple workaround is to use a switch instead, but the bug has now been fixed and released as 0.2.5

Thanks for the fix!