WADA-DEV(7) $ /en/blog/japan-scale-unit-switch-measurement-act/

NAME

japan-scale-unit-switch-measurement-act — Why My ESF-551 Scale Kept Disconnecting from Home Assistant: Japan's Measurement Act

SYNOPSIS

A BLE body scale bought in Japan, an Etekcity ESF-551, dropped its connection to Home Assistant the moment it got the set-display-unit command. I went looking for a library bug and ended up reading a statute.

DESCRIPTION

I connected an Etekcity ESF-551, a BLE body scale, to Home Assistant, and not a single measurement arrived. I had Claude Code chase the cause, and it ended at Article 9 of Japan’s Measurement Act. Units sold in Japan have the unit switch removed because of that law.

I know nothing about firmware or law. What I did was step on the scale and decide what to have it look into next. Without AI, I couldn’t have done this investigation.

Nothing comes back when I step on it

I used the HACS integration etekcity_fitness_scale_ble, which wraps etekcity_esf551_ble==0.8.4. Claude Code read the log: it showed the integration connecting, reading the HW/SW versions, writing the unit command a5220305002b0163a10000 (unit 0, kg), and getting disconnected about 0.4 seconds later. Then it reconnected and did it again. No notification ever came when I stepped on the scale, and every sensor stayed unavailable.

It happened even when the command changed nothing, kg to kg.

Skip one command and it works

I left the narrowing down to it too. Claude Code subscribed to 0000fff1 from another machine with plain bleak and left out only the unit write. No disconnect. While I stood on the scale, 22-byte notifications arrived about every 45 ms, around 80 of them.

So Claude Code wrote a local patch that passes display_unit=None and skips the write. All 14 sensors filled in. I had it write the upstream issue too, and filed it (etekcity_esf551_ble #15).

Up to here it was a story about fixing a library bug.

Only the US manual has a unit setting

I had it look for why only the Japanese version lacks a unit switch. The VeSync app has no unit setting, while the US manual has the steps.

Putting the back label next to the US spec showed this was a different market variant, not just a firmware revision. Japanese devices and IoT, again, I thought.

US ESF-551The unit I bought in Japan
Capacity400 lb / 180 kg2–150 kg
Resolution0.05 lb / 0.02 kg100 g
Radio approvalFCC ID 2AB22-ESF551Giteki R 210-252428
Measurement Actnonehousehold “正” mark

Claude Code also pulled the Measurement Act from the e-Gov law API and read it. Article 9 forbids selling, or displaying for sale, a measuring instrument marked in non-statutory units. A scale that can show lb or st can’t be sold in Japan, so manufacturers drop the unit-switch feature from the Japanese firmware. Weighing myself is neither a transaction nor a certification, so Article 8 doesn’t touch the user. Only the seller is bound.

The Ministry of Economy, Trade and Industry’s FY2015 test-purchase report even has a real case: a vendor who didn’t know pounds and stones were prohibited was told to seal the device so it couldn’t be switched.

Whether the disconnect is deliberate, I don’t know

What I know is why the Japanese version has no unit switch. I can’t tell whether the disconnect itself is intended, or just firmware that doesn’t know the command and drops the link sloppily. Removing the feature is fine. I just suspect it was removed carelessly. I only have one unit, so I can’t say that model identifier 12 in the manufacturer data marks the Japanese variant. For upstream I suggested registering identifier 12 with display_unit_settable=False so the write is skipped, and left the call to the maintainer.

An experiment that sends an unknown opcode to see how it disconnects is still undone.

Fixed the next day

The day after I filed the issue, the maintainer replied.

That’s interesting to know about that Japanese regulation. That would explain it I guess, and since the option doesn’t even show up in the app that pretty much confirms it I think.

Library v0.8.8 and the HA integration 0.8.3 came out the same day. I updated the integration to 0.8.3, removed my local patch, stepped on the scale, and the measurements came through. That was surprisingly fast, and I’m grateful.

Self-hosting Home Assistant is a chore. But it brings lessons like this one, from a bathroom scale all the way to a statute, and I’m glad I do it.

COMMENTS