Trigger node red flow from home assistant - how to expose the node?

Please bare with me as it’s my second day using node-red.

From Home Assistant, I want these buttons

To trigger these flows

I know, it’s ironic to use Home Assistant to trigger a flow in Node-Red, to trigger an action in Home Assistant. But I want to keep everything in Node-Red and keep Home Assistant as empty as possible.

I have the companion integration in Home Assistant, but its completely empty.

From what I could gather, I have to somehow expose these flows to Home Assistant, and then use the buttons in Home Assistant to trigger them?

If possible can you please be very specific on what I need to do to get this going?

I use Node Red for all of my automations but mostly utilize Hubitat so my experience with Home Assistant is limited.

To trigger each of those Blinds Action Nodes, you need to use an Events: State node for each of the button entities you have created. That will then be connected to corresponding Action Node that you created. There isn’t any “expose these flows to Home Assistant” that is necessary as far as I know. I am not sure what payload your entities will output but I am guessing that “pushed” is the one you want so you should probably add a Switch Node between the Events: State node and Action Node. The criteria is probably msg.payload = pushed.

Also, I recommend adding a debug node coming out of the Events: State node and, in settings, change Output to “complete msg object”. Then push the buttons in HA and you should see the output in the debug window. That will confirm that “pushed” is correct. Since you are new to Node Red, use of the debug node will typically give loads of helpful information as you add more automations.

There might be better ways as I mentioned, my experience with NR and HA together is limited.

In Node-RED, use a Button node. Create one for each action you want to perform in Home Assistant, then connect its output to the input of an action node.

This will create a button.xyz entity in Home Assistant that you can trigger with the button.press service—either from the Home Assistant dashboard or through an automation—to run the linked flow in Node-RED.

I also use Node Red for (almost) all of my automations. I just personally find it more intuitive than the native HA automation engine.

I don’t use the Node-Red Companion at all. I’m sure it’s not necessary, but it may offer benefits I’m not aware of.

I second @Stephenn’s recommendation above to extensively use debug nodes on pretty much everything you do. It really helps understand what’s going on behind the scenes (and will help keep you from going crazy over the difference between “On” and “on”….)

You absolutely can create entities from within Node Red as @Kermit describes. Alternatively, you can create Helpers from within HA, and then hook those up to your NR flows. For example, you could go to Settings → Devices & services → Helpers, click on the blue “+ Create helper”, and create a button there (or a toggle, or a number, or a ….)

This is what an Events: State node looks like. I normally don’t even check for “pushed” or any state value… just the fact that the state has changed means the button has been pushed!

Good luck!

I suggested the Switch Node because I wasn’t sure if pushing the button in HA might generate a “held” or "released’ message also.

I have never used these and never looked at them until @Kermit mentioned them above:

I can’t believe it was as simple as adding a button.

Thank you.

You can also do this directly from a button card, through the ui, without adding a button or a helper.

Card yaml

show_name: true
show_icon: true
type: button
entity: cover.all_blinds
icon: mdi:blinds-open
name: Open all blinds
tap_action:
  action: perform-action
  perform_action: cover.open_cover
  target:
    entity_id: cover.all_blinds