Set Up Seasonal Watering Schedules with Node-RED

Learn how to automate your garden's watering schedule with Node-RED, ensuring efficient plant care throughout the seasons.

Posted by Tom Becker on May 03, 2025 · 5 mins read

Set Up Seasonal Watering Schedules with Node-RED

Introduction

As the seasons change, so do our gardens’ watering needs. Whether you’re nurturing a lush vegetable patch or maintaining a beautiful flower garden, ensuring your plants receive the right amount of water can be a challenge. Fortunately, with the capabilities of Node-RED, you can easily set up seasonal watering schedules that adjust automatically for your garden’s needs.

Node-RED is a powerful tool for building IoT applications, and best of all, it’s beginner-friendly! Even if you’re new to home automation, by the end of this guide, you’ll have a smart watering solution ready to tackle the changing seasons. Ready to get started? Let’s dive in!

Step-by-step setup guide

Step 1: Install Node-RED

To begin, make sure you have Node-RED installed on your system. If you don’t have it yet, you can follow the official installation guide for step-by-step instructions.

Step 2: Access Node-RED

Once installed, you can access Node-RED by navigating to http://localhost:1880 in your web browser. This will bring up the Node-RED editor where you’ll create your watering schedule flow.

Step 3: Create a New Flow

  1. Click on the “Menu” in the top right corner and select “New Flow.”
  2. Rename the flow to something memorable, like “Seasonal Watering Schedule.”

Step 4: Add a Time Trigger Node

  1. From the palette on the left, drag a Inject node onto the canvas.
  2. Double-click on the node and configure it to your liking. Set it to trigger at a specific time daily, like 7 AM, to start your watering schedule.

Step 5: Set Up Seasonal Logic

  1. Next, you’ll want to determine the season. To do this, add a Function node to your flow. This node will check the current month and decide how long to water.

    In the function node, add the following code:

    let month = new Date().getMonth(); let wateringDuration;

    if (month >= 2 && month <= 4) { // Spring (March to May) wateringDuration = 30; // 30 minutes } else if (month >= 5 && month <= 7) { // Summer (June to August) wateringDuration = 60; // 60 minutes } else if (month >= 8 && month <= 10) { // Fall (September to November) wateringDuration = 45; // 45 minutes } else { // Winter wateringDuration = 0; // No watering }

    msg.payload = wateringDuration; return msg; </code>

This script sets watering times based on the month and passes the duration to the next node.

Step 6: Control the Watering System

  1. Drag a Switch node onto your flow and connect it to the function node. This node will allow you to open the irrigation system based on the payload value.
  2. Configure the switch to check if the payload is greater than zero. If yes, connect it to a GPIO or appropriate output node for your watering system.

Step 7: Deploy Your Flow

After you’ve set up your flow, click the “Deploy” button in the top right corner. Now your Node-RED flow will automatically trigger the watering system according to the set schedules.

Helpful Tip Block

Tip: Consider using the node-red-contrib-alexa-home-skill to integrate your watering system with Amazon Alexa. This allows you to control your watering schedule with voice commands and check the status of your garden easily!

Common issues & troubleshooting

  • Node-RED Doesn’t Start: If you can’t access Node-RED in your browser, check if it’s running. Use command node-red-start in your terminal to start it manually.

  • Flow Is Not Triggering: Ensure that the inject node is configured correctly and that it’s connected properly to the function and switch nodes.

  • Watering Duration Seems Off: Debug your function node by adding a Debug node connected to it. This helps monitor what payload is being passed through.

Final thoughts

Congratulations! You’ve successfully set up your seasonal watering schedule using Node-RED. With this setup, not only will your plants thrive, but you’ll also save water by avoiding unnecessary watering during winter months.

As seasons change and your garden grows, remember that Node-RED allows for flexibility. Feel free to add more nodes and create complex flows tailored to other garden needs, like lighting or nutrient delivery.

Happy gardening, and may your smart watering system keep your outdoor space lush and vibrant year-round! If you’re looking for inspiration or advanced node-red flow examples, be sure to check the Node-RED flow library for more creative ideas!