Using Node-RED to Monitor Solar Panel Output

Learn how to monitor your solar panel output using Node-RED for better energy efficiency.

Posted by Jared Stone on April 21, 2025 · 6 mins read

Using Node-RED to Monitor Solar Panel Output

Introduction

If you’re passionate about renewable energy and smart home automation, you may have already installed solar panels on your roof. Congratulations! However, are you keeping tabs on how much energy those panels are really producing? Monitoring solar panel output can help you maximize efficiency and provide inspiration for energy-saving decisions. Enter Node-RED: a visual programming tool that makes it super easy to integrate various data sources for smart home automation. Let’s dive into how to set up a simple Node-RED flow to monitor your solar output.

Step-by-Step Setup Guide

Step 1: Prerequisites

Before jumping in, you’ll need a few things:

  1. Node-RED Installed: Make sure you have Node-RED up and running on your home automation server. If you don’t have it yet, check out the Node-RED installation guide.
  2. Solar Panel Data Source: Depending on your solar inverter, you may receive data in various formats. It could be a REST API, MQTT, or another protocol. Make sure you have access to your solar panel’s output data.
  3. Basic Knowledge: A little familiarity with Node-RED will help you navigate through the setup easily, but even if you’re a total newbie, don’t worry—you can still follow along!

Step 2: Create a New Flow

  1. Open your Node-RED dashboard, usually accessible via a web browser. This is generally at http://localhost:1880 unless you’ve changed the default settings.

  2. Click on the “+” button in the top right corner to create a new flow.

Step 3: Add Input Node

  1. Drag your preferred input node onto the canvas. If you’re using an API, this could be an HTTP request node; for MQTT, choose the appropriate MQTT input node.

  2. Configure the input node according to your solar inverter’s specifications. For instance, if you’re using an API, you would need to specify the relevant URL, authentication details, and any required parameters.

Step 4: Add a Function Node

  1. Next, drag a function node onto the canvas. This node will process the incoming data.

  2. Double-click to edit the function node and enter JavaScript code that extracts the solar output value from the incoming payload. Here’s an example:

    msg.payload = msg.payload.output; // Adjust based on your data structure

  3. Click Done to save.

Step 5: Add a Dashboard Node

  1. If you want to visualize the data, you can use Node-RED dashboard nodes. Drag a gauge or chart node from the dashboard category onto your flow.

  2. Connect the output of the function node to the input of the dashboard node.

Step 6: Set Up Notification (Optional)

If you want to be notified about your solar output—maybe when it surpasses a certain threshold—you can integrate Alexa! You could use the Alexa Home Skill Node-RED for this.

  1. Drag an Alexa notification node into your flow.

  2. Connect the function node to the notification node and set up your custom message, like “Your solar output just hit 500 watts!”

Step 7: Deploy Your Flow

  1. After connecting all your nodes and configuring them to your preference, click the Deploy button in the top right corner.

  2. You should see the dashboard visualization update in real time based on your solar output data!

Helpful Tips

  • Explore Node-RED Flow Examples: Use node-red flow examples to find inspiration and ready-made flows that can make your integration even smoother.
  • Stay On Top of Data: Consider setting up a periodic data retrieval schedule in your flow so that you don’t miss any critical updates. Use a delay node to create intervals.
  • Secure Your Setup: If you’re using cloud services or APIs, ensure that you’re using appropriate authentication methods to keep your data secure.

Common Issues & Troubleshooting

  • No Data Coming In? Ensure your node configurations are correct. Test your HTTP or MQTT subscriptions independently to confirm data is being transmitted.
  • Data Misformatted? Check the function node. You may need to adjust your JavaScript to match your payload structure.
  • MQTT Connection Problems? Verify your broker settings if using MQTT. Ensure that you’re subscribed to the correct topics.
  • Dashboard Not Updating? Check that you’ve connected nodes correctly and your flow is deployed. Sometimes refreshing the dashboard can also help.

Final Thoughts

Monitoring solar panel output is not just a smart move; it’s a step towards being more informed about your energy consumption. With Node-RED, setting up a flow to track this data is both straightforward and customizable. Whether you opt to visualize data in real-time or create notifications through Alexa, the ease of automation allows you to take control of your home energy consumption efficiently.

As you become more familiar with Node-RED, remember that there are endless possibilities for integrating various aspects of your smart home. Consider sharing your own flows and experiences with the community—collaborating and learning from others is part of the fun! So roll up your sleeves, get started with your Node-RED flow, and maximize the benefits of your solar panels today!