Integrating Xiaomi Mi Scale

Can you share your ha config and add on config?

Hello @lolouk44, I have been able to receive one package, so I think it will be a range issue and all is good regarding configuration. Let me some time to do more tests and figure out.

If you can share the information I can help…

hello,

For several users this template is for you

https://pastebin.com/rNCmQc6K

For those cases the scale is not in range of the HA BLE adapter/HA instance, there is a confirmed way to get the ẁeight, impedance and BMI from the Xiaomi Mi Scale V2, model XMTZC05HM, using an ESP32.

The OpenMQTTGateway project supports this Xiaomi model, just follow the instructions to flash the ESP32 with the BLE binaries: https://docs.openmqttgateway.com/upload/binaries.html

After that, configure the Wifi and MQTT broker data on the ESP32, and paste this code on your HA configuration.yaml file:

image

Have fun. :slight_smile:

3 Likes

Hello,

For those who want to test my version for Esphome the link is below. I only have the miscale so I couldn’t test the miscale 2.

Esphome DEV Miscale

Eeek

updated to 0.118.3 and got this error
Using “Hassio” on a raspberry pi 3b+

xiaomi mi scale [FATAL tini (6)] exec /entrypoint.sh failed: Permission denied

Edit: Seems like it wasnt the hass update that caused it. It was the Mi Scale Addon update i did some seconds earlier. 0.1.10 Mi Scale Addon Works with 0.118.3 but the 0.1.13 gets me error on both 0.118.2 and 0.118.3

Issue was present in 0.1.12.
I pushed 0.1.13 this morning which should have fixed this. Are you sure you’re on 0.1.13?

Updated again to 0.1.13 and yes i still get:

[FATAL tini (6)] exec /entrypoint.sh failed: Permission denied

:\

1 Like

Thanks. since 0.1.12 I’m “trying” to build the container images automatically via GitHub, and I’ve also separated the add-on image from the non add-on one to try and bring additional features in the future.
It looks as though the GitHub build is working differently than via my computer. Just added a fix and 0.1.14 is being built as we speak

@sbobergje how’s it looking?
Defo works on my test platform (now that I’ve killed Watchtower to help resolve the new docker pull limit and finally managed to pull my own container :man_facepalming: )

Tried installing the 0.1.13 and it worked at first, but quickly failed. with the fatal tini error. Waiting for the 0.1.14 to try that one.

Thumbs up on your work.

1 Like

Working with 0.1.14, thumbs up.

1 Like

I did the custom integration for Mi Body Composition Scale 2, check it out here: https://github.com/serge1peshcoff/xiaomi-scale-2-mqtt. It also has the instructions on setting it up.
It is a node.js script that queries the data from the scale and sends it to MQTT broker, then it can be consumed by Home Assistant.

2 Likes

This seems very promising and to the point. I like that.

But I don’t really understand the build container concept. Build where or from where?

Excuse my stupidity. Hehe. :slight_smile:

First of all, thnx for the awesome work on this integration!

I do have it somewhat working (running a Pi4 with Bluetooth on board)

It seems however that after an initial measure, it no longer works (the communication) and I get this error:


Bluetooth connection error: Failed to execute management command ‘scanend’ (code: 13, error: Invalid Parameters)

I’m wondering if I need to ‘pair’ it with the Pi, or anything similar?

Version I’m using is: 0.1.16

I have the: Mi Body Composition Scale 2

Also have mi body composition 2 but cannot find a suitable way to add it. Put openmqttgateway on esp but this device is not supported (only mi scale 2).
Same as others connection error on BT

021-02-10 10:04:29 - Bluetooth connection error: Failed to execute management command ‘le on’ (code: 17, error: Invalid Index)
2021-02-10 10:04:59 - Bluetooth connection error: Failed to execute management command ‘le on’ (code: 17, error: Invalid Index)
2021-02-10 10:05:29 - Bluetooth connection error: Failed to execute management command ‘le on’ (code: 17, error: Invalid Index)
2021-02-10 10:05:59 - Bluetooth connection error: Failed to execute management command ‘le on’ (code: 17, error: Invalid Index)
2021-02-10 10:06:29 - Bluetooth connection error: Failed to execute management command ‘le on’ (code: 17, error: Invalid Index)
2021-02-10 10:06:29 - 5+ Bluetooth connection errors. Resetting Bluetooth…

How can i add this integration for a hass.os instance (no containers) ?

I have a potential fix in progress, but just started a new job and don’t have that much time to work on my code :frowning:
It’s still on my to do list though (as opposed to “I don’t care / I won’t do it” )

what / whose code are you using and on what platform?