Node-RED Dashboard for Energy Consumption

Create your own visual dashboard to track energy consumption from various appliances engagingly.

Posted by Jared Stone on May 03, 2025 · 5 mins read

Node-RED Dashboard for Energy Consumption

Introduction

Have you ever wished for a simple way to monitor your energy consumption right from your smart home? As our dependence on smart devices grows, keeping an eye on energy usage has become essential. Luckily, with tools like Node-RED, you can create your own visual dashboard to track energy consumption from various appliances! Not familiar with Node-RED? Don’t worry, I’ll walk you through how to set up a Node-RED dashboard tailored for energy monitoring. Let’s dive in!

Step-by-Step Setup Guide

Step 1: Install Node-RED

Before you get started with your energy dashboard, ensure you have Node-RED installed on your machine or Raspberry Pi. If you haven’t installed it yet, you can easily do so by running the following command in your terminal:

sudo npm install -g --unsafe-perm node-red

Step 2: Access Node-RED

Launch Node-RED by running this command:

node-red

Once it’s running, open your browser and navigate to http://localhost:1880 to access the editor.

Step 3: Install Dashboard Nodes

To visualize your energy consumption data, you need to install the Node-RED Dashboard nodes. In the Node-RED editor, click on the menu (top right corner), then go to “Manage palette” and select the “Install” tab. Search for node-red-dashboard and install it.

Step 4: Create a Basic Flow

  1. Gather Input Data: You can use various methods to gather energy consumption data from your smart devices. You might use MQTT or even simple HTTP requests to get JSON data from your devices.

  2. Add Nodes: Drag and drop your input node (like mqtt in or http in) onto the flow canvas. Connect this to a function node, where you’ll process the data.

  3. Process Data: In the function node, you can write JavaScript code to extract the relevant energy data. For example:

    msg.payload = msg.payload.energy; return msg;

  4. Create Dashboard Elements: Connect the output of your function node to a ui_gauge or ui_chart node from the dashboard section. Configure these nodes to represent your energy data visually.

Step 5: Deploy and View

After connecting everything, click the “Deploy” button on the top right. Now, your dashboard is ready! Access it by navigating to http://<your-ip>:1880/ui in your browser, and you’ll see the visual representation of your energy consumption.

Step 6: Enhance and Customize

Once you have the basic setup, consider adding more features:

  • Alerts for sudden increases in consumption.
  • Historical data graphs to analyze trends over time.
  • Integration with Alexa for voice control.

Helpful Tips

  • Use Node-RED Flow Examples: Check out node-red flow examples for inspiration and existing flows that you can import and adapt.
  • Backup Your Flows: Regularly export your flows and save them somewhere secure. This way, even if something goes wrong, you can easily restore your configuration.
  • Stay Updated: Keep your Node-RED and Dashboard nodes updated to access the latest features and improvements.

Common Issues & Troubleshooting

  1. Node-RED Won’t Start: If Node-RED isn’t starting or you’re getting error messages, ensure all dependencies are installed properly. A simple solution can be to run npm install in your Node-RED directory.

  2. Data Not Showing on Dashboard: Check your function nodes for errors and ensure you’re passing the correct payload. You might also want to look at the debug pane in Node-RED to monitor your flows.

  3. Dashboard is Empty: If your dashboard is blank, revisit your connections. Make sure that all input nodes are connected correctly to their corresponding dashboard nodes.

  4. Alexa Integration Bugs: If you are running into issues with your Node-RED Alexa integration, ensure that you have followed the setup guide closely and that your skills are enabled in the Alexa app.

Final Thoughts

Creating a Node-RED dashboard for monitoring energy consumption opens up endless possibilities for managing your smart home efficiently. With a bit of creativity and experimentation, you can enhance your home and make informed decisions on energy usage. Don’t hesitate to explore more about integrating different smart devices and setting up more complex flows. Happy automating!