Joseph DiGiovanni has built a working Litter Robot 4 custom firmware that replaces the device’s factory ESP32 code with an ESPHome-based alternative, freeing the self-cleaning litter box from its manufacturer’s cloud entirely and bringing it natively into Home Assistant.
The Litter Robot 4 uses a split-brain architecture that, as it turns out, is rather friendly to this kind of intervention. A PIC microcontroller handles all the low-level mechanical control (the rotation, the safety sensors, the cycling logic) while a separate ESP32 module sits on top, responsible only for WiFi connectivity and cloud communication. That clean separation meant DiGiovanni could replace the ESP32’s firmware wholesale without touching the PIC or compromising a single safety feature the device ships with.
Getting Inside: Spare Board and Conformal Coating
DiGiovanni was careful from the outset. Rather than risk his own unit, he purchased a spare Litter-Robot 4 mainboard to use as the development target. To reach the ESP32’s programming interface, he scraped away the conformal coating covering an unpopulated debug header on the board and soldered on a six-pin connector, as Hackster.io details. It is exactly the kind of methodical hardware preparation that separates a clean, repeatable mod from a one-way trip to a bricked appliance.
With physical access to the ESP32 secured, the next challenge was understanding how it actually talks to the PIC. DiGiovanni captured UART traffic while pressing buttons on the litter box and issuing commands through the official mobile app, using that data to decode the serial protocol running between the two chips. An LLM was brought in to help process and interpret the captured data, turning a raw stream of bytes into a readable map of the command structure.
Litter Robot 4 Custom Firmware: From YAML to C++
DiGiovanni’s development process was disciplined. He first verified the concept using ESPHome YAML configuration to confirm his understanding of the protocol was correct before committing to anything more involved. Once satisfied, he moved the implementation into a dedicated C++ ESPHome component that generates commands, parses responses from the PIC, and exposes the full set of controls and states to Home Assistant as native entities.
The result is Litter Robot 4 custom firmware that gives Home Assistant full visibility into the device: cycle status, drawer fullness, cat weight readings, and manual controls, all available as local automations with no round-trip to any external server.
No Cloud, No Telemetry, No Single Point of Failure
The practical benefits of cutting the cloud go beyond convenience. The project eliminates any telemetry leaving the home, removes the AWS dependency the stock firmware relies on, and sidesteps the risk that a future server shutdown would strand an otherwise functional piece of hardware. Anyone who has watched a connected device become a paperweight after a manufacturer winds down its backend will appreciate why that last point matters. The Litter Robot 4 custom firmware means the device works for as long as the hardware does, full stop.
All files are published on Codeberg for anyone wanting to replicate or build on the work. The split between PIC and ESP32 in the Litter Robot 4’s design turned out to be the enabling condition here: it is not always the case that a manufacturer’s architecture is this cooperative with a determined tinkerer, and DiGiovanni made the most of it. The project files are waiting on Codeberg for your next Saturday afternoon.

