Yes it works.
I’ve not had time to try and make it cleaner and when the scale is sleeping you tend to get an error message thrown out (see above message from @Stooovie), but that doesn’t not impact it.
I’ve not worked on the MiFlora integration so no ideas how I would go about adding the scale in the same way. If / when I get some time I might look into it. I already need to review the body measurement formulas as they have been updated…
@lolouk44 Is a hass.io support via addon planned? I will receive my scale in a week and am running hass.io, I would be happy to help you with testing. Alternatively I am thinking about using an esp32 as a gateway
I wrote this night an hassio addon leveraging @lolouk44’s scripts. There were a few modifications in the python classes and Dockerfile necessary. But the tricky thing was to access the Raspberry Pi 4’s bluetooth device inside the docker container on HassOS.
Unfortunately, the scale measurements aside of weight are ridiculous - I already expected inaccuracy as I usualy use a caliper but this is just “useless”. Thus, I will also adjust the code to support stepping of the scale immediately after weight measurement to skip the second impedance measurement.
After a code cleanup I will upload the addon to GitHub in the next days.
@Carlos_Sanchez you can leverage the xiaomi_scale.py and xiaomi_scale_body_metrics.py. The former does the ble scanning and the latter calculates the body metrics based on the weight and impedation
@Tobi0892 Do you have hassio.io installed on yours RP? Because I already installed raspbian and after seraching internet I found only haspbian. I tried to install HA manually, but there is no hassio.io. Maybe you know how to do that, because I need RB as a single device.
Do you still get the Dockerfiile error or a new one? In case it stops with the Dockerfile error you do not need to worry about the Bluetooth interface, yet