[Joseph DiGiovanni] is the owner of a Litter Robot 4. It’s a convenient mechanized litter box for cats that can clean itself to reduce unwelcome odors inside the home. He wanted to run automations based on the operation of the litter box, but was not eager to use the manufacturer’s cloud service to do it. Instead, he set about reverse engineering the device for his own ends.
Since the Litter Robot 4 relies on an ESP32 microcontroller for external connectivity, it was entirely possible for [Joseph] to whip up a custom firmware for the device instead. He started with ESPHome as a base, which is a popular firmware used for building smarthome devices based on Espressif hardware. The architecture of the Litter Robot 4 helped in this regard. It uses a PIC microcontroller to handle the low level hardware control, while the ESP32 is responsible for connecting to the cloud over WiFi. This allowed [Joseph] to mess with the connectivity features and get the device hooked up to Home Assistant without compromising the basic mechancial functionality of the device or any of the safety features.
All [Joseph] had to do was figure out how the original hardware’s ESP32 talked to the PIC and emulate that in his own firmware, which was achieved with some snooping and data capture and processing with an LLM. This was used as a basis to whip up an ESPHome firmware that could integrate the hardware neatly with Home Assistant.
Files are on Codeberg for those eager to tinker. It’s not the first time we’ve looked at cat litter management, and it won’t be the last. Video after the break.

Automated litter boxes are dangerous for cats. And sometimes scary. Enclosed litter boxes in general are a bad idea, especially in multicat home. Why? Because when one cat is doing its business, another can sand in front of the opening. The cat inside will be anxious and sooner or later will refuse to use an enclosed box…
More important question is why would anyone keep a cat in their home? It costs money, needs cleaning and leaves bits of fur everywhere. It’s not like we’re still living in 1700s farm shacks where mice were a major threat.
One of my cats leaves small “surprises” on the floors, tables and once on my keyboard (breaking Backspace key). And often I step into some of them as I am slightly almost blind. My wife wanted cats. I wanted a dog. So we have cats…
Should’ve gotten a bidet instead.
A roll of toilet paper is cheaper.
Better than kids.
Cat’s were only commonly in the home in the last 70 years or so. Before that time an effective indoor city litter was unknown. Fuller’s earth (Bentonite?) was for landscapers and was used as kitty litter by a gardener/cat lover.
If you start with a kitten you can teach them to use the toilet.
I thought you were going to say they were dangerous for having moving parts that can trap/injure cats, and was going to defend the Litter Robot specifically for having an extremely safe design, but you managed to come up with an even worse argument that is total nonsense. Congratulations.
Automated litter boxes can cause bodily harm to a cat, especially the cheap ones. In addition certain designs during operation end up with litter sticking to the “roof”, which can fall down on a cat causing more anxiety.
Cats don’t like enclosed spaces with only one way out. Especially when there are more than one cat. This is explained by many reputable cat behaviorists. And from my experience most cat owners (and pet owners in general) don’t bother to learn about their pets and their needs…
The Litter Robot has a curtain of ToF lasers and a weight sensor to detect the cat going in, 2 pinch panels on either side of the waste opening, motor current monitoring both slope and ceiling, and even a motion sensor in the drawer to detect a small kitten potentially stuck in there. Every one of those have to fail for a cat to be stuck/harmed. At no point would it rotate with a cat so much as sticking their head in so I’m not sure how anything could fall on them.
If your other cats are deliberately body-blocking the exit I don’t think they are fit to be together in the first place and the litter box you use is the least of your worries.
Umm, boxes? I leave boxes on their side around for the brown cat to sit in, so that she can feel safe and comfortable, while the white cat runs around amok.
“Cat behaviorist”, ha. Predicting cats is impossible. We just give them a warm place to stay, feed them, love them.
Predicting cats might be impossible, but smoking weed every day is a habit.
An open litter box is dangerous for cats. Why? Because another cat can sneak up behind them and tackle them. Sooner or later, they’ll refuse to use an open box.
The ESP32/PIC split is what I found most interesting here. Replacing the cloud-facing firmware while leaving the safety-critical control side alone seems like a much cleaner approach than trying to rewrite everything. Home Assistant integration without giving up the original safety features is a nice result.
It’s basically the only reason I attempted the project. Anything further is asking for trouble in a device like this. The Dreame robot vacuum featured in the video runs Valetudo as well, which piggybacks off the original firmware of robot vacuums so you get all the R&D and reliability of the original manufacturer’s work but with local control.
Superb, excellent work! I’ll definitely use this to interface to my LR4…. I’ve also got a LR3 as well, will be interesting/curious whether I can link to the PIC on that in the same way. 👍
Then I’ve got my “de-cloud” the cat-flaps project. 🤣
Thank you! There is a section of the readme on Codeberg that explains how you can help collect information for a port to the LR3. You can share your findings in the issue titled “LR3 Progress”.
There are two types of automatic cat litterboxes.
The ones where the opening is always open. It turns around but never closes the opening
The new ones that rotate the other way, closing the opening while rotating.
The first type is safe, the second type kills cats. Sadly, many cats have died due to the second type. Be careful what you buy, don’t just buy an automatic litterbox from China because the second type is all over Chinese retailer sites.