Execute Nodered flow from a HA UI button?

Does anyone have an example to share for creating a button in the HA UI that when pressed activates a flow in Node-Red?

I’m super new to all of this but you can create an input Boolean. Then use that as a events: state input to start your flow. I’ve got a list box that does the same thing. You need to restart node red to have it detect new HA entities. Sorry if you know all of this I’m just excited I think I know the answer.

3 Likes

You can also use input mqtt node and scripts in HA.
Scripts send payload sleep to topic “n/scripts”
image

3 Likes

you can create an Input_boolean and than respond to that event in Node-Red

Thanks to all. Got it working with input_boolean and a Lovelace button card.

1 Like

You can also use this method with empty scripts. In case you don’t want to use input_booleans.

2 Likes

Just an fyi, This tutorial by bonani helped me out yesterday. Just another alternative to using an input_boolean although that solution also does work well!

6 Likes

If you don’t want to mess with any yaml config, you can add the script on the Configuration->Scripts pane that fires an event (give it a unique name), then create a button in lovelace to fire that script. On the Node-RED side just listen for those events and act. :ok_hand:

1 Like

Simple, and perfect. Worked like a charm. No more input_booleans to work with for this integration.

1 Like

This worked great. thanks