Quick Answer: To reverse engineer an air purifier, you put the device on an isolated Wi-Fi network, route its traffic through a man-in-the-middle proxy such as mitmproxy, and log what it sends and receives. For the Coway Airmega IconS, the goal is to find the local protocol so Home Assistant can control the fan without Coway's cloud. The process takes real networking work and can break when vendors update their certificates or firmware.

Your air purifier works fine until the cloud service it depends on goes down. That's the position one owner found himself in with a Coway Airmega IconS, a Wi-Fi fan that only responded to commands routed through Coway's servers. Most smart appliances follow the same pattern, and most owners never think about it until the integration breaks. Here's how one hobbyist approached the problem, what worked, what didn't, and what you should weigh before trying it yourself.

Why the Cloud Integration Keeps Breaking

The existing route to control this fan was a community-built Home Assistant integration. It logs in like the official phone app, polls Coway's IoCare cloud for status, and sends commands back through the same servers. Apple Home then talks to Home Assistant, which means a single "Good Night" button can shut off lights and bring the fan up to white-noise volume.

The problem is fragility. Across roughly a year, the integration broke for several reasons: Coway rate-limited it, rebranded the app from IoCare to IoCare+, changed the HTML layout the scraper depended on, went offline periodically, and banned an account running an older version of the integration. Each failure meant weeks of waiting for support or rewriting code. The owner's biggest fear is simpler: a discontinued model with a cloud dependency can lose its remote control entirely.

That's the practical case for local control. You want the device to talk to something you own.

Why the Obvious Approach Looks Hard

Most guides on this topic start with a clean idea: sniff the traffic, find the API, and talk to the device directly. The catch is that many IoT devices check the server's TLS certificate against a trusted root store. If the device is pinned to the vendor's certificate, a proxy can't impersonate the server, and your MitM setup just produces connection errors.

The author expected exactly that. A fake certificate would normally fail the device's validation check, and setting up the routing rules is tedious. Here's where many people give up: the networking is the easy part to describe and the hardest part to get right.

Two developments changed the calculation. In October 2026, a researcher publicly noted that eMudhra, a certificate authority trusted by many operating systems and devices, had used a weak parameter for some of its private keys. That means a device that is unpatched, ships with hardcoded root certificates, and doesn't pin the vendor's certificate might accept a proxy's certificate. That's a lot of conditions, and the author admits it. Still, it's a real foothold for research on a device you own.

The second change is that large language models can now generate most of the networking configuration in minutes. That lowers the barrier to building a test environment, but it doesn't remove the need to understand what the configuration does.

Building an Isolated Man-in-the-Middle Lab

The first attempt used a Raspberry Pi as a Wi-Fi access point, with mitmproxy in transparent mode. It failed for a mundane reason: the Pi's onboard PCB trace antenna was too weak to reach the fan from the router's room. The fix was to move the Pi next to the fan and bridge its Ethernet port through a laptop using Internet Sharing, so the Pi could reach the home network while also hosting its own network.

Once the Pi was in place, traffic from the fan's subnet had to be redirected to the proxy. The author used nftables rules to do three things:

  1. Redirect HTTP and HTTPS (ports 80 and 443) to mitmproxy on port 8080.
  2. Masquerade traffic from the isolated subnet out through the home connection.
  3. Reject IPv6 and other unexpected traffic so the device couldn't quietly bypass the proxy.

Mitmproxy's mitmweb interface then showed every request the fan made. Here's where the work got interesting: the first request the fan made was a plain HTTP download of Amazon's root certificate authority file. A device that downloads its trust anchor over unencrypted HTTP has no built-in root store to validate against. That was the single most useful clue in the entire investigation.

The Certificate Swap Experiment

The author hypothesised that if the device trusts whatever root certificate it downloads, the proxy could serve its own CA instead. A small mitmproxy addon did exactly that: it matched only the device's IP address, the specific S3 URL, and the AmazonRootCA1.pem path, then returned the proxy's own CA certificate in place of the real one.

Scoping the addon to one device IP and one URL matters. It limits the blast radius on your network and keeps the experiment from affecting other devices. Every experiment you run on a network you share should be scoped this tightly.

Note the limits of this approach. The author could only see requests that completed HTTP exchanges. If the fan rejects the proxy certificate during the HTTPS handshake, those connections never appear in the log, so an empty log doesn't prove the device is secure. It only means the traffic failed before it reached the application layer.

Comparison: Cloud, Local API, and Proxy Control

ApproachSetup effortDependence on vendor cloudTypical failure mode
Community cloud integration (Home Assistant)Low, install and log inHigh, every command goes through IoCareScraper breaks after app or HTML changes
Local protocol after MitM analysisHigh, networking plus reverse engineeringNone once the protocol is understoodFirmware updates or certificate pinning
Vendor official API (if published)Low to mediumMedium, depends on vendor policyDiscontinuation or paid tier

The local approach wins on long-term control but costs the most time. For most owners, a cloud integration with a backup plan is more practical than a full protocol reverse engineering project.

Intercepting traffic from a device you own, on a network you control, is generally a different situation from intercepting someone else's device. Still, the rules vary by country, and terms of service may prohibit reverse engineering or circumventing account restrictions. Read the vendor's terms before you publish findings, and never run interception against devices or networks you don't have permission to test.

There's also a real safety angle. A purifier is a box that runs continuously in your bedroom. If you change its firmware, a failed update could leave it stuck in a state you can't fix remotely. Keep a note of the original firmware version, and don't disable the device's own filter-change or air-quality alerts. Those alerts are the reason the thing exists.

Frequently Asked Questions

What is a man-in-the-middle attack on an IoT device?

A man-in-the-middle setup places a proxy between a device and its servers so the proxy can read and modify traffic. In security research it is used to understand how a device communicates. The technique only works if the device trusts the proxy's certificate, which is why certificate pinning blocks it. Use it only on devices you own and have permission to test.

How do I make my air purifier work without the cloud?

Start by checking whether the manufacturer offers a local API or a documented integration. If it doesn't, you'll need to capture the device's traffic on an isolated network and map its commands. Expect firmware updates to change the protocol, and keep a fallback like manual controls or the vendor app.

Why does the device download a root certificate over HTTP?

Some embedded devices have no built-in trust store, so they fetch a root certificate at setup and use it to validate later HTTPS connections. That design means the trust anchor itself travels unencrypted, which is a weakness. The fetch gives a researcher a chance to substitute a different CA, but only if the device accepts it.

It depends on where you live and what the terms of service say. Analysing a device you own on your own network is commonly treated more leniently than accessing someone else's system, but DMCA-style anti-circumvention rules exist in some countries. Consult local law and the vendor's terms before publishing or distributing any tools.

Pick One Step and Test It This Week

The most useful takeaway is this: before you spend a weekend on certificate tricks, check whether your device has a documented local interface or a stable community integration you can rely on. If it doesn't, document your current setup so you can recover quickly when the cloud changes. Try writing down your device's model, firmware version, and the exact commands your automation uses, then keep that file somewhere safe. Pass this to anyone wrestling with a cloud-locked appliance and a reverse engineer air purifier project that is starting to feel like a second job.

Source: scottjg.com, originally shared on Hacker News.