CodedCactus
Welcome! This site is a collection of my work and experiments at the intersection of hardware, software, and curiosity. I spend a lot of time building and modifying things — from smart home systems powered by Home Assistant and ESPHome, to custom 3D-printed parts and electronics projects.
You’ll find projects where I reverse-engineer devices, design and print components, and create practical solutions for everyday problems. Many of these builds combine automation, embedded systems, and hands-on prototyping.
This space serves as a project log — a place to document ideas, share what I learn, and explore new challenges along the way.
Reverse engineering modbus protocol
Recently, I started an effort to integrate the heat recovery ventilation (HRV) system into my Home Assistant setup. The house is equipped with a Zehnder ComfoAir E300, but after an extensive search I couldn't find any existing integrations for this particular model. I did however found an issue hinting at an undocumented connector that was connected to a level shifter, suggesting a serial interface was available. /// caption Schematic showing the IC connected to C3. /// I disassembled the device, probed the PCB with a multimeter and followed the traces from the connector. The result can be seen in the figure above. The IC is an SN65HVD72 half‑duplex RS‑485 chip, which confirms the presence of a serial interface. Since RS‑485 is commonly used with the Modbus RTU protocol, this was a good starting point to reverse engineer the interface. Modbus protocol Modbus is a half‑duplex messaging protocol for communication between (industrial) devices. The underlying physical layer is often serial (RS232, RS422 or RS485) or TCP/IP. A complete description of the protocol can be found here. In short, it supports reading and writing binary (RTU) or ASCII data to four different register types. Each register contains a large range of addresses which hold data. The different register types are: - Coil Status -- (Read/Write) on/off values.