How to trigger a Node-RED flow from the Home Assistant UI
I see a lot of people who use Node-RED as their automation engine looking for a way to trigger a flow from the Home Assistant UI. Here’s how I do it.
First I created an empty script
.
1
2
3
script:
good_morning:
sequence:
And a button in Lovelace.
1
2
3
4
5
6
7
8
9
- type: entity-button
entity: script.good_morning
name: "Good Morning"
icon: mdi:coffee
tap_action:
action: call-service
service: script.turn_on
service_data:
entity_id: script.good_morning
Then in Node-RED.
The events: all
node checks only events of type call_service
.
The switch
node checks which script
was called.
The call-service
node turns on my bedroom ceiling lights in a 30 seconds transition.
When I press the button (below) in the UI or say “Hey Google, good morning” 1 the flow is triggered and the lights turn on.
I prefer this approach because I do not like the idea of using input_boolean
for this. It would be like using a light switch to activate a doorbell.
The script was exposed to Google Assistant using Home Assistant Cloud. ↩︎
Comments powered by Disqus.