From 11cb3e838c88c5e3c51813667353d3c9e3b26e59 Mon Sep 17 00:00:00 2001 From: peteakalad Date: Sat, 23 May 2020 22:41:50 +0100 Subject: [PATCH] Fix for SGP30 for Abs Humidity on Web UI --- tasmota/xsns_21_sgp30.ino | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/tasmota/xsns_21_sgp30.ino b/tasmota/xsns_21_sgp30.ino index e3aa2e9e8..ab417a8c3 100644 --- a/tasmota/xsns_21_sgp30.ino +++ b/tasmota/xsns_21_sgp30.ino @@ -118,12 +118,14 @@ void Sgp30Show(bool json) { if (sgp30_ready) { char abs_hum[33]; - + + if (global_update && global_humidity>0 && global_temperature!=9999) { + // has humidity + temperature + dtostrfd(sgp30_abshum,4,abs_hum); + } if (json) { ResponseAppend_P(PSTR(",\"SGP30\":{\"" D_JSON_ECO2 "\":%d,\"" D_JSON_TVOC "\":%d"), sgp.eCO2, sgp.TVOC); if (global_update && global_humidity>0 && global_temperature!=9999) { - // has humidity + temperature - dtostrfd(sgp30_abshum,4,abs_hum); ResponseAppend_P(PSTR(",\"" D_JSON_AHUM "\":%s"),abs_hum); } ResponseJsonEnd();