How to add Xiaomi Mijia scale S400 (model: MJTZC01YM) into Home Assisstant

OK I got it to work, and I believe I know the issue.

  1. Go to: Devices & services → Bluetooth → CONFIGURE → CONFIGURE BLUETOOTH OPTIONS -
    Passive scanning (CLICK the box)
  2. Restart Home Assistant - Reboot system



If that does not help do this:
3. Remove the scale from the MiHome app and FORCE close it
4. Stop the Bluetooth on your phone
5. Reboot the scale (on the bottom there is a small hole, stick a needle and hold it for 10 sec)
6. Remove Xiaomi BLE integration
7. Restart Home Assistant
8. It should be auto discovered now and added, and will ask you to - Repair: Authorization for the Xiaomi BLE Scale was “expired”
9. Enter email and password
10. Step on the scale for 30+ seconds
11. Restart Home Assistant
12. Step on the scale for 30+ seconds
13. Check again, WHOLAAA you should have more than “signal strength”

NOT ALL of those steps are needed!!! IT might show up after step 2, but if NOT then dig in. Somewhere at some point it worked for me. Feel free turn ON your phone Bluetooth and open MiHome app again and add the scale if you feel like. IT should be OK.

P.S. It takes some time ~ 5-10 min or so for all the data to show up.

Don’t forget to install and set up properly the BodyMiscale integration: GitHub - dckiller51/bodymiscale: Custom_components Body Metrics for Xiaomi Miscale 1 and 2 (esphome or BLE monitor for Homeassistant)
This will translate all the measurements into the HA.

One more little quirk I forgot:

  • I have no BT adapter on my HA server (it runs on Proxmox) but use ESPHome Bluetooth Proxies.
  • At the point where you have to enter email & password, the “Xiaomi Home” app should be open for some reason.
  • Once it has integrated, HA will show all values grayed out (unavailable), since the Xiaomi Home app has paired (and thus blocked) the scale.
  • Close the Xiaomi Home app on your phone completely (it will try to keep running in the background).
  • If that fails, disable Bluetooth so the device cannot be accessed anymore.
  • Weigh yourself again, to initiate a new transmission.
  • After a few seconds, HA should start populating the values.

And yes, it works nicely with only ESP BT proxies (i.e., no HA BT host adapter).

Does it have the Same Features as the mi scale 2?
Can it also track multiple persons?
I want to buy me a mi scale but i also want the values in Home Assistent

Thank you for your very detailed instructions. I will try again

Hi!
I’m able of getting only weight and impedance…
Where can I find an algorithm to get the body fat, better than this?

{% macro calculate_body_fat(weight, height_cm, birth_year, gender, impedance) %}
  {% set height_m = height_cm | float / 100 %}
  {% set age = now().year - (birth_year | int) %}
  {% set bmi = weight | float / (height_m ** 2) %}
  {% set base = (1.2 * bmi) + (0.23 * age) - (10.8 if gender == 'male' else 0) - 5.4 %}
  {% set imp_adj = 0.2 * (impedance | float / height_cm | float) %}
  {{ (base + imp_adj) | round(2) }}
{% endmacro %}

For some reason I can’t get this scale to work.

I have this scale. The manual states it is this exact model.
It is fully functional and linked to the Xiaomi app and listed as a “Mijia Body Composition Scale S400”. Firmware version is “2.1.1_0057.0077”. (Latest version, which was already installed when bought.)

I’m using a Bluetooth proxy for Home Assistant, which is functional for other devices. (Temp/humid sensors.)

Trying to add a Xiaomi BLE device in HA tells me: “No devices found on the network”, with no possibility to manually add something.

I’ve unlinked the scale from the app, reset the scale, linked again, used it when linked / unlinked, etc…
None of these actions give me anything related to this scale in the debug logs. Not on the ESP Bluetooth proxy, and not in the Home Assistant debug logs for Xiaomi BLE.
However, the scale is visible in the “Bluetooth advertisement monitor” in HA.

Does this only work with specific models/variants?
Mine identifies as “yunmai.scales.ms103” in the Xiaomi cloud when I get the bind key, but obviously I have currently no place to use this key anywhere.

Is a scale and Bluetooth connectivity enough to integrate with HA or does it also need the Xiaomi gateway?
Any troubleshooting tips?
Am I doing something completely wrong?

Thanks in advance!

I think I understand why it isn’t working for me: Please also add support for Xiaomi Body Composition Scale S400 Pro - MJTZC03YM, xiaomi.scales.ms110 · Issue #182 · Bluetooth-Devices/xiaomi-ble · GitHub

Hi,
I ordered the white S400 and also have trouble connecting it.

It is discovered but added with only signal streng entity.
It is discovered as “Body Composition Scale E4BA (MJTZC01YM)”

I already installed Core 2025.6 and the Miscale Integration and the miscale Card, but no Entities for the scalöe have been added.

Yes I’m also having the same issue. It gets discovered, it adds, but only shows the signal strength but nothing further. Running 2025.6.1

Sometimes after you step for 30 seconds, that is a trigger for the authentification.
I did that and it appear. The problem is that i just cant login to my account. I try everything and i dont know why it wont accept the password, using same email and password as the Xiaomi Home app

I try again today and now the error is

Unknown error ocurred

Hey guys, it’s probaby not working due do some changes on how Xiaomi handles login, now it requires a captcha verification. Someone has already implemented a workaround/fix. If you’re savvy enough, you can do those changes yourself, if not, you’ll have to wait for a bit till they merge a fix.

Sorry if I’m bumping an older thread, but it seems a bit weird opening a new one…

I’m just wondering since it’s not clear from what I’ve read:

  • So basically I need to have the xiaomi app installed to get scale working in HA?
  • Do I need mqtt? cause some github repo’s reference it as a setting. I don’t run mqtt and I’m not planning to.
  • Do I need an HA addon to get the values?

I already have a temp sensor running via esphome ble proxy working fine and all it needed was setting the MAC. It was simple and easy. New ones seem to have been ‘bolted down’ When buying I was under the impression all was needed was this in esphome Xiaomi Miscale Sensors — ESPHome

If it’s that difficult to get the xiaomi scales and sensors working in HA I think I’ll cut my loss and just stop buying xiaomi

Tnx

Hi, I can answer these:

  • AFAIK, you only need to install it once, pair you device to the app and then retrieve the bind key from the server (which is why it asks for your MI account in the screenshots above). Once you have this bind key, your HA will be able to connect to the scale and get all the values measured. After that, you can uninstall the app from your phone and use your scale locally.
  • No, not needed.
  • You need HACS to get mibodyscale.
    Not sure if this applies to all Xiaomi device, tbh this is my first smart device. I’m a new guy to HA!
1 Like

Can anyone share extra tips on how to get the password prompt.
I’m also stuck with a connected scale and only signal strength as discovered entity.
I can’t get the authentication window to pop up no matter how often I stand on this scale. I’ve tried every variation of alexvaltchev’s May 8 post without getting any further than this. Any pointers would be greatly appreciated.
I’m on Home Assistant OS 15.2, Core: 2025.7.1

It’s working now…
In case it helps someone else I’ll describe the situation before and what I did that seems to have fixed it.

How I started:

  • HA OS 15.2, Core 2025.7.1
  • Scale was connected to Xiaomi Home App on smartphone, then I broke the bluetooth connection from the smartphone’s bleutooth controls & shut down the phone foor good measure.
  • Installed Xiaomi BLE integration in home assistant and reset the Scale by holding the button for 10 seconds, this made Xiaomi BLE detect the with just the signal strength entity. This is where i got stuck.

The actions that seem to have helped:

  • I deleted the scale from the Xiaomi Home App & reset the scale with the button once more.
  • Then I added it to the Xiaomi Home App again and maesured myself once.
  • I shut down the phone, and measured myself once more
  • This finaly triggered the Authentication Expired notification in Home Assitant.

Authenticating:

Since Xiaomi is now implementing 2FA and I didn’t know if the solution for this was already merged with the current build, I chose the route known to those that have allready intergrated the xiaomi temperature & humidity sensors.

At the link below you can download a token extractor to grab ecryption key’s stored in you xiaomi account:
https://github.com/PiotrMachowski/Xiaomi-cloud-tokens-extractor?tab=readme-ov-file
Sign in to your xiaomi account (preferrably through a chrome browser) then start the token extractor, enter the credentials for you xiaomi account in the extractor and then the 2 letters of the listed country nearest to you. (The chrome browser login provides a 2FA token that can be picked up by the token extractor, enableing you to log in with just username and password)
This will spit out a list with all devices known to you xiaomi account including their respective BLE Key’s.
You can use the scale’s BLE key in the Authentication Expired notification in Home Assitant (instead of logging in).

I hope this is of use to someone.

2 Likes

My new project for smart scale synchronization with support this model:

1 Like

Hello everyone,

I’m hoping for some help with a strange issue regarding my Xiaomi scale and its Home Assistant integration.

I’ve successfully added the scale to Home Assistant, and the weight entity works perfectly. However, I’ve noticed a specific change in the scale’s behavior.

When I use the scale with the official Xiaomi Home app, it first measures my weight, and then the display switches to measure my heart rate. This is the normal operation.

But, when I step on the scale while it’s integrated with Home Assistant, the process stops right after it measures my weight. The scale itself never proceeds to the heart rate measurement phase. Consequently, only the weight data is sent to HA because the heart rate measurement is never even triggered.

It seems the Home Assistant integration is somehow preventing the scale from completing its full measurement cycle. Has anyone else encountered this specific problem? Is there a setting I might be missing that allows the scale to run its heart rate check after weighing?

Any advice would be greatly appreciated. Thanks!

1 Like

I do not have this problem:

HAOS 25.8.3
Esphome Bluetooth Proxy 2025.8.2
S400 Scale

Try reload your Bluetooth Proxy/ Xiaomi BLE/Scale configuration ín HA.