The project reverse-engineers a connected litter box so it can be controlled and monitored through Home Assistant. The goal is to add dashboard controls and eventually automate cleaning when the cat is elsewhere. Because the phone app already provides access, its network traffic and Android code reveal how to reproduce the necessary requests. The HTTP API supplies device information, waste levels, and visit records, but requests require more than copied URLs and headers: each needs a fresh MD5-based signature formed from a timestamp, app key, nonce, and client identifier. The app first discovers region-specific settings using an embedded bootstrap key, then uses the regional credentials for login and later API calls. Account tokens are kept until near expiry, with a retry after an unauthorized response.
Cleaning commands take a separate route: the app publishes them over MQTT rather than making an HTTP request. HTTP calls provide broker credentials and messaging topics, while a device messaging ID - not its serial number - identifies the recipient. The command itself starts as a four-byte Protocol Buffers payload, then passes through a RISP frame with headers and CRC checksums, several protobuf wrappers, and an outer messaging envelope. Decompiled code, Frida hooks, and MQTT captures help identify and inspect each layer; recreated Python schemas make messages easier to build and decode. The resulting service can publish commands that operate the physical box, expose status through API endpoints, and offer Home Assistant controls for cleaning, clearing, smoothing, and starting, pausing, resuming, or stopping operations.
Summary generated by AI from the linked article. hn.today is not affiliated with Hacker News or Y Combinator.