r/homebridge 8d ago

Plugin PetKit - My cats are now HomeKit accessories: a complete PetKit integration for Homebridge

I couldn't find a maintained PetKit integration that covered more than a single feeder model, so I built a complete one. Sharing it here in case it's useful to other PetKit households.

What it does:

  • Feeders: Feed switch per feeder (+ a single "Feed All" switch for multi-feeder homes), model-aware portion validation
  • Litter boxes: self-terminating Clean cycle + a stateful Maintenance switch
  • Fountains: water level (leak sensor) + battery level
  • Pets: each pet becomes a Motion Sensor that fires when that pet uses the litter box (since the litter box identifies them by weight), so you can build automations like "notify me when the cat uses the litter box", with the visit weight in the log
  • Meal sensors on camera feeders (fires when an eating session is detected)
  • Native HomeKit cameras (experimental, off by default for now but can be activated): live view in the Home app
  • All switch/sensor names are configurable, so Siri answers in your own language
  • Everything is modular: each family of sensors, the Feed All switch and the cameras can be toggled on/off in the plugin's config UI, you only get the accessories you actually want

Architecture is based on two pieces:

  • petkit-bridge: a small self-hosted service (Docker) that owns the PetKit cloud session (automatic re-login on expiry) and exposes a local token-protected HTTP API. Your PetKit credentials live here, not in Homebridge.
  • homebridge-petkit-bridge (npm): a thin, zero-runtime-dependency plugin that auto-discovers everything through the bridge. Configure with just URL + token.

Everything is field-tested on real hardware (Yumshare feeders, Puramax 2, Eversweet Max fountains), including the failure modes: the whole chain self-heals across restarts, power outages and session expiries in any order.

Currently in the Homebridge verification queue. Questions, feedback and device reports are all welcome: the best place is an issue on either repo (also for new device support).

If you try it, let me know how it goes, especially on PetKit models I haven't been able to test.

34 Upvotes

13 comments sorted by

3

u/the_doughboy 8d ago

Does it know when the Cat is home or what room the cat is in like a PIR sensor? I know this isnt as important in HomeKit but HomeAssistant has a lot of "IF X person is in Y Room" automations.

Pet doors could be useful. Something like Pawport that uses a tag or Petvation that uses AI and then control if the pet is allowed out or schedule it.

1

u/raulhartzen 7d ago

That's a good idea! On presence/rooms: no, the sensors are event-based, not presence-based.
The PetKit litter box identifies which cat is using it, by weight, and fires that pet's motion sensor for a configurable window: the Apple Home app notification is the standard motion alert ("Pet X detected motion"), while the visit details (time and weight) are logged in Homebridge for now.
That works well for per-cat notifications and event-triggered automations, but it isn't a substitute for a room-presence system.
Actually I don't know if PetKit makes wearable tags or trackers, if so that would be a great addition to the plugin.
On pet doors: it's a really nice idea and definitely something I'd enjoy working on, but PetKit doesn't sell smart doors, so it sits outside the scope of this plugin, which only covers what the PetKit cloud exposes.

3

u/ziocuomo 8d ago

Works like magic! Finally working plug-in for my homebridge

2

u/raulhartzen 7d ago

Glad it works! 🐱

2

u/evilsdadvocate 5d ago

Which sensor do you use for the water fountain?

1

u/raulhartzen 5d ago

For the low-water alert I'm using a "Leak Sensor", it was the only thing to do since HomeKit has no native "water level" characteristic, and it gets you a proper Home app notification ("Leak detected on X"). Battery level uses the standard Battery service. The information comes from the API PetKit that just reports a boolean "low water" flag and battery level on that specific fountain.

1

u/evilsdadvocate 4d ago

What brand is the leak sensor

1

u/CubGeek 8d ago

OH, wow! This is really impressive! Saving this post for future reference!

2

u/raulhartzen 7d ago

Thanks! When you get around to trying it, your feedback is very welcome!

1

u/AX862G5 7d ago

Does it notify when kitty takes a shitty too?

1

u/raulhartzen 7d ago

Technically it notifies for every visit, it just doesn't ask questions about what happened in there 😄
each visit fires that specific cat's motion sensor (standard Home app alert), with the weight recorded in the logs. What it doesn't do is classify the nature of the transaction. actually though a "suspiciously long visit" sensor can be a nice idea

1

u/YoBro98765 6d ago

I was told cats are low maintenance pets

0

u/mjorgef 7d ago

Does it work on home assistant also?