diff --git a/tasmota/tasmota_xsns_sensor/xsns_14_sht3x.ino b/tasmota/tasmota_xsns_sensor/xsns_14_sht3x.ino index f2cbb7848..b073020e8 100644 --- a/tasmota/tasmota_xsns_sensor/xsns_14_sht3x.ino +++ b/tasmota/tasmota_xsns_sensor/xsns_14_sht3x.ino @@ -104,8 +104,12 @@ bool Sht3xRead(uint32_t type, float &t, float &h, uint8_t i2c_address) { if ((Sht3xComputeCrc(&data[0], 2) != data[2]) || (Sht3xComputeCrc(&data[3], 2) != data[5])) { return false; } - t = (float)((((data[0] << 8) | data[1]) * 175) / 65535.0) - 45; - h = (float)((((data[3] << 8) | data[4]) * 100) / 65535.0); + t = ((float)(((data[0] << 8) | data[1]) * 175) / 65535.0) - 45.0; + if (type == SHT3X_TYPE_SHT4X) { + h = ((float)(((data[3] << 8) | data[4]) * 125) / 65535.0) - 6.0; + } else { + h = ((float)(((data[3] << 8) | data[4]) * 100) / 65535.0); + } return (!isnan(t) && !isnan(h)); }