Add Xiaomi Mi Scale to Xiaomi BLE

Go to settings, devices and services, and open the Bluetooth integration. In the left menu, there should be an option to enable debug logging

Thank you. I enabled the debug already and trying to get the log.
Once I get the log data Iā€™ll post them here

Does the official Home Assistant integration work with the XMTZC05HM? I donā€™t see mass listed in the integration documentation: Xiaomi BLE - Home Assistant

Hi,
Iā€™m in the same situation, did you figure out how to use multiple users directly via Xiaomi BLE (and without the esphome option)?
Thank you for your time.

I decided itā€™s easier to keep it in ESPHome for now :slight_smile:
But there are some good reactions to my question at the time on how to make it work if you want to switch.

Hello quizzical , Is this code working ?
Where you define "scaleconnection "?
This is code in Esphome code or configuration yaml?

thanks

Yes it is working.
It is the ESPHome code.

Good question on the scaleconnection. It looks like when I pasted that snippet of code I forgot to also copy this piece of code:

switch:

  • platform: template #If I turn of this switch, the measurements will not be sent to Home Assistant, good when e.g. weighing a suitcase or a friend.
    name: ā€œScale connectionā€
    id: scaleconnection
    optimistic: true

Thank you ! I am getting understandā€¦
Now a new error come upā€¦ the "ID " duplicated

Yes you need to define those

  - platform: template
    name: Weight Marco
    id: weight_marco
    unit_of_measurement: 'kg'
    icon: mdi:weight-kilogram
    state_class: measurement
    accuracy_decimals: 2

And the same for impedance with some logical differences:

    unit_of_measurement: 'ohm'
    icon: mdi:omega
    accuracy_decimals: 0

And this for each person

1 Like

Hi @Ernst! Not sure if you ever got the logs for the S400 (MJTZC01YM) from the previous user but I am in the same situation and I was hoping for your help in getting it added to the integration if possible?

Hereā€™s the logs from my device if needed: JustPaste.it - Share Text & Images the Easy Way

3 Likes

I also got a S400 scale and would be interested in an integration. But it seems that the protocol changed? I tried to capture some bluetooth traffic using an Android phone and got a PCAP file, but donā€™t have sufficient experience with bluetooth to be able to analyze it. I searched the PCAP trace contents for certain values like the weight in hex (in various formats), but with no success. Maybe there is some kind of encoding or even encryption involved.

If I can provide any data that helps, Iā€™m happy to do so.

1 Like

Iā€™m in the same situation with the Xiaomi Body Composition Scale S400 scale. Model number: MJTZC01YM. Happy to help wherever possible. Iā€™m not well experienced in python & Bluetooth message parsing but with some guidance I could probably help.

Edit: there is also another topic about the same over here: How to add Xiaomi Mijia scale S400 (model: MJTZC01YM) into Home Assisstant

1 Like

Hello! Are there any progress in the integration of Xiaomi S400? Apparently, there are more and more owners of new scales, and if I can help, Iā€™m ready to take part :blush:

Just bought an S400 as well. Very interested in getting this integrated.

1 Like

Hi,
I just bought a Xiaomi S400 as I thought it would be picked up by the Xiaomi BLE integration, but without luck.
I followed this topic and enabled the debug logging of the BLE Monitor. I checked the log an found
a corresponding entry:

2024-11-16 18:26:49.674 DEBUG (MainThread) [homeassistant.components.bluetooth.manager] hci0 (C0:A5:E8:31:ED:C6) [connectable]: <BluetoothServiceInfoBleak name=Xiaomi Scale S400 C019 address=84:46:93:46:C0:19 rssi=-78 manufacturer_data={911: b'\x10Y\xd5;\x01\x19\xc0F\x93F\x84'} service_data={'0000fe95-0000-1000-8000-00805f9b34fb': b'HY\xd5;\x01\xbeb\xf4\x97\xeaJ`\xbc\xf8)\xa1\x83\x00\x00\x00\x9f\x85\xc8\x96'} service_uuids=['0000fe95-0000-1000-8000-00805f9b34fb'] source=C0:A5:E8:31:ED:C6 connectable=True time=9343548.580665207 tx_power=None> match: {'xiaomi_ble'}
2024-11-16 18:26:50.821 DEBUG (MainThread) [homeassistant.components.bluetooth.manager] hci0 (C0:A5:E8:31:ED:C6) [connectable]: <BluetoothServiceInfoBleak name=Xiaomi Scale S400 C019 address=84:46:93:46:C0:19 rssi=-79 manufacturer_data={911: b'\x10Y\xd5;\x02\x19\xc0F\x93F\x84'} service_data={'0000fe95-0000-1000-8000-00805f9b34fb': b'HY\xd5;\x02\x9dA\xe9\xb3X\x8fRd\x96\xfe&\x03\x00\x00\x00P\xe2t#'} service_uuids=['0000fe95-0000-1000-8000-00805f9b34fb'] source=C0:A5:E8:31:ED:C6 connectable=True time=9343549.727677356 tx_power=None> match: set()
2024-11-16 18:26:51.718 DEBUG (MainThread) [homeassistant.components.bluetooth.manager] hci0 (C0:A5:E8:31:ED:C6) [connectable]: <BluetoothServiceInfoBleak name=Xiaomi Scale S400 C019 address=84:46:93:46:C0:19 rssi=-78 manufacturer_data={911: b'\x10Y\xd5;\x02\x19\xc0F\x93F\x84'} service_data={'0000fe95-0000-1000-8000-00805f9b34fb': b'\x10Y\xd5;\x02\x19\xc0F\x93F\x84'} service_uuids=['0000fe95-0000-1000-8000-00805f9b34fb'] source=C0:A5:E8:31:ED:C6 connectable=True time=9343550.624686858 tx_power=None> match: set()

I am confused as the entry mentions xiaomi_ble but it wonā€™t pop up within the integration. :frowning:

Any help is appreciated.
Thanks