Page 1 of 1
Forum

Welcome to the Tweaking4All community forums!
When participating, please keep the Forum Rules in mind!

Topics for particular software or systems: Start your topic link with the name of the application or system.
For example “MacOS X – Your question“, or “MS Word – Your Tip or Trick“.

Please note that switching to another language when reading a post will not bring you to the same post, in Dutch, as there is no translation for that post!



Home Assistant - Tr...
 
Share:
Notifications
Clear all

[Solved] Home Assistant - Trigger Node Red flow from Dashboard

1 Posts
1 Users
0 Reactions
202 Views
 Hans
(@hans)
Famed Member Admin
Joined: 12 years ago
Posts: 2854
Topic starter  

As I have been messing around with this for a bit and found it rather hard to fin proper and complete information on to do, I figured post something here.

So the idea is that I want a button on my Dashboard which triggers a flow in Node-RED.

I've seen many options by now, but this one made the most sense to me and was very easy to implement.

Step 1 - Make a helper button

  • In Home Assistant go to "Settings" - "Devices & Services" and select the tab "Helpers".
  • Click the "Add Helper" button and select the "Button" helper option.
  • Give it a "Name" and set an "Icon" that makes sense to you and click "Create".

Step 2 - Add a button card to your dashboard

  • Enter the "Entity ID" (the Name that we just defined in step 1) and click "Save

** I used a simple button card for testing, you can obviously use whatever card you think is suitable.

Step 3 - Create a flow in Node-RED that responds to clicking your button

Sounds complicated, but it really isn't once you know what you need (as often is the case).

  • Place an "events: state" node on your workflow space. It looks like this:

  • Double click the node so we can access it's properties.
  • Give it a proper "Name" (good habit)
  • Set "Server" to "Home Assistant"
  • Set "Entity" (right under "Entities") to the helper button we created in Step 1.

** If you cannot find the name of your helper button, then you may need to restart Home Assistant.
     Maybe a bug in my setup, but that ended up the only effective way to get the name to show up.

No you can connect the output of this node to whatever nodes you'd like, for example a debug node to test and see if it works.

 

Hope this is helpful for someone - I know its a nice reference for myself now 😊 


   
ReplyQuote
Share: