Dumb question, don't laugh : calling a flow from HA

First off, unless that wasn’t obvious, I’m pretty clueless about node-red. I use a certain module to control my old ABUS alarm system, because there isn’t any integration for it directly in HA.

There are basically three functions: arm/disarm/check status. I have set up inject nodes that call those functions in the node-red flow, and then a home assistant sensor node that let’s me check the state of the system in HA, and a debug node. So I can now arm/disarm/check the system from the node-red GUI.

In order to call the functions from HA, I have created three home assistant button nodes in node-red and then use the push.button service in HA to trigger the flows in node-red.

This obviously works, but seems clunky, and I have the nagging feeling that I’m not doing this the ‘right’ way.
Can anyone give me a quick smack around the head if I’m really doing this wrong?

1 Like

That’s the way I do it as well and have a ton of flows. I use a button helper just like you as the starting node.

2 Likes

This is how I feel, but I got over it after I understand this disorder is normal in nodered.
For this reason, I avoid using nodered at all cost.
It is my last option to make things working.
Don’t get me wrong… it is an excellent add-on and very useful, but I prefer using native integrations whenever I can.
For example, I prefer creating automations using the native integration.

You might separate functionalities using tabs and/or create good labels to make things a little more clear.

1 Like

How about MQTT? It exists to integrate anything’s events with anything else’s events.

You could use the manual alarm control and watch for the alarm state to change to arm/disarm the alarm. Then can also set the state of the alarm when you check status.

+1 for MQTT. Easy to debug using MQTT Explorer stand-alone or add-on. Easy to control state (if needed and/or you choose to also use an MQTT Sensor) after HA or NR restart using retain. Easy to use from HA with a service call.

Personally I steer clear of the HA entity nodes in NR.