Pet bowl monitor

When you’re living with roomates and a pet you never sure when it was already fed or just asking for attention)
So you have to message roommate to check if he or she already did a refill to pets bowl. No more!

You’ll need:

  1. Xiaomi door/window sensor and Xiaomi Gateway (OR any other reed switch sensor that can connect to home assistant server, usually through zigbee/zwave gateway)
  2. A bowl with a plastic stand.
  3. A small neodymium magnet (you can get them on amazon, ebay, they’re pretty common. Alternatively, you can use the magnet from xiaomi door sensor, but in my case it was to big to fit between a bowl and a stand.
  4. Optionally (again, depending on your bowl configuration), you’ll need an insulation tape and a double-sided adhesive tape.
  5. A Home Assistant server.

The first part is crafting.
You’ll need to fit the reed switch under the plastic stand. I had to strip off the case, wrap the sensor with the insulation tape and fixate it with adhesive tape. Even without a case I had to add some height to the stand so it will not rest on the sensor. Simple furniture pads did the trick.


Then you need the adhesive tape to position the magnet on the down side of the bowl. Mind the magnetic poles! I had to experiment, one side of the magnet gave the reed switch the false reaction.

The second part, the automation.
(I’ll skip the part of setting up the xiaomi devices, you’ll find the neccessary information here)

In configuration.yaml I have an input_boolean sensor. It works as ‘behind the scenes’ and hidden from ui to avoid manipulation by user (but still can be operated from develoeper tools)

input_boolean:
  cat_is_fed:
    initial: off

In binary sensors I have a template sensor as a ‘frontend’, to show in UI or tunnel it to the roommates homekit devices.

binary_sensor:
  cat_is_fed:
    friendly_name: "Cat is fed"
    value_template: "{{ states.input_boolean.cat_is_fed.state == 'on' }}"

And finaly the automations: they will mark the cat ‘as fed’ if bowl was picked up and then placed back., but will revert it ‘not fed’ after 10 hours of bowl being placed in its stand.

- id: '1313088393460'
  alias: '[CAT] Bowl placed'
  trigger:
  - entity_id: binary_sensor.cat_bowl_sensor
    platform: state
    to: 'off'
  condition: []
  action:
  - data:
      entity_id: input_boolean.cat_is_fed
    service: input_boolean.turn_on

- id: '1474575821859'
  alias: '[CAT] Reset'
  trigger:
  - entity_id: input_boolean.cat_is_fed
    platform: state
    to: 'on'
    for:
      hours: 10
  condition: []
  action:
  - data:
      entity_id: input_boolean.cat_is_fed
    service: input_boolean.turn_off

You can check it out in action on this video https://twitter.com/marcellus00/status/1038813183753035782

Extra: for the sake of thoroughness here’s the lovelace card bit

- type: picture-entity
  entity: binary_sensor.cat_is_fed
  name: Cat is fed
  state_image:
    "on": /local/cat.png
    "off": /local/cat_triggered.png
3 Likes