Home automation setup using Node-Red and Heroku

Home automation setup using Node-Red and Heroku

Written by Pranav Chakkarwar on 19 Nov 2020 • 4 minutes to read


This is an outdated and infeasible solution for home automation. Take a look at my better approach

Home, Office, Industrial Automation, and control using Node-Red, Heroku, MQTT, Raspberry Pi, other edge IoT devices (like esp8266, Arduino, etc.)

Advantages of using this solution
  1. It is an open-source solution (So you are the one in control of the critical internal data, not a multi-national conglomerate).

  2. The dashboard is available over the internet but password protected. For more security, we can use a free OpenVPN server (in the cloud or on our Raspberry Pi)

  3. It’s free, so why NOT!!! (Except you need to pay for the hardware lol)

  4. Your Node JS app will never sleep.

  1. Access the Control center from anywhere in the world.

  2. Control will be transferred locally to the Raspberry Pi (ex - in case of internet failure)

  3. Easily change automation rules or rewire controls with instant deployment.

  4. Automation rules can get as complex as you like.

  5. It is effortless to integrate third-party APIs like the OpenWeatherMap.


  1. Edge IoT devices (I am using esp-01 for demonstration)

  2. Raspberry Pi for local control and override rules (Note: The Raspberry Pi control center can also be accessed remotely on demand)

  3. Relay boards or Custom PCB boards

  4. And other devices like CCTV’s (optional)

Other Requirements
  1. App platform to deploy the project (I am using Heroku)

  2. MQTT provider (I am using Hive Public MQTT Broker for testing purposes) Not recommended for final deployments

Initial setup and deployment
Final setup
  1. Deploy the app to Heroku using the git deployment method (choose the forked repo)

  2. Once the app build is completed, you can access the node-red editor at the /admin path.

  3. Gather information and learn to use Node-Red.

  4. Next we will install the dashboard and core nodes.

  5. Setup the MQTT connections in Node-Red and click deploy in Node-Red.

  6. Your Control Center/Dashboard will be accessible at yourappname.herokuapp.com

  7. Flash the hardware (in this case esp8266) with MQTTclient program.

  8. Test the connection.

  9. NOTE that the app is deployed internally in Heroku and will not persist across app failures or reboots. (Read helpful notes for a solution to this problem)

Helpful Notes

For any suggestions or queries feel free to send me a message. Now go DIY!

Get interesting articles delivered to your email 📨

Enjoyed this article?


Post a comment

Comments will be manually approved and will take time to reflect.

You may also Enjoy

Home automation using Raspberry Pi, MQTT and Home Assistant

Raspberry Pi + Home Assistant

Published on 05 Apr 2021 • 9 minutes to read

A reliable solution for Home Automation with Home Assistant on Raspberry Pi and a remote access t...