In Home Assistant, automating tasks is done through a number of form-based screens under Automations, Scenes, Scripts and Helpers. You specify the entities, conditions, triggers and actions that are to be performed in templates. An alternative to this is flow-based automation. I prefer the flow-based approach over the form-based method because it offers flow visualization, and without the verboseness of forms.
Node-RED is the tool that supports flow-based automation in Home Assistant. It can be installed from the Add-On Store. The screen below shows where it could be found:

After installing Node-RED, there are a couple of parameters to set. In the Config section of the Node-RED installation screen, choose a secret phrase for “credential_secret”. The other parameter is “ssl”. This is set to true by default, which means a certificate and key file must be setup. Since I am setting up automation to run within my local area network, I change “ssl” to false. You may choose to use ssl with certificate authentication if you need encrypted connection for your automation tasks.

Once Node-RED add-on is installed, nodes that are specific to Home Assistant will be available on the left pane. The “event: state” node queries and returns the current state of an entity, and the “call service” node triggers an entity action.

In addition to these Home Assistant nodes, third-party nodes can also be added to Node-RED to further extend its functionality. A very useful third-party node is Pushbullet. I use it to send push notification to alert me of automation events.
Pushbullet node can be added by clicking the menu button at the top right corner, and selecting “Manage Palette”. Under the “Install” tab, search for “node-red-node-pushbullet” and click Install. Two new Push Bullet nodes will be added under Mobile section for receiving and sending Pushbullet notifications.

That’s it for setting up Node-RED in Home Assistant. Future posts will look into how I wire-up my IoT devices with Node-RED to perform task automation.