$ show Hypfer/Valetudo
Valetudo is a production-grade, self-contained control web interface for robot vacuums. It replaces vendor cloud services by running directly on the vacuum's embedded Linux hardware and communicating with the robot over reverse-engineered local protocols (MiIO/MIoT for Dreame and Roborock, MSmart for Midea, and 3irobotix for Viomi). The backend is a Node.js/Express application that exposes a REST API with OpenAPI schemas, server-sent events for live state/map/log updates, MQTT integration for Home Assistant and Homie discovery, an updater for over-the-air firmware-style binary updates, timers, consumables, and map management. The frontend is a React/TypeScript SPA with a canvas-based interactive map renderer, manual control, provisioning, timers, updater UI, and configuration pages.
The LLM identified 6 files worth highlighting for reuse:
Low-level UDP socket implementation of the Xiaomi MiIO protocol, including packet encryption, message IDs, timeouts, retries, and error classification. It is isolated enough to be extracted for any project needing to communicate with MiIO-compatible devices and demonstrates non-trivial binary protocol engineering.
A hash-based deduplication cache that suppresses redundant publishes/updates when values have not changed, with SHA1/MD5 selection based on CPU architecture. It is a self-contained utility solving a recurring distributed-systems problem: avoiding unnecessary network traffic and memory growth on resource-constrained devices.
A reusable server-sent events hub that manages client subscriptions, keeps connections alive, detects stale clients, and broadcasts events. This is a cleanly abstracted real-time messaging pattern that could be lifted into any Node.js web application requiring SSE push updates.
Solves the four-color theorem for map segment coloring on arbitrary planar-ish segment graphs. It is self-contained TypeScript demonstrating non-obvious algorithmic skill and can be reused in any canvas-based map or floor-plan renderer needing deterministic, distinct adjacent-region coloring.
Decodes vendor-specific binary map files into a normalized map model, including segmentation, paths, virtual restrictions, and coordinate-space conversion. It is a strong reference example of safely parsing undocumented binary formats with many firmware-version fixtures and unit tests.
Abstract base class for MQTT handles that builds a tree of Node/Property handles, marshals get/set operations, and emits Homie-compatible attributes. The hierarchical MQTT abstraction is reusable for any device-integration project that needs structured MQTT topics with discovery metadata.