al-one / hass-xiaomi-miot

Automatic integrate all Xiaomi devices to HomeAssistant via miot-spec, support Wi-Fi, BLE, ZigBee devices. 小米米家智能家居设备接入Hass集成
https://miot-spec.com
Apache License 2.0
4.65k stars 664 forks source link

[Enhancement request] Support for scale using the miot protocol. Xiaomi Body Composition Scale S400 (yunmai.scales.ms104) #1889

Closed v1k70rk4 closed 4 days ago

v1k70rk4 commented 1 month ago

Hello,

I have a development request. The new scale no longer broadcasts the measured values, but instead displays the data in the MiHome app.

The name of the product is Xiaomi Body Composition Scale S400 (yunmai.scales.ms104).
Miot description: https://home.miot-spec.com/spec?type=urn:miot-spec-v2:device:scale:0000A07D:yunmai-ms104:1

I would greatly appreciate it if you could look into this. If I can help with testing or anything else, I'm at your disposal.

Viktor

al-one commented 2 weeks ago

All properties do not have read permissions.

{
    "iid": 2,
    "type": "urn:miot-spec-v2:service:scale:0000786B:yunmai-ms104:1",
    "description": "Scale",
    "properties": [
        {
            "iid": 1,
            "type": "urn:miot-spec-v2:property:unit:000001E0:yunmai-ms104:1",
            "description": "Unit",
            "format": "uint8",
            "access": [], # All properties do not have read permissions.
            "value-list": [
                {
                    "value": 1,
                    "description": "Kilogram"
                },
                {
                    "value": 2,
                    "description": "Pound"
                }
            ],
            "source": 3,
            "gatt-access": [
                "read",
                "write"
            ]
        },
        {
            "iid": 2,
            "type": "urn:miot-spec-v2:property:heart-rate-detection:000001DF:yunmai-ms104:1",
            "description": "Heart Rate Detection",
            "format": "bool",
            "access": [],
            "source": 3,
            "gatt-access": [
                "read",
                "write"
            ]
        },
        {
            "iid": 3,
            "type": "urn:miot-spec-v2:property:current-time:00000098:yunmai-ms104:1",
            "description": "Current Time",
            "format": "uint32",
            "access": [],
            "value-range": [
                0,
                4294967295,
                1
            ],
            "source": 3,
            "gatt-access": [
                "read",
                "write"
            ]
        }
    ]
}
v1k70rk4 commented 2 weeks ago

Thank you for looking into it. If I understand correctly, this scale is only accessible through the MiHome app. :(

As much as I love Xiaomi products because they’re high quality and I've never had issues with them, I hate this approach from the company. I'm always nervous updating the firmware too.

The problem is that the accuracy of this scale is so much better that I’d rather give up seeing in HomeAssistant that I'm overweight :)

Thanks again for checking into it.