Use Node-RED to Automate Pet Feeders

Learn how to automate your pet feeder using Node-RED to ensure your pet is fed on time!

Posted by Nina Alvarez on May 07, 2025 · 5 mins read

Use Node-RED to Automate Pet Feeders

If you’re a pet owner, you know that feeding your furry friend on time is essential. However, life can get busy, and sometimes our pets are left waiting for their meals. Wouldn’t it be great to automate that process? In this blog post, we’ll explore how to use Node-RED to automate pet feeders, ensuring your pet gets fed on schedule, even when you’re not home! Let’s dive into the step-by-step setup and make your pet’s feeding routine smooth and stress-free.

Step-by-step Setup Guide

Prerequisites

Before we begin, you’ll need a few things:

  • A Raspberry Pi or any other device that can run Node-RED.
  • A smart pet feeder that is compatible with automation.
  • Basic knowledge of networking and Node-RED.

Step 1: Install Node-RED

First, you need to have Node-RED set up. If you haven’t done that yet, follow the instructions at the Node-RED website to install it on your device. Once installed, you can access the Node-RED editor by going to http://localhost:1880 or your Raspberry Pi’s IP address followed by :1880.

Step 2: Create Your Flow

  1. Open Node-RED: Start by opening the Node-RED editor in your browser.
  2. Add a Time Trigger: Drag the inject node from the palette to your flow workspace. You can configure it to trigger at specific times, say at 8 AM and 6 PM when you normally feed your pet.
  3. Set Up the Function Node: Add a function node next to the inject node. This node will contain the logic to communicate with your pet feeder. Double-click on it and add a code snippet similar to the following:

    msg.payload = { action: "feed", amount: "100g" }; // Adjust the action and amount as per your feeder return msg;

  4. Connect to the Pet Feeder: Add an http request node (or the appropriate node for your feeder) next and link it to your function node. This step sends the feed command to your pet feeder via its API.

  5. Deploy the Flow: Once connected, click on the “Deploy” button in the top right corner to make your flow active.

Step 3: Add Alexa Integration

To control your pet feeder via voice commands, let’s add Node-RED Alexa integration:

  1. Install the Alexa Node: Go to the “Manage palette” section in Node-RED and install the node-red-contrib-alexa-home-skill package.
  2. Configure the Alexa Node: Drag the Alexa node into your flow and link it to the same http request node you used for the pet feeder. Set up its configuration according to your preferences.
  3. Test Your Automation: After setting it up, you can ask Alexa to feed your pet by saying something like, “Alexa, feed my pet.” You can also test the time-based automation by waiting for the inject trigger.

Helpful Tips

  • Use Node-RED Flow Examples: If you get stuck or need inspiration, visit the Node-RED flow examples site for ideas and ready-made flows that you can import directly into your workspace.
  • Scheduling: For added functionality, consider using a dashboard node to create a user-friendly interface where you can manually trigger feeds or adjust feeding times.
  • Notifications: Implement notification nodes to receive alerts on your smartphone whenever your pet feeder dispenses food.

Common Issues & Troubleshooting

Problem: Node-RED not responding

Solution: Ensure Node-RED is running by checking your device’s status. Restart Node-RED if necessary by using the command node-red-stop followed by node-red-start.

Problem: Pet feeder not operating

Solution: Check the connectivity and API settings of the pet feeder. Ensure that the correct endpoint is used in your HTTP node and that it matches the expected input format.

Problem: Alexa doesn’t respond

Solution: Verify that your Node-RED Alexa skill is properly configured and linked to your Amazon account. Check for any permissions that may need to be adjusted.

Final Thoughts

Automating your pet feeder using Node-RED not only saves you time but also ensures your furry friend is well taken care of when you’re busy. By integrating voice commands through Node-RED Alexa, you can even feed your pet with a simple voice request. Enjoy the convenience and peace of mind that comes with automating your smart home devices. Happy feeding!