Ignore same message within 5 seconds

I'm trying to come up with a method of ignoring short term duplicate messages

But this little idea doesn't quite seem to work in the way I want it to
i.e use RBE to block repeats but reset it 5 secs after a message comes thru



If I press inject 3 times quickly - 1st msg goes thru and others are ignored :slight_smile:
But at end of trigger timeout - another one of the messages appears :frowning:

PS Although I'd like to know why my idea isn't working properly - all other suggestions welcomed as to how to the job in a different way


I've just realised that I'm re-inventing the delay node rate limiting and discarding intermediate messages option aren't I #LOL :laughing:


Yep :smiley: :smiley: :smiley:

I know you have found a solution, but for the sake of learning.....

From my recent post about "message repeat speeds" I was pointed to this:

Could this be interesting?

That was a solution created 6 years ago (before that rate limit capability was built into the delay node)


Sorry. I was just sharing something I thought could be useful.

No worries, it was useful back then, and is interesting from a historical perspective :slight_smile:

But still interested if anyone can explain why my flow doesn't do the same job properly

I'll look at the flow soon, but before I do I was just wanting to check I am up to speed with what it is you want to do / have the flow do / see.

I think I can see the problem!

The trigger node.

It is set so:


So, it sends the original message, waits 5 seconds then sends a reset message.

Try it like this:


I can't promise it is the solution.

Alas even this machine's Node-Red is slow (but 200+ tabs open, you have to expect things to slow down) but the tabs for (with) Node-Red are really loading the processor.
So there is another problem.

But sorry, I am getting off topic.

But I think what I did with the trigger node helps with the problem.

@cymplecy Simon here is my take on your flow

When you press the inject and msg is sent with a payload of 'test'

  • the msg enters the rbe node which stores the payload and sends the msg on
  • since there was no previous msg (the payload has changed)
  • the msg goes to debug and shows up
  • the msg also goes to the trigger node which sends the msg on (first time)
  • the msg goes to the change node where the payload is removed from msg and msg.reset is set to true
  • the msg is sent back to the rbe node
  • Since msg.reset is true, it clears the stored msg.payload.
  • the msg is sent on to the debug (shows up in debug list) and to the trigger node

Here is where the gotcha comes in. The msg now has msg.reset set to true, so when it gets to the trigger node


If a message is received with this property, any timeout or repeat currently in progress will be cleared and no message triggered.

and everything stops.

If you add a change node (set to delete msg.reset) between the rbe and trigger node I think it will work the way you want.

That didn't make any difference

Yes it does, but the second msg sent from the trigger ends up with reset = true so it never gets thru the rbe again.

Here is your flow with the change and an extra debug.


Your flow doesn't work for me - you seem to have changed the way the trigger node is configured
[edit] ignore the bit about trigger node change [/edit]

Only thing I did was to add the change node and debug node. Here is what it looks like after the initial click of the inject node:

NOTE: I moved the nodes to make it easier to take the screen shot

You can see the blue dot under the trigger node. After 5 seconds you see the other msg and the blue dot is off:

What versions of NR, node.js and what platform? I tried it on a Pi and on my mac and get the same results (both using NR v1.0.4)

I'm just have a mare of a day here :slight_smile:

Just ignore me :slight_smile:

I've altered my trigger node to do WHAT I THOUGHT I'D TOLD IT TO DO IN THE FIRST PLACE!!!!!!

Did I mention that I was having a mare! :slight_smile:

This is what I thought i'd set it to and now it works perfectly of course :slight_smile:

Thanks for sticking with me Paul and forcing me to find out what I'd done wrong :slight_smile:

1 Like

Wasn't that me who mentioned setting the trigger node to send nothing?

I'll chirp in and give you my rundown on what was happening:
(It was late and while I was sleeping I saw the problem.
I didn't think it was worth getting up and posting then.)


  • There will be 3 messages coming in.

The first message comes in.
The RBE allows it to pass.
It is sent to the debug node and the trigger node.
The trigger node on-sends the original message to change node, and starts a 5 second count down.
In the mean time: messages 2 and 3 arrive.
They are filtered by the RBE node.
(Back to the other part)
If it is more than 5 seconds for the messages to arrive.......
The trigger will have sent a reset message to reset the RBE node.
The second (or third) message arrives. (Though probably third in your case)
The RBE node will allow it to pass because it has been reset.
Going back to the second message message:
The trigger node has just sent the reset command and the RBE node will allow messages to pass.
The second message arrives - the RBE has been reset from the message sent from the trigger node.
The second message is passed.
The trigger node again sends the original message and waits 5 seconds to send the reset command.
And so the problem can repeat for the third message.

1 Like

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