You are reading a single comment by @Vlad and its replies. Click here to read the full conversation.
  •                    case 4: {
                            // temp
                            temp = (data[14] | data[15] << 8) / 10;
                        case 6: {
                            // humidity
                            humidity = (data[14] | data[15] << 8) / 10;

    You use the same dataset for both temp and humidity, is it correct?

  • Yes, it is correct. Depending on the flag field (11th element), payload contains temperature, humidity, both temp and hum, battery level.

    I've decoded and described Xiaomi protocol in the Gatt Parser project here and here. Most of Xiaomi devices follow this protocol, e.g. MiFlora sensor, Mi Kettle, Mi Scales etc


Avatar for Vlad @Vlad started