mirror of https://github.com/arendst/Tasmota.git
Fix HumOffset on some sensors
Fix HumOffset on some sensors
This commit is contained in:
parent
35f533994f
commit
5a98fd44e2
|
@ -635,7 +635,6 @@ float CalcTempHumToDew(float t, float h)
|
|||
t = (t - 32) / 1.8; // Celsius
|
||||
}
|
||||
|
||||
// float gamma = log(h / 100) + 17.62 * t / (243.5 + t);
|
||||
float gamma = TaylorLog(h / 100) + 17.62 * t / (243.5 + t);
|
||||
float result = (243.5 * gamma / (17.62 - gamma));
|
||||
|
||||
|
|
|
@ -149,7 +149,7 @@ bool ShtRead(void)
|
|||
float rhLinear = c1 + c2 * humRaw + c3 * humRaw * humRaw;
|
||||
sht_humidity = (sht_temperature - 25) * (t1 + t2 * humRaw) + rhLinear;
|
||||
sht_temperature = ConvertTemp(sht_temperature);
|
||||
ConvertHumidity(sht_humidity); // Set global humidity
|
||||
sht_humidity = ConvertHumidity(sht_humidity);
|
||||
|
||||
sht_valid = SENSOR_MAX_MISS;
|
||||
return true;
|
||||
|
|
|
@ -187,7 +187,7 @@ bool HtuRead(void)
|
|||
if ((htu_temperature > 0.00) && (htu_temperature < 80.00)) {
|
||||
htu_humidity = (-0.15) * (25 - htu_temperature) + htu_humidity;
|
||||
}
|
||||
ConvertHumidity(htu_humidity); // Set global humidity
|
||||
htu_humidity = ConvertHumidity(htu_humidity);
|
||||
|
||||
htu_valid = SENSOR_MAX_MISS;
|
||||
return true;
|
||||
|
|
|
@ -511,8 +511,6 @@ void BmpRead(void)
|
|||
#endif // USE_BME680
|
||||
}
|
||||
}
|
||||
ConvertTemp(bmp_sensors[0].bmp_temperature); // Set global temperature
|
||||
ConvertHumidity(bmp_sensors[0].bmp_humidity); // Set global humidity
|
||||
}
|
||||
|
||||
void BmpShow(bool json)
|
||||
|
@ -539,9 +537,11 @@ void BmpShow(bool json)
|
|||
dtostrfd(bmp_pressure, Settings.flag2.pressure_resolution, pressure);
|
||||
char sea_pressure[33];
|
||||
dtostrfd(bmp_sealevel, Settings.flag2.pressure_resolution, sea_pressure);
|
||||
|
||||
float bmp_humidity = ConvertHumidity(bmp_sensors[bmp_idx].bmp_humidity);
|
||||
char humidity[33];
|
||||
dtostrfd(bmp_sensors[bmp_idx].bmp_humidity, Settings.flag2.humidity_resolution, humidity);
|
||||
float f_dewpoint = CalcTempHumToDew(bmp_temperature, bmp_sensors[bmp_idx].bmp_humidity);
|
||||
dtostrfd(bmp_humidity, Settings.flag2.humidity_resolution, humidity);
|
||||
float f_dewpoint = CalcTempHumToDew(bmp_temperature, bmp_humidity);
|
||||
char dewpoint[33];
|
||||
dtostrfd(f_dewpoint, Settings.flag2.temperature_resolution, dewpoint);
|
||||
#ifdef USE_BME680
|
||||
|
@ -572,7 +572,7 @@ void BmpShow(bool json)
|
|||
|
||||
#ifdef USE_DOMOTICZ
|
||||
if ((0 == tele_period) && (0 == bmp_idx)) { // We want the same first sensor to report to Domoticz in case a read is missed
|
||||
DomoticzTempHumPressureSensor(bmp_temperature, bmp_sensors[bmp_idx].bmp_humidity, bmp_pressure);
|
||||
DomoticzTempHumPressureSensor(bmp_temperature, bmp_humidity, bmp_pressure);
|
||||
#ifdef USE_BME680
|
||||
if (bmp_sensors[bmp_idx].bmp_model >= 3) { DomoticzSensor(DZ_AIRQUALITY, (uint32_t)bmp_sensors[bmp_idx].bmp_gas_resistance); }
|
||||
#endif // USE_BME680
|
||||
|
@ -582,7 +582,7 @@ void BmpShow(bool json)
|
|||
#ifdef USE_KNX
|
||||
if (0 == tele_period) {
|
||||
KnxSensor(KNX_TEMPERATURE, bmp_temperature);
|
||||
KnxSensor(KNX_HUMIDITY, bmp_sensors[bmp_idx].bmp_humidity);
|
||||
KnxSensor(KNX_HUMIDITY, bmp_humidity);
|
||||
}
|
||||
#endif // USE_KNX
|
||||
|
||||
|
|
|
@ -71,7 +71,7 @@ bool Sht3xRead(float &t, float &h, uint8_t sht3x_address)
|
|||
data[i] = Wire.read(); // cTemp msb, cTemp lsb, cTemp crc, humidity msb, humidity lsb, humidity crc
|
||||
};
|
||||
t = ConvertTemp((float)((((data[0] << 8) | data[1]) * 175) / 65535.0) - 45);
|
||||
h = ConvertHumidity((float)((((data[3] << 8) | data[4]) * 100) / 65535.0)); // Set global humidity
|
||||
h = ConvertHumidity((float)((((data[3] << 8) | data[4]) * 100) / 65535.0));
|
||||
return (!isnan(t) && !isnan(h) && (h != 0));
|
||||
}
|
||||
|
||||
|
|
|
@ -105,10 +105,7 @@ void AHT1XPoll(void) // We have 100ms for read. Sensor needs 80-95 ms
|
|||
AHT1XWrite(0);
|
||||
break;
|
||||
case 11:
|
||||
if (AHT1XRead(0)){
|
||||
ConvertTemp(aht1x_sensors[0].temperature); // Set global temperature
|
||||
ConvertHumidity(aht1x_sensors[0].humidity); // Set global humidity
|
||||
}
|
||||
AHT1XRead(0);
|
||||
aht1x_Pcount = 0;
|
||||
break;
|
||||
}
|
||||
|
|
|
@ -223,8 +223,7 @@ bool HdcRead(void) {
|
|||
|
||||
if (hdc_humidity > 100) { hdc_humidity = 100.0; }
|
||||
if (hdc_humidity < 0) { hdc_humidity = 0.01; }
|
||||
|
||||
ConvertHumidity(hdc_humidity); // Set global humidity
|
||||
hdc_humidity = ConvertHumidity(hdc_humidity);
|
||||
|
||||
hdc_valid = SENSOR_MAX_MISS;
|
||||
|
||||
|
|
Loading…
Reference in New Issue