I’ve recently purchased a Xiaomi Body Scale online and would like to include weight tracking in HASS. Although the product is still on it’s way from China I’m thinking about the best way to integrate it. So, I’d like to ask if someone owns this device and has successfully managed to get it working with HASS?
The scale sends it’s data via bluetooth and there is also a library available to handle the data. A command line sensor probably seems to be the best solution to gather the data of the scale. What do you think?
Update: 14.11.2025
Even after 8 years this thread still has a lot of views and some traction therefore I’d like to share the solution I have been running with for some years now. The easiest way for me was to use an ESP32 and ESPHome with the Xiaomi Miscale Sensors integration that support v1 and v2 of the scale.
Addionionally I have implemented a sensor calculating the BMI value directly in the ESPHome config which updates whenever a new value is read from the MiScale. I have written a tutorial on my personal blog: ESPHome Bluetooth Low Energy Hub · jbetzen.net
My scale arrived yesterday and in case anyone is interested here is my solution:
I’ve used the above mentioned library node-xiaomi-scale. I have written a script (fetchscaledata.js) running as cronjob. Output of scale data is written to a textfile (scanData.txt). First line contents weight, second line contains calculated bmi. The script waits for the scale to be stabilized and the load to be removed. Afterwards it prints the last measured data. Simply run sudo node ./fetchdata.js > scaleData.txt:
// fetchscaledata.js
let MiScale = require('../index.js');
let miscale = new MiScale();
miscale.startScanning();
miscale.on('data', function (scale) {
var weight = scale['weight']
var height = 1.84 // Height in meters [m]
var bmi = (weight / Math.pow(height, 2)).toFixed(2)
var statusStabilized = scale['isStabilized']
var statusLoadRemoved = scale['loadRemoved']
if (statusStabilized || statusLoadRemoved) {
console.log(weight + "\n" + bmi)
process.exit()
}
});
Afterwards setup two command line sensors for weight and bmi. Scan intervall is set to every 6 hours:
I am very interested in this one, could you gently tell me how do you add bluetooth le to the raspberry pi? And how do you integrated it with this one? Is it possible to generate some sort of graphics?
Here is BLE installation manual: http://www.elinux.org/RPi_Bluetooth_LE , I am still not integrated it - because I will test it only on Friday (I will come back home) and I will write mqtt integration later, but you can test it right now - it must write all history data to console (if protocol is correct and I didn’t make any mistakes in software).
I will not generate any graphics because in my system it will work with home assistant.
It works fine if I run hass as root, but not able to make it work with a normal user.
I have tried to run sudo setcap cap_net_raw,cap_net_admin+eip /home/dahoiv/home-assistant/venv/bin/python3 , but that does not help
Did you sorted out? Does it work accuratelly? Good job by the way even if it only works by running hass as root is actually a big achievement and maybe a go for me to buy this scale