Integrating PetSafe Smart Feed 2.0 with Home Assistant: A Step-by-Step Guide

Hey everyone, I wanted to share my recent success in integrating my PetSafe Smart Feed 2.0 automatic pet feeder with Home Assistant. I’ve been looking for a way to monitor my pets’ feeding schedule and track their food consumption, and I’m thrilled to finally crack this! :cat::dog:

I stumbled upon this fantastic Python API for the PetSafe Smart Feed, which really opened up a lot of possibilities. I decided to create some sensors using the REST integration in Home Assistant to pull data from the feeder. It was a bit of a learning curve, but I managed to get everything set up smoothly!

Here’s a quick rundown of what I did:

  1. Requesting the Token: I started by sending a POST request to the PetSafe API to get a code. This was straightforward, and I received the code almost instantly via email.

  2. Generating Tokens: Once I had the code, I sent another POST request to generate the necessary tokens—access, refresh, and deprecated. I stored the deprecated token in my secrets file for security.

  3. Fetching Feeder ID: The next step was to retrieve the feeder’s unique ID, or thing_name, using another API call. This ID is crucial for accessing specific feeder data.

  4. Setting Up Sensors: I configured two sensors in my configuration.yaml file. The first sensor fetches general feeder information, while the second one pulls the latest feeding messages. This setup allows me to track feeding times, amounts, and even the status of the feeder.

  5. Working with Data: I played around with the data in the Developer Tools to format the timestamps correctly. It was a bit tricky at first, but I managed to get everything looking clean and usable.

I’m super happy with how this turned out! Not only can I monitor my pets’ feeding schedule, but I also get notified if the feeder runs out of food or if there’s an error. It’s a huge relief to know that my pets are well taken care of, even when I’m not home.

If anyone else is looking to integrate their PetSafe feeder, I’d be happy to help! Just drop a comment below, and I’ll do my best to assist. :paw_prints::sparkles:

Cheers,
[Your Name]