Yash Tulsiani wanted Home Assistant to operate his cat’s litter box. The phone app already had that ability, so he traced its traffic and reconstructed the protocol. The project became an investigation of two separate paths: signed HTTP requests for account and device data, and binary messages for control.
- Treat errors as incomplete evidence. Copied requests returned
401 Unauthorized. Searching the decompiled Android app for the changing signature header revealed its inputs; following regional setup supplied the matching app configuration. - Look beyond the first transport. Pressing Clean produced no new HTTP request. Startup responses exposed credentials for MQTT, a brokered messaging protocol, where subscribing revealed the command traffic.
- Rebuild every wrapper. The cleaning operation fits in four bytes, but travels through a framed command and several Protocol Buffers envelopes. Putting the right bytes in the wrong envelope still produces the wrong message.
- Inspect intermediate bytes. Runtime hooks captured the app’s output at several serialization layers. Generated protobuf classes then let the Python implementation build messages from named fields.
- Hide the machinery behind a small interface. A local HTTP endpoint handles the command construction and messaging. Home Assistant gets a cleaning button and readable status values.
Tulsiani reports that the reconstructed command operated the physical box. The bridge still uses the vendor’s cloud API and MQTT broker; presence-triggered cleaning remains a next step.
Layer-by-layer observation makes this a good debugging case study. Capture a known-working action, find where your reproduction diverges, and give each protocol boundary its own visibility.