How a €15 smart plug went from phoning home to a server in another country, to reporting straight to my own home network — and what it took to get there.
ACT I
I bought an cheap smart plug of aliexpress. The kind you screw into a wall socket, plug a heater or a bunch of vintage lava lamps into, and then switch on and off from your phone. Mine could also measure how much electricity the appliance was using — genuinely useful if you're trying to find out what's quietly eating your power bill.
There was a catch, and it's the same catch in almost every cheap smart plug on the market.
To see any of that energy data, I had to install the manufacturer's own phone app and create an account with them. Not a local connection to a device in my hallway — a login, with an email address, to a service run by a company in Shenzhen I'd never heard of before I opened the box.
And the data took the scenic route. Switching the plug on and off worked locally. But every power measurement it took — every watt, every kilowatt-hour — was uploaded to the manufacturer's servers in China before I could see it. My laptops energy consumption made a round trip halfway across the world so that it could come back to a phone sitting three metres away.
To be clear: I don't think there was anything sinister going on here. This is just how these products are built. But it means three things, none of them good:
Yet another account, for yet another app, to read a number measured in my own hallway.
There's a good open standard that fixes exactly this: Matter . It's the industry-wide smart-home standard backed by Apple, Google, Amazon and Samsung, and it's designed to work locally — your devices talk to your home, not to the internet. Ikea uses it for their own smart devices too. My plug even advertised Matter support. It just used it for the on/off switch, and kept the interesting part — the energy data — behind the cloud.
So I decided to replace the plug's brain.

ACT II
The plug's board is really two parts. There's the electrical machinery — the relay that physically switches mains power, the chip that measures voltage and current, the button, the status lights. And there's a small plug-in wireless module: a fingernail-sized computer that reads the sensors, drives the relay, and talks to the network.
The machinery is fine. It's well made and it does its job. The only part I objected to was the software on that little module.
So the plan was simple to state and fiddly to execute: unplug the manufacturer's brain, and plug in one I control.
That raised the obvious question. If I remove the module, how do I know what the rest of the board expects from it? There's no documentation for this. There are eleven electrical contacts where the module sits, and no labels on any of them.
I worked it out two ways.
First, by following the copper. Under magnification you can literally trace the wires printed on the board, from each contact to whatever it connects to — this one goes to the relay, that one to the button, these three to the metering chip.

Second — and this is the part that actually settled it — by reading the manufacturer's own software. Before removing the module, I extracted the program stored inside it and disassembled it: turning the raw machine code back into something readable. The original code was scrambled, so it had to be decrypted first, but once open it answered every question. Which contact drives the relay. How often the meter is read. And critically, the calibration constants — the correction factors that turn raw electrical pulses into an accurate wattage.
Those numbers matter enormously. The metering chip doesn't output "247 watts." It outputs a stream of pulses, and how many pulses equal a watt depends on the specific resistors on this specific board. Guessing would have meant readings that were confidently, invisibly wrong. Reading them out of the factory's own software meant starting with numbers that were already right.
It also confirmed my suspicion in black and white. Buried in the code were the exact addresses the plug was calling home to — the vendor's API and login servers — and the logic that bridged the on/off switch to Matter locally while quietly shipping the energy readings off to the cloud on the side. The open standard was doing the easy half. The half worth having went to Shenzhen.
ACT III
The replacement is a Seeed XIAO nRF52840 — a general-purpose wireless microcontroller about the size of a postage stamp, the kind of thing hobbyists and startups build products on. It costs under €10 and, unlike the original module, I can put whatever software I like on it.

I unsoldered the factory module and wired the new board onto the same eleven contacts (only 8 where used), matching the map I'd traced.

Then I wrote firmware for it. The new software:

The payoff is the screenshot below. This is the plug appearing in Home Assistant — an open-source home automation system running on a small computer in my own house. I didn't write an integration, a plugin, or a driver for it. Home Assistant simply asked the plug what it was, the plug answered in standard Matter, and every control and sensor appeared by itself.
No app. No account. No password. Nothing leaves the house — the plug has no idea the internet exists. If the manufacturer disappeared tomorrow, it would not notice.
IN CLOSING
⚠ Mains safety
This involves mains electricity, and mains electricity kills. The metering chip on this board is not electrically isolated — parts of the low-voltage circuitry sit at mains potential.
All the development work was done with the plug disconnected from mains and powered from USB. Connecting both at once would put your laptop at mains voltage. This is not a beginner project, and I'm not suggesting anyone reproduce it casually.
And the wider point. The hardware in these devices is usually good — genuinely well made, and cheap because it's manufactured at enormous scale. It's the software, and the business model behind it, that puts an expiry date on them. A plug that works perfectly becomes e-waste because a server was switched off in a country you've never visited, or because an app was pulled from the store.
That's not a criticism of where the thing was made. It's a criticism of building a physical object that stops working when a subscription does.
Open standards like Matter are the way out of that, but only if devices actually use them for everything rather than as a checkbox on the packaging. Until manufacturers do that by default, the alternative is doing it yourself.
Firmware, wiring diagrams and the full teardown notes are on GitHub. Built on Nordic Semiconductor's nRF Connect SDK with the open-source Matter stack.
Preview