Block the message if a new value is found

Im new in node-red and I'm having a problem

Using a rotary button to be able to indicate the positions manually, whenever an input receives signal from the button, turns on the led that represents the input and after 3 seconds the raspberry sends a signal with the information of the date, time and name of the current state for an Excel table, but the issue is that because it works with a rotary button, if I want to indicate a state in which the position of the input Is not right next to the current state, it will send information from all states that the button passes until reaching the one that i want.
Is there anyway I can prevent that?

You could use a trigger node - set to send nothing then wait for (however long you think is acceptable to detect stop) - tick the extend checkbox - and then send latest msg. So it will only send a message after the delay you set.

Does that block the message If the delay Isn't finished?
Because I just want It to send the message If the input doesn't change in those 3sec, If the input changes before the 3sec I dont want to receive that message

I find it best to play with the trigger node directly to get a handle on what it will do - just set a minimal flow with inject - trigger - debug and try it out :slight_smile:

But yes in this case

Hi cymplecy, so you are saying that it's better to use the trigger as the delay right?
And can It do the job of discarding the message if a new input is triggered?

I'm saying play with it :slight_smile:

I figured it out, thank you!

2 Likes