A scale with no app
I wanted a bathroom scale to talk to Durandal with no Xiaomi app and no account, so a 79-line program listened to its Bluetooth broadcasts, and the later recordings on the phone corrected three facts of the first one.
A listener before a screen
On 17 November 2026, a program of 79 lines on my Mac listened to a bathroom scale over Bluetooth and logged whatever it sent. The same day, the design of Durandal, my iPhone training coach, got a decision about that scale.
The brief, the document that holds the design's decisions, says that the screen ~/body/scale reads a Xiaomi Mi Body Composition Scale 2 "with no Xiaomi app and no account". It gives one reason: "the owner's request".
I'm the owner. That's the whole reason, and it's mine.
I didn't want another app and another account between me and my own scale. It just felt right.
One thing up front: no real weight and no real body value is in this Post. The boards of the design and the two clips use made-up values, and I name none of the recorded ones.
What the scale says to the room
The scale doesn't wait to be asked. The brief says it sends each weigh-in as a broadcast, a packet for every receiver in range, so there's nothing to pair and no key to hold: "No pairing and no key."
You find the packet by a standard number. The scale lists the service id 181B, which is body composition, and under it sends 13 bytes:
| Bytes | Content |
|---|---|
| 2 | control bytes, which hold the flags |
| 7 | the clock of the scale, in UTC |
| 2 | the impedance |
| 2 | the weight, in steps of 0.005 kg |
The impedance is how much the body resists a small current through bare feet. A scale estimates fat and muscle from it.
The flags are single bits that each say one fact. Three matter: the weight is stable, the impedance is final, the weight is removed.
Eavesdropping, politely
The program is 79 lines of Swift, and its README is clear about its manners: "It only listens to broadcasts: it does not connect to the scale and it sends nothing. It is not part of the app."
It scans for every device, so the log also shows which service ids the scale lists, and it runs for 240 seconds. For each broadcast with the scale's data it writes one line: the seconds from the start, the name of the device, the strength of the signal, the service ids, the raw bytes and the parsed fields. The first lines of the code give the purpose: "so that the weigh-in screen can be designed from real frames and times."
Two details come from the Mac. macOS gives Bluetooth only to a program that states why it needs it, so the program runs from a bundle with that sentence inside. And the log goes to a folder outside the repository, with a comment: "The log holds a real body weight, so it goes outside the repository folders."
One question was open before the first run. The README notes that two public sources name different bits for the flags. The recording settled it, and the README has the three bits.
The first recording lied a little
The first recording on the Mac was one weigh-in. The brief and the program's README have its facts: stable after 1.9 s, the final impedance after 6.2 s, the last broadcast after 23 s. The brief ends the list with a warning: "One recording is not a rule: record more before code, and one with socks."
So there was more. Later the same day, on the phone, five weigh-ins and one more that was heard only as a repeat. The build order of the design says what recorded them: a debug screen that lists the broadcasts. Above that second list the brief puts a line: "These facts correct the Mac recording above where the two differ."
Three things differ.
| The Mac recording | The phone recordings |
|---|---|
| an impedance value after 4.6 s | that value was a marker that the scale sends while it measures |
| the removal is sent for about 8 s | the scale repeats the removal for about 30 s, and when it wakes |
| 1 to 4 broadcasts in a second | 4 to 12 broadcasts in a second, with the app in front |
The first row is the real slip. After the weight is stable, the two impedance bytes read 0, then a marker, a fixed number that measures nothing, then the value together with the final flag. The "impedance value after 4.6 s" of the Mac recording was the marker. That annoyed me, but it's better to find out before the code.
The clock doesn't name a weigh-in either. While the weight moves, the clock runs. Once the weight is stable, it stops. The brief's conclusion: "So the clock does not tell one weigh-in from the next; the removal does."
And a repeat isn't a new weigh-in. When the phone started listening, it heard a removal that was 17 minutes old.
Four of six
One entry of that list starts: "Four of six weigh-ins never became final." The scale stayed on the marker, and no impedance came.
The brief rules out one cause. In three of the four, the weight was stable for 6 to 9 seconds, longer than the 4.9 seconds of the two that did become final. So a step off the scale that was too early doesn't explain them.
The cause it gives is a statement of mine, made after the recordings: more than one of the weigh-ins was with socks. The brief adds that no weigh-in with bare feet is known to have failed.
Socks. That's my theory, and no test of socks is in the sources.
The rule in the design came from it anyway. When the weight is removed, or 8 seconds after stable, with no final flag, the weigh-in keeps the weight only.
The sheet, designed and built
Six boards draw the scale, each one a single screen with made-up values, and a script writes them. The sheet for a weigh-in has four steps: "step on the scale.", "stand still.", "wait for the composition.", "step off."
The brief ties the steps to four events: the first broadcast, the stable flag, the final impedance, and the removal, which closes the sheet. One board is for socks: "kept: the weight only." with the line "no impedance came in 8 s. stand with bare feet for the composition."
Another board asks "yours?". The scale sends the weigh-in of whoever steps on it, so the design keeps a weigh-in by itself only when it's within 3 kg of the last one.
The simulator has no Bluetooth, so the app has a demo switch that plays two weigh-ins through the scale at the pace the phone recorded, with made-up weights. These two clips are from that run, on a clean simulator with none of my data.
On a clean phone, the first weigh-in has nothing to compare with, so it asks "yours?" too. The second is 0.3 kg off the first and keeps itself. Neither shows a composition: it needs a height, a birth date and a sex from Apple Health, and the simulator has none of them.
What nobody has heard yet
Here's what isn't settled:
- A locked phone isn't checked. The phone heard 114 broadcasts in the background while it was unlocked. A locked phone, a long time in the background and a closed app aren't checked.
- The licence of the formulas isn't clear. Fat and muscle are estimates from formulas. The brief names a port with an MIT licence as their source. The port is reverse engineered from the maker's app, and the brief says its origin has no licence of its own: "look at this again before the app is given to anybody."
- A weigh-in that nothing heard. The scale repeats a whole result. The brief has the question open for me: when the app was closed, "does the app offer to keep it?"
- The recordings are few. The Mac recording is one weigh-in on my scale, and the phone list has six.
So the scale keeps talking to the room, as it did for the Mac and for the phone. It's too early to say more than that. What I don't know yet is who's listening when the phone is locked, or the app is closed.