tuya-pet-feeder-reverse-engineering
De-clouding a Tuya WBR3 pet feeder for local Home Assistant control
How one person removed cloud dependency from a Tuya pet feeder by replacing its WiFi module with an ESP8266 and documenting the serial wire protocol for local Home Assistant control.
This repository documents one person's process of removing the cloud dependency from a Tuya-branded pet feeder and making it work entirely through Home Assistant, a local home automation platform. The project involved replacing the original WiFi module inside the feeder with an ESP8266 (a small programmable microcontroller), then writing custom firmware so the feeder could be controlled directly from a home network rather than through Tuya's servers.
The feeder turns out to be a two-chip design. A dedicated chip on the main board controls the motor, sensors, and buttons. A separate WiFi module sits alongside it and communicates with the cloud. The key insight is that you do not need to touch the chip running the motor: you only need to swap the WiFi module for an ESP8266 that speaks the same communication language to the motor chip, but routes commands through Home Assistant instead of the internet.
Most of the document is a protocol reference covering exactly what bytes get sent over the serial connection between the WiFi module slot and the motor chip. The protocol is not the standard Tuya format, which is a common trap that wastes troubleshooting time. Frames are eight bytes long, use a different header, and compute the checksum differently. The document maps out the command codes for actions like triggering a feeding, reading the battery level, and detecting whether the food magazine is empty.
Several sections cover specific problems encountered during the reverse-engineering process, such as what happens if you reply to the wrong frame type (the motor feeds continuously), how the physical button on the feeder works (the WiFi module must respond to a button press message or the button stops working), and how to power the ESP8266 from the feeder's own board without damaging anything.
The README does not include finished firmware code ready to flash, because the exact setup is hardware-specific. Instead it provides the wire protocol details and lessons learned that someone could use to build their own implementation for a similar device.
Where it fits
- Replace the cloud WiFi module in a Tuya pet feeder with an ESP8266 to control it locally without internet.
- Implement custom firmware that speaks the feeder serial protocol and routes commands through Home Assistant.
- Use the documented wire protocol as a reference when reverse-engineering other Tuya devices with similar two-chip designs.