"Rpi-gpio in" node sending two messages

Hi there,
I am using a Rpi-Gpio-gpio in node. Is it normal that every time the button is pressed (once) the node send two messages with the same topic?
{"topic":"pi/36","payload":0,"_msgid":"ff149870.9f9ff8"}
and
{"topic":"pi/36","payload":1,"_msgid":"efb09694.609518"}

Thanks

If it's a momentary push button that is normal, you are getting a payload of 0 when you press, then when you release a payload of 1. What are you trying to achieve?

1 Like

Thank you @ghayne.
I am counting how many times the button is pressed to build an index to show different messages on a LCD.
Since, in my case, it is not supposed to be pressed many times and fast, I can use a timer to drop the intermediate messages avoiding count double or use a function to count /2. I was interested in the behaviour of the node. You confirming that is correct. Happy with that.

Thanks

1 Like

You could also add a switch node to filter out the 0's and only pass the 1's.

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