Post

Automating Mealtime: My Aqara Pet Feeder Setup for Three Dogs

Automating Mealtime: My Aqara Pet Feeder Setup for Three Dogs

Being a tech lead means juggling meetings, deadlines, and constant problem-solving—sometimes all at once. Add three hungry dogs with synchronized feeding times into the mix, and even the best daily schedule can fall apart. That’s when I turned to automation. With Aqara smart feeders and Home Assistant, I built a system that ensures Jax, Lincoln, and Reagan get fed on time, every time—no matter how hectic my day gets.

What I Use

Affiliate Disclosure
Chris Hansen Tech is a participant in the Amazon Services LLC Associates Program, an affiliate advertising program designed to provide a means for sites to earn advertising fees by advertising and linking to Amazon.com. As an Amazon Associate, I earn from qualifying purchases.

Since I have three dogs and three pet feeders, I also installed a USB wall outlet to make it easier to plug them all in the same area. I covered the outlet with an outlet cover to keep the dogs and kids from messing with the plugs.

Connecting to Home Assistant

The Aqara Pet Feeder works with both ZHA and Zigbee2MQTT. I use Zigbee2MQTT for my Zigbee network in Home Assistant.

To connect the feeder, enable device pairing in Zigbee2MQTT, then hold the reset button on the Aqara Pet Feeder for five seconds. You’ll see it join in Zigbee2MQTT.

Once the pet feeder is connected, you can set up a feeding schedule in the Zigbee2MQTT interface. This saves the schedule to the feeder itself, allowing it to function even when your smart home is offline. In Home Assistant, the schedule is only displayed as an MQTT device entity.

In Home Assistant, I configure the following settings for the feeder:

  • Child lock: Prevents my toddler from playing with the buttons.
  • Mode: Set to manual since I use an automation for the feeding schedule.
  • Portion weight (grams): Used in statistics to track daily feeding amounts.
  • Number of portions per feeding: Configured based on food measurements.

Device configuration Device Configuration

To determine the portion weight and number of portions, I measured the usual amount I feed my dogs (typically a quarter cup) and then weighed a single portion dispensed by the feeder. In my case, one portion was 8 grams, so I set five portions to match the weight of a quarter cup.

Automation

I wanted to allow manual feeding in case the dogs wanted to eat earlier than scheduled or if we had to leave during their normal mealtime. However, I didn’t want the automatic feeding to trigger if a manual feeding had occurred within the last hour. To achieve this, I created a datetime helper.

Datetime helper Datetime Helper

I then created a script that executes feeding for each feeder and updates the datetime helper with the current timestamp.

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
alias: Feed dogs
icon: mdi:dog
sequence:
  - target:
      entity_id:
        - select.jax_pet_feeder_feed
        - select.lincoln_pet_feeder_feed
        - select.reagan_pet_feeder_feed
    action: select.select_first
    data: {}
  - target:
      entity_id: input_datetime.dogs_last_feed
    data:
      timestamp: "{{ now().timestamp() }}"
    action: input_datetime.set_datetime
mode: single

Finally, I created an automation for the feeding schedule that only triggers the script if the last feeding timestamp is more than an hour ago.

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
alias: Feed Dogs
description: Feed the dogs based on the schedule.
triggers:
  - trigger: time
    at:
      - "05:30:00"
      - "10:30:00"
      - "13:30:00"
      - "16:30:00"
      - "18:30:00"
conditions:
  - condition: template
    value_template: >-
      {{ now() -
      as_datetime(state_attr('input_datetime.dogs_last_feed','timestamp')) >=
      timedelta(hours=1) }}
actions:
  - action: script.feed_dogs
    data: {}
mode: single

If you use the visual editor, you’ll need to create a separate time trigger for each feeding. Multiple times in one trigger can only be done in YAML.

Manual Feeding

To trigger a manual feeding, I attached the script to a button on my mobile dashboard.

Additionally, I exposed the feed_dogs script to Alexa. In the Alexa app, scripts show up as scenes. I then created a routine in Alexa so I can say, “Alexa, feed dogs,” “Alexa, feed the dogs,” or “Alexa, feed the puppies,” and the feed dogs scene will activate, executing the script in Home Assistant.

Results & Observations

Automating my dogs’ mealtime has been one of my favorite automations. I no longer have to worry about forgetting to feed them when I’m busy. The dogs love it too—they run to the feeders as soon as they hear the food dropping into their bowls.

I definitely recommend the Aqara Pet Feeder. I got my first one when we only had Jax, and it worked flawlessly for over a year before Lincoln and Reagan joined the family. When they did, I bought two more, and they’ve all worked great ever since.

This post is licensed under CC BY-SA 4.0 by the author.