How to trigger a Node Red Flow with Samsung Button

Hi All,

I recently re created all my automation’s using Node Red and learned a great deal at the same time. I have a couple of Samsung buttons in our Master bedroom (One for myself & one for my wife) I have the long press set to trigger our bedtime routine but it is triggering our old automation setup in Home Assistant calling the automation.bedtime entity.

The bedtime flow I have setup in Node Red is a little more creative and I would like to use this instead. It automatically fires at 11:30 pm. How do I use the long press of my Samsung button to rigger the Node Red Bedtime Flow instead of the generic HA automation?

That depends :wink:

How did you integrate the Samsung Button to your HomeAssistant? How do you see the state of your Samsung button in HomeAssistant?

I have some Zigbee Buttons integrated via Zigbee2mqtt. Here you simply listen to the state change node with: sensor.livingroombutton_click

I have the SmartThings Buttons setup through the Zha_event_scanner in Node Red which then feeds through a device ID switch and then pushed to a switch giving me 3 outputs for Single, Double & long.

All I would like to achieve is to be able to use the long click to trigger the bedtime sequence I have setup in Node Red rather than the old native Home Assistant bedtime automation.

Would you mind sharing where the zha_event_scanner is available? I dont see it as an option in NR.

It is basically an Event Node
image

But you will also need to know your Zigbee Device ID, I basically followed the steps in this tutorial

Thanks for the response…I thought you had a special node just for handling zha events. I have this device in an HA automation already but have been slowly migrating a few of them over to NR. Should be an easy move for these.

If you know the device ID for the the Smart Button it is pretty straight forward. I moved pretty much all my automation’s over to Node Red now, it is a bit of a learning curve but once you understand the logic it is very flexible

1 Like

In this case, listen for the event_data for long press. Similar to how you do it in your old automation.
You can probably take this example: How to trigger a Node-RED flow from the Home Assistant UI | BonaniTech

Just reading your post again shows me you did that already. When you check the payload in the debug node, look for the message that tells you the click state of your button. Then filter for it again. It is probably here:

I actually approached it a slightly different way.

I simply copied all the nodes from my bedtime flow and then added them to the 3rd leg (Hold) on my Samsung button.

I may have been overthinking what I wanted to achieve lol