The ESP32, an upgrade over its predecessor the ESP8266, has several advantages, one of them being its ability to support not just Wi-Fi but also Bluetooth and Bluetooth Low Energy (BLE). And it's no surprise that the developers of ESPHome have leveraged this feature. The latest release of ESPHome, version 1.17.0, makes it even more versatile by including support for the Xiaomi Mi Smart Scale and Xiaomi Mi Smart Scale 2.
The list of supported Xiaomi devices keeps on growing
When using an ESP32 with ESPHome, you could already integrate various BLE devices from Xiaomi and its associated partners. The Mi Flora allows you to track your plants' soil condition, a number of hygro-thermometers featuring LCD and e-paper screens could help you keep an eye on the climate, and a smart mosquito repellant to keep those nasty bugs under control.
How to integrate the Xiaomi Mi Smart Scale with ESPHome
This new integration supports both the Xiaomi Mi Smart Scale and Xiaomi Mi Smart Scale 2, with the main difference being that the second version supports impedance measurements, which are also read by ESPHome. To allow ESPHome to communicate with the scales, all you need is its mac address and your basic setup is complete. There is a detailed guide on how to find the mac address of such a device on the ESPHome site.
sensor: - platform: xiaomi_miscale2 mac_address: '5C:CA:D3:70:D4:A2' weight: name: "Xiaomi Mi Scale Weight" impedance: name: "Xiaomi Mi Scale Impedance"
If you wish to track the weight of multiple people using the same Xiaomi Mi Smart Scale, you can achieve that using lambda. There is an example of such a setup on the integration's page on ESPHome.io. You will need to know what weights you and other users fluctuate between to achieve this, and then set up a template for each user.
Analysing your body composition using the bodymiscale custom component
While knowing one's weight is an important metric in life, it doesn't immediately tell you whether you are in a healthy condition, or not. And when measuring impudence using the Xiaomi Mi Smart Scale 2, many will not know what to do with the results. While you could get actionable information from Xiaomi's app, I'm guessing that you are trying to avoid it by using this integration. The good news is that another developer has already faced, and solved, this problem. And they were friendly enough to share it as a custom component named bodymiscale, which is available in the HACS.
Especially when using the second version of the Mi Smart Scale, I highly recommend you have a look at the custom component. Among others, it will be able to tell you your lean body mass, body fat, water weight, bone mass, and muscle mass. I am fully aware that scales aren't comparable to clinical testing, though it might be useful to know where you roughly are at.
Why use the Xioami Mi Smart Scale with ESPHome and not the app?
As already mentioned, the main reason for integrating the Xiaomi Mi Smart Scale and Xiaomi Mi Smart Scale with ESPHome and not the official app is to not having to use the app and Xiaomi's services. One's own weight and condition can be a very private matter, and Xiaomi has been caught sharing private data in the past. It is for that reason that I only used the Xiaomi Mi Home app on a “burner” phone (an old Nexus 5) to set up my Xiaomi Mi Air Purifier 3H and then integrated it with Home Assistant. Unfortunately, not using the app also means you won't be able to update your Xiaomi Mi Smart Scale. I couldn't tell you how important these updates are, but a quick google brought up no ways of manually updating.
Having an ESPHome node collecting data from your smart scales does have an additional advantage: That data can be used by ESPHome. How about setting up an automation that plays Fiesta by The Pogues when you've reached your goal weight?