Button Pressed Event Type

I have a 433 MHz doorbell that is set up as a switch in HA. I have an automation in HA that can send me a notification when the doorbell rings. However, it often sends the signal multiple times, as RF sends multiple signals for every button press.

So I thought I would use Node-RED to automate, using rate limits etc. However, I cannot find out how to use button pressed event. Does anyone know how?

What does your yaml automation look like?

I solved this in Node-RED with the help from you on Discourse.

However, I want to do the following:

When doorbell rings:

  1. Save Sonos state
  2. Set comfortable volume
  3. Play doorbell audio sound
  4. Restore Sonos state

However, running this in serial doesn’t seem to work. Individually it works, but I need all nodes to wait for the last one to finish, but it now just runs through all in under half a second, so the audio never plays.

Hi @ronnyandre,

did you solve this?

Thanks,
Ronald

@rdehuyss

Unfortunately no :frowning:

You could use a wait-until node between 3 and 4 to wait for the state of the Sonos to change to its default paused/idle state then continue to restoring the Sonos state

Also a triggernode can help. it basiclly just delays a payload.
I think this needs to be placed between 3 and 4.

It’s an old topic, but I the easiest way to prevent multiple consecutive events is to call the automation turn off service at the start of the action, do whatever you want to do, add a delay of 5 or 10 seconds and then turn the automation on again.

Hi, can you please share how you solved this? I’m also wondering how to use button_pressed events in Node-Red

Sorry for the late reply. You can copy/paste this code for an example flow I set up.

Basically the flow goes like this:

  1. An Event Node listens to deconz_event event types.
  2. A Switch Node checks msg.payload.event.unique_id for the correct ID for the different switches.
  3. For each switch, you connect new Switch Nodes to check the msg.payload.event.event value, so you can act differently based on single click, double clicks, long holds etc.

You can use the developer tools in Home Assistant to get the unique IDs and event type values. Or just use a Debug Node and connect it to the first event listener.

1 Like

Thank you!