Nodered for HA + Duplicate messages using Zigbee2MQTT

From nothing I found out that it is occurring 2 messages for 1 event. Debugging on node red I see 2 payload messages coming for 1 press button on a zigbee device.

zigbee2mqtt/Zigb_Interruptor-duplo : msg.payload : Object
{ action: “1_single”, battery: 100, linkquality: 98, voltage: 3000 }

{ action: “”, battery: 100, linkquality: 98, voltage: 3000 }

Any guess

The second message is sent when the button is released. In node-RED you just need to ignore state change to the null state. Easily done in a state node.

@hunterdrayman I tested that holding the button for a while and did not get the 1st message. Both messages come together no matter how much time I keep the button pressed.

If your button has a 1_hold and/or a 1_double function it has to wait to see if either of those events will occur. On releasing it can decide which has happened and it also sends the null state to round things off nicely.