Any pet feeder integration?

Hello I would like to know if there any pet feeder integration with home assistant to be able to manage it remotely.
Thanks in advance. Kind regards,

Agustin

I’m about to build a pet feeder myself. It will be controled by mqtt, so integration will be easy :wink:
Not many pet feeders wil be controlable by the same way. Do you have a pet feeder?
Maybe you can add an ESP8266 and control it via MQTT?

I am just finalizing my project and it is exactly as mentioned I am using an ESP8266 with MQTT. I have one more part to 3d print and then I just need to assemble and figure out how to integrated into Home assistant.

I’m curious for more details… pics???

My set-up is actually quite simple and should cost under $40/50.

Zevro KCH-06139 Wall Mount Triple Dry-Food Dispenser - $20
High Torque Motor DC 12V Motor 5rpm - $12
NodeMcu Lua ESP8266 ESP-12E WIFI Dev Board - $8
L293D Wifi Motor Drive Shield for NodeMcu - $5
12v Powersupply ( I had one laying around)

All that is left is some 3D printed parts to attach motor to Dispenser and hold ESP8266 board and Arduino code to control motor via MQTT.

If there is more interest I can take some actual pics of my setup and provide stl’s of the models and arduino code.

I am still trying to figure out the best why to integrate this into HA. All I need to do is publish actuator/catfeeder/1 via mqtt and it feeds the cats. I would love to have some sort of button in HA and a time stamp when it was last kicked off. I would most likely automate it on time schedule. So if anyone has some ideas I would love your input.

Thanks

2 Likes

Super cool, I would definitely be interested in seeing your models and code.

I just uploaded all the files to thingaverse.

Here is my Arduino code

#include <ESP8266WiFi.h>
#include <PubSubClient.h>

//WIFI Setup
#define wifi_ssid "ChangeToYourAPName"
#define wifi_password "ChangeToYourAPPassword"

//MQTT Setup
#define mqtt_server "ChangeToYourMQTTServerIP"
#define mqtt_user "ChangeToYourMQTTUserName"
#define mqtt_password "iChangeToYourMQTTServerPassword"
#define feeder_topic "actuator/catfeeder"

//motor setup
#define Motor  5  //D1 = GPIO5


//Initialize wifi client library
WiFiClient espClient;
//Initialize MQTT client library
PubSubClient client(espClient);


void setup_wifi() 
  {
    delay(10);
    // We start by connecting to a WiFi network
    Serial.println();
    Serial.print("Connecting to ");
    Serial.println(wifi_ssid);
    WiFi.begin(wifi_ssid, wifi_password);

    while (WiFi.status() != WL_CONNECTED) 
      {
        delay(500);
        Serial.print(".");
      }
    Serial.println("");
    Serial.println("WiFi connected");
    Serial.println("IP address: ");
    Serial.println(WiFi.localIP());
  }

void reconnect() 
  {
    // Loop until we're reconnected
    while (!client.connected()) 
  {
      Serial.print("Attempting MQTT connection...");
      String clientId = "ESP8266Client-";
      clientId += String(random(0xffff), HEX);
      // Attempt to connect MQTT server
//    {
        if (client.connect("clientId", mqtt_user, mqtt_password)) 
      {
          Serial.println("connected");
      //once connected to MQTT broker, subscribe command if any
      client.subscribe("actuator/catfeeder");
        } else {
          Serial.print("failed, rc=");
          Serial.print(client.state());
          Serial.println(" try again in 5 seconds");
          // Wait 5 seconds before retrying
          delay(5000);
        }
      }
    }
  
void callback(char* topic, byte* payload, unsigned int length) 
  {
    Serial.print("Command from MQTT broker is : [");
    Serial.print(topic);
    int p =(char)payload[0]-'0';
    if(p==1) 
      {
        digitalWrite(Motor, HIGH);
        Serial.print("  Feed Cats" );
        delay(10000);
        digitalWrite(Motor, LOW);
      }
    else if(p==2)
      {
        digitalWrite(Motor, HIGH);
        Serial.print("  Feed Cats Lots!" );
        delay(20000);
        digitalWrite(Motor, LOW);
      }
      Serial.println();
  }
  
void setup() 
  {
    Serial.begin(115200);
    setup_wifi();
    client.setServer(mqtt_server, 1883);
    client.setCallback(callback);
    pinMode(Motor, OUTPUT); 
  }

void loop() 
  {
    if (!client.connected()) 
    {
      reconnect();
      }
    client.loop();

  }

Damn i didnt realize 3d printing was so expensive. I wanted to do this little project with my wife and daughter but it looks liek staples wants $300 to print off the parts plus the ~$40 for the other parts and a little bit of wood will bring the total for 1 dog dispenser to ~$370.

Did i do something wrong here? I’ve never done anything with 3d printing but it looks like i could just about buy a 3d printer for the price they are charging to print these,

1 Like

I can’t speak specifically for your location, but you might try to find a local makerspace or check your local library as some of them have 3d printers to use for free (well included with your taxes).

I added ESPHome integration to my PetKit feeder: https://community.home-assistant.io/t/diy-petkit-feeder-local-integration-to-home-assistant-via-esphome/338971