Github Devices Community Docs Blog

ESP32 BLE Scale support XIAOMI / YUNMAI

Is the Xiaomi Scale required any authorization like PIN code with the Android or Apple application?

Here is some information that should help me supporting the Yunmai if equal to Mi Scale V2:

Thank you I will take a look

With the information provided in this link I should be able to integrate both versions of mi scale, once done if you could test it, you will enable to validate the code.

Yes I’m willing to help with testing.

I have updated the code with Xiaomi Scale V2 implementation:

If you can test it and post your serial monitor/MQTT output it would be nice.

Here is the serial monitor/MQTT output :

— Miniterm on COM5 115200,8,N,1 —
— Quit: Ctrl+C | Menu: Ctrl+T | Help: Ctrl+T followed by Ctrl+H —
mounting FS…
mounted file system
reading config file
opened config file
parsed json
*WM: [3] allocating params bytes: 20
*WM: [2] Added Parameter: server
*WM: [2] Added Parameter: port
*WM: [2] Added Parameter: user
*WM: [2] Added Parameter: pass
*WM: [1] AutoConnect
*WM: [2] ESP32 event handler enabled
*WM: [2] Connecting as wifi client…
*WM: [1] STA static IP:
*WM: [2] setSTAConfig static ip not set
*WM: [3] WIFI station disconnect
*WM: [1] Connecting to saved AP: xxxxxxx
*WM: [3] Using Password: xxxxxx
*WM: [3] WiFi station enable
*WM: [2] 5000 ms connectTimeout set
*WM: [2] 5000 ms timeout, waiting for connect…
*WM: [2] .
*WM: [2] .
*WM: [2] .
*WM: [2] .
*WM: [2] .
*WM: [2] .
*WM: [2] .
*WM: [2] .
*WM: [2] .
*WM: [2] .
*WM: [2] Connection result: WL_CONNECTED
*WM: [3] lastconxresult: WL_CONNECTED
*WM: [1] AutoConnect: SUCCESS
*WM: [1] STA IP Address:
connected…yeey :slight_smile:
saving config
{“mqtt_server”:“”,“mqtt_port”:“xxxx”,“mqtt_user”:“xxxx”,“mqtt_pass”:“xxxxxx”}*WM: [3] freeing allocated params!
*WM: [3] unloading
OpenMQTTGateway mac:
OpenMQTTGateway ip:
Connecting to MQTT by IP adress
BLEinterval btw scans
ZgatewayBT multicore ESP32 setup done
Setup OpenMQTTGateway end
BT Task running on core 0
client disconnected
MQTT connection…
Connected to broker
Subscription OK to the subjects
Creating BLE buffer
device detected
Pub json into:
Pub json into:

It seems that yunmai scale are not advertising the weight per service data (contrary to the xiaomi ones) meaning that it will not be easy to add them.

Does someone could tests the xiaomi scale v2 implementation ?

How about xiaomi scale v1. I have already tested it. it did a good job with weight less than 10kg.
More than that it is wrong or do I miss something.
Like this.
And the result: {"weight:17.34}


Could you post the service data published to the broker corresponding to this false weight ?

1 Like

@pavon87 does your xiaomi scale looks the same as this one ?

I will do when I am home. Thanks for your quick response.

I don’t know how to get service data in my broker. So post them all in the top. I used MQTT explorer.
My broker is an addon in Home Assistant.
The bottom picture is from nrf connect.
So let’s see what is wrong. I took these two pictures at the same time when I was on my scale.


This issue has been corrected by @kanttti and is no longer present in the development branch

It works like a charm. Thank you very much.


1 Like

Any news? The YUNMAI Premium Smart Scale still not working with this gateway…

As it seems that yunmai needs a connection, yes it is not supported for the moment.