diff --git a/tasmota/i18n.h b/tasmota/i18n.h
index fadebd6fb..9f2b3ab7a 100644
--- a/tasmota/i18n.h
+++ b/tasmota/i18n.h
@@ -780,8 +780,8 @@ const float kSpeedConversionFactor[] = {1, // none
#ifdef USE_WEBSERVER
// {s} =
, {m} = | , {e} = |
const char HTTP_SNS_F_TEMP[] PROGMEM = "{s}%s " D_TEMPERATURE "{m}%*_f " D_UNIT_DEGREE "%c{e}";
+//const char HTTP_SNS_TEMP[] PROGMEM = "{s}%s " D_TEMPERATURE "{m}%s " D_UNIT_DEGREE "%c{e}";
-const char HTTP_SNS_TEMP[] PROGMEM = "{s}%s " D_TEMPERATURE "{m}%s " D_UNIT_DEGREE "%c{e}";
const char HTTP_SNS_HUM[] PROGMEM = "{s}%s " D_HUMIDITY "{m}%s " D_UNIT_PERCENT "{e}";
const char HTTP_SNS_DEW[] PROGMEM = "{s}%s " D_DEWPOINT "{m}%s " D_UNIT_DEGREE "%c{e}";
const char HTTP_SNS_PRESSURE[] PROGMEM = "{s}%s " D_PRESSURE "{m}%s " "%s{e}";
diff --git a/tasmota/xsns_47_max31865.ino b/tasmota/xsns_47_max31865.ino
index 388da057f..544778d92 100644
--- a/tasmota/xsns_47_max31865.ino
+++ b/tasmota/xsns_47_max31865.ino
@@ -88,18 +88,15 @@ void MAX31865_Show(bool Json) {
uint8_t report_once = 0;
for (uint32_t i = 0; i < MAX_MAX31865S; i++) {
if (max31865_pins_used & (1 << i)) {
- char temperature[33];
- char resistance[33];
-
- dtostrfd(MAX31865_Result[i].PtdResistance, Settings.flag2.temperature_resolution, resistance);
- dtostrfd(MAX31865_Result[i].PtdTemp, Settings.flag2.temperature_resolution, temperature);
-
if (Json) {
- ResponseAppend_P(PSTR(",\"MAX31865%c%d\":{\"" D_JSON_TEMPERATURE "\":%s,\"" D_JSON_RESISTANCE "\":%s,\"" D_JSON_ERROR "\":%d}"), \
- IndexSeparator(), i, temperature, resistance, MAX31865_Result[i].ErrorCode);
+ ResponseAppend_P(PSTR(",\"MAX31865%c%d\":{\"" D_JSON_TEMPERATURE "\":%*_f,\"" D_JSON_RESISTANCE "\":%*_f,\"" D_JSON_ERROR "\":%d}"), \
+ IndexSeparator(), i,
+ Settings.flag2.temperature_resolution, &MAX31865_Result[i].PtdTemp,
+ Settings.flag2.temperature_resolution, &MAX31865_Result[i].PtdResistance,
+ MAX31865_Result[i].ErrorCode);
if ((0 == TasmotaGlobal.tele_period) && (!report_once)) {
#ifdef USE_DOMOTICZ
- DomoticzSensor(DZ_TEMP, temperature);
+ DomoticzFloatSensor(DZ_TEMP, MAX31865_Result[i].PtdTemp);
#endif // USE_DOMOTICZ
#ifdef USE_KNX
KnxSensor(KNX_TEMPERATURE, MAX31865_Result[i].PtdTemp);
@@ -110,7 +107,7 @@ void MAX31865_Show(bool Json) {
} else {
char sensorname[33];
sprintf(sensorname, "MAX31865%c%d", IndexSeparator(), i);
- WSContentSend_PD(HTTP_SNS_TEMP, sensorname, temperature, TempUnit());
+ WSContentSend_Temp(sensorname, MAX31865_Result[i].PtdTemp);
#endif // USE_WEBSERVER
}
}
diff --git a/tasmota/xsns_48_chirp.ino b/tasmota/xsns_48_chirp.ino
index bb887cf85..bfe1dc5a5 100644
--- a/tasmota/xsns_48_chirp.ino
+++ b/tasmota/xsns_48_chirp.ino
@@ -417,10 +417,8 @@ void ChirpShow(bool json)
{
for (uint32_t i = 0; i < chirp_found_sensors; i++) {
if (chirp_sensor[i].version) {
- // convert double values to string
- char str_temperature[33];
- double t_temperature = ((double) chirp_sensor[i].temperature )/10.0;
- dtostrfd(t_temperature, Settings.flag2.temperature_resolution, str_temperature);
+ float t_temperature = ConvertTemp(((float)chirp_sensor[i].temperature )/10.0);
+
char str_light[33];
dtostrfd(chirp_sensor[i].light, 0, str_light);
char str_version[7];
@@ -435,7 +433,7 @@ void ChirpShow(bool json)
if(!chirp_sensor[i].explicitSleep) {
ResponseAppend_P(PSTR(",\"%s%u\":{\"" D_JSON_MOISTURE "\":%d"), chirp_name, i, chirp_sensor[i].moisture);
if(chirp_sensor[i].temperature!=-1){ // this is the error code -> no temperature
- ResponseAppend_P(PSTR(",\"" D_JSON_TEMPERATURE "\":%s"),str_temperature);
+ ResponseAppend_P(PSTR(",\"" D_JSON_TEMPERATURE "\":%*_f"), Settings.flag2.temperature_resolution, &t_temperature);
}
ResponseAppend_P(PSTR(",\"" D_JSON_DARKNESS "\":%s}"),str_light);
}
@@ -458,7 +456,7 @@ void ChirpShow(bool json)
WSContentSend_PD(HTTP_SNS_MOISTURE, "", chirp_sensor[i].moisture);
WSContentSend_PD(HTTP_SNS_DARKNESS, str_light);
if (chirp_sensor[i].temperature!=-1) { // this is the error code -> no temperature
- WSContentSend_PD(HTTP_SNS_TEMP, "", str_temperature, TempUnit());
+ WSContentSend_Temp("", t_temperature);
}
}
diff --git a/tasmota/xsns_59_ds1624.ino b/tasmota/xsns_59_ds1624.ino
index 90633724b..7afb4e679 100644
--- a/tasmota/xsns_59_ds1624.ino
+++ b/tasmota/xsns_59_ds1624.ino
@@ -176,18 +176,16 @@ void DS1624EverySecond(void)
void DS1624Show(bool json)
{
- char temperature[33];
bool once = true;
for (uint32_t i = 0; i < DS1624_MAX_SENSORS; i++) {
if (!ds1624_sns[i].valid) { continue; }
- dtostrfd(ds1624_sns[i].value, Settings.flag2.temperature_resolution, temperature);
if (json) {
- ResponseAppend_P(JSON_SNS_TEMP, ds1624_sns[i].name, temperature);
+ ResponseAppend_P(JSON_SNS_F_TEMP, ds1624_sns[i].name, Settings.flag2.temperature_resolution, &ds1624_sns[i].value);
if ((0 == TasmotaGlobal.tele_period) && once) {
#ifdef USE_DOMOTICZ
- DomoticzSensor(DZ_TEMP, temperature);
+ DomoticzFloatSensor(DZ_TEMP, ds1624_sns[i].value);
#endif // USE_DOMOTICZ
#ifdef USE_KNX
KnxSensor(KNX_TEMPERATURE, ds1624_sns[i].value);
@@ -196,7 +194,7 @@ void DS1624Show(bool json)
}
#ifdef USE_WEBSERVER
} else {
- WSContentSend_PD(HTTP_SNS_TEMP, ds1624_sns[i].name, temperature, TempUnit());
+ WSContentSend_Temp(ds1624_sns[i].name, ds1624_sns[i].value);
#endif // USE_WEBSERVER
}
}
diff --git a/tasmota/xsns_61_MI_NRF24.ino b/tasmota/xsns_61_MI_NRF24.ino
index 01dc309be..f66d2de35 100644
--- a/tasmota/xsns_61_MI_NRF24.ino
+++ b/tasmota/xsns_61_MI_NRF24.ino
@@ -1738,9 +1738,8 @@ void MINRFShow(bool json)
||(hass_mode==2)
#endif //USE_HOME_ASSISTANT
) {
- char temperature[FLOATSZ];
- dtostrfd(MIBLEsensors[i].temp, Settings.flag2.temperature_resolution, temperature);
- ResponseAppend_P(PSTR(",\"" D_JSON_TEMPERATURE "\":%s"), temperature);
+ ResponseAppend_P(PSTR(",\"" D_JSON_TEMPERATURE "\":%*_f"),
+ Settings.flag2.temperature_resolution, &MIBLEsensors[i].temp);
}
}
}
@@ -1897,9 +1896,7 @@ void MINRFShow(bool json)
if (MIBLEsensors[i].type==YEERC) continue;
if (MIBLEsensors[i].type==FLORA){
if(!isnan(MIBLEsensors[i].temp)){
- char temperature[FLOATSZ];
- dtostrfd(MIBLEsensors[i].temp, Settings.flag2.temperature_resolution, temperature);
- WSContentSend_PD(HTTP_SNS_TEMP, kMINRFDeviceType[MIBLEsensors[i].type-1], temperature, TempUnit());
+ WSContentSend_Temp(kMINRFDeviceType[MIBLEsensors[i].type-1], MIBLEsensors[i].temp);
}
if(MIBLEsensors[i].lux!=0xffffffff){ // this is the error code -> no valid value
WSContentSend_PD(HTTP_SNS_ILLUMINANCE, kMINRFDeviceType[MIBLEsensors[i].type-1], MIBLEsensors[i].lux);
diff --git a/tasmota/xsns_62_MI_ESP32.ino b/tasmota/xsns_62_MI_ESP32.ino
index 8bb595625..9e1b423d1 100644
--- a/tasmota/xsns_62_MI_ESP32.ino
+++ b/tasmota/xsns_62_MI_ESP32.ino
@@ -2052,9 +2052,8 @@ void MI32Show(bool json)
||(hass_mode!=-1)
#endif //USE_HOME_ASSISTANT
) {
- char temperature[FLOATSZ];
- dtostrfd(MIBLEsensors[i].temp, Settings.flag2.temperature_resolution, temperature);
- ResponseAppend_P(PSTR(",\"" D_JSON_TEMPERATURE "\":%s"), temperature);
+ ResponseAppend_P(PSTR(",\"" D_JSON_TEMPERATURE "\":%*_f"),
+ Settings.flag2.temperature_resolution, &MIBLEsensors[i].temp);
}
}
}
@@ -2211,9 +2210,7 @@ void MI32Show(bool json)
WSContentSend_PD(HTTP_RSSI, kMI32DeviceType[MIBLEsensors[i].type-1], MIBLEsensors[i].RSSI);
if (MIBLEsensors[i].type==FLORA) {
if (!isnan(MIBLEsensors[i].temp)) {
- char temperature[FLOATSZ];
- dtostrfd(MIBLEsensors[i].temp, Settings.flag2.temperature_resolution, temperature);
- WSContentSend_PD(HTTP_SNS_TEMP, kMI32DeviceType[MIBLEsensors[i].type-1], temperature, TempUnit());
+ WSContentSend_Temp(kMI32DeviceType[MIBLEsensors[i].type-1], MIBLEsensors[i].temp);
}
if (MIBLEsensors[i].moisture!=0xff) {
WSContentSend_PD(HTTP_SNS_MOISTURE, kMI32DeviceType[MIBLEsensors[i].type-1], MIBLEsensors[i].moisture);
diff --git a/tasmota/xsns_62_MI_ESP32_BLE_ESP32.ino b/tasmota/xsns_62_MI_ESP32_BLE_ESP32.ino
index d9b5f8e77..f563e9f1a 100644
--- a/tasmota/xsns_62_MI_ESP32_BLE_ESP32.ino
+++ b/tasmota/xsns_62_MI_ESP32_BLE_ESP32.ino
@@ -2361,9 +2361,8 @@ void MI32GetOneSensorJson(int slot, int hidename){
||(hass_mode!=-1)
#endif //USE_HOME_ASSISTANT
) {
- char temperature[FLOATSZ];
- dtostrfd(p->temp, Settings.flag2.temperature_resolution, temperature);
- ResponseAppend_P(PSTR(",\"" D_JSON_TEMPERATURE "\":%s"), temperature);
+ ResponseAppend_P(PSTR(",\"" D_JSON_TEMPERATURE "\":%*_f"),
+ Settings.flag2.temperature_resolution, &p->temp);
}
}
}
@@ -2815,9 +2814,7 @@ void MI32Show(bool json)
switch(p->type){
case MI_FLORA:{
if (!isnan(p->temp)) {
- char temperature[FLOATSZ];
- dtostrfd(p->temp, Settings.flag2.temperature_resolution, temperature);
- WSContentSend_PD(HTTP_SNS_TEMP, typeName, temperature, TempUnit());
+ WSContentSend_Temp(typeName, p->temp);
}
if (p->moisture!=0xff) {
WSContentSend_PD(HTTP_SNS_MOISTURE, typeName, p->moisture);
diff --git a/tasmota/xsns_62_MI_HM10.ino b/tasmota/xsns_62_MI_HM10.ino
index 48057240d..02298380e 100644
--- a/tasmota/xsns_62_MI_HM10.ino
+++ b/tasmota/xsns_62_MI_HM10.ino
@@ -1812,9 +1812,8 @@ void HM10Show(bool json)
||(hass_mode!=-1)
#endif //USE_HOME_ASSISTANT
) {
- char temperature[FLOATSZ];
- dtostrfd(MIBLEsensors[i].temp, Settings.flag2.temperature_resolution, temperature);
- ResponseAppend_P(PSTR(",\"" D_JSON_TEMPERATURE "\":%s"), temperature);
+ ResponseAppend_P(PSTR(",\"" D_JSON_TEMPERATURE "\":%*_f"),
+ Settings.flag2.temperature_resolution, &MIBLEsensors[i].temp);
}
}
}
@@ -1967,9 +1966,7 @@ void HM10Show(bool json)
WSContentSend_PD(HTTP_HM10_MAC, kHM10DeviceType[MIBLEsensors[i].type-1], D_MAC_ADDRESS, _MAC);
if (MIBLEsensors[i].type==FLORA){
if(!isnan(MIBLEsensors[i].temp)){
- char temperature[FLOATSZ];
- dtostrfd(MIBLEsensors[i].temp, Settings.flag2.temperature_resolution, temperature);
- WSContentSend_PD(HTTP_SNS_TEMP, kHM10DeviceType[MIBLEsensors[i].type-1], temperature, TempUnit());
+ WSContentSend_Temp(kHM10DeviceType[MIBLEsensors[i].type-1], MIBLEsensors[i].temp);
}
if(MIBLEsensors[i].lux!=0x00ffffff){ // this is the error code -> no valid value
WSContentSend_PD(HTTP_SNS_ILLUMINANCE, kHM10DeviceType[MIBLEsensors[i].type-1], MIBLEsensors[i].lux);
diff --git a/tasmota/xsns_72_mcp9808.ino b/tasmota/xsns_72_mcp9808.ino
index 98fc48066..4b1c15696 100644
--- a/tasmota/xsns_72_mcp9808.ino
+++ b/tasmota/xsns_72_mcp9808.ino
@@ -75,9 +75,6 @@ void MCP9808EverySecond(void) {
void MCP9808Show(bool json) {
for (uint32_t i = 0; i < mcp9808_cfg.count; i++) {
- char temperature[33];
- dtostrfd(mcp9808_sensors[i].temperature, Settings.flag2.temperature_resolution, temperature);
-
char sensor_name[11];
strlcpy(sensor_name, mcp9808_cfg.types, sizeof(sensor_name));
if (mcp9808_cfg.count > 1) {
@@ -85,10 +82,10 @@ void MCP9808Show(bool json) {
}
if (json) {
- ResponseAppend_P(JSON_SNS_TEMP, sensor_name, temperature);
+ ResponseAppend_P(JSON_SNS_F_TEMP, sensor_name, Settings.flag2.temperature_resolution, &mcp9808_sensors[i].temperature);
if ((0 == TasmotaGlobal.tele_period) && (0 == i)) {
#ifdef USE_DOMOTICZ
- DomoticzSensor(DZ_TEMP, temperature);
+ DomoticzFloatSensor(DZ_TEMP, mcp9808_sensors[i].temperature);
#endif // USE_DOMOTICZ
#ifdef USE_KNX
KnxSensor(KNX_TEMPERATURE, mcp9808_sensors[i].temperature);
@@ -96,7 +93,7 @@ void MCP9808Show(bool json) {
}
#ifdef USE_WEBSERVER
} else {
- WSContentSend_PD(HTTP_SNS_TEMP, sensor_name, temperature, TempUnit());
+ WSContentSend_Temp(sensor_name, mcp9808_sensors[i].temperature);
#endif // USE_WEBSERVER
}
}
diff --git a/tasmota/xsns_73_hp303b.ino b/tasmota/xsns_73_hp303b.ino
index 50589e4d5..c04758190 100644
--- a/tasmota/xsns_73_hp303b.ino
+++ b/tasmota/xsns_73_hp303b.ino
@@ -107,15 +107,14 @@ void HP303B_Show(bool json) {
float sealevel = ConvertPressureForSeaLevel(hp303b_sensor[i].pressure);
- char str_temperature[33];
- dtostrfd(hp303b_sensor[i].temperature, Settings.flag2.temperature_resolution, str_temperature);
char str_pressure[33];
dtostrfd(hp303b_sensor[i].pressure, Settings.flag2.pressure_resolution, str_pressure);
char sea_pressure[33];
dtostrfd(sealevel, Settings.flag2.pressure_resolution, sea_pressure);
if (json) {
- ResponseAppend_P(PSTR(",\"%s\":{\"" D_JSON_TEMPERATURE "\":%s,\"" D_JSON_PRESSURE "\":%s"), sensor_name, str_temperature, str_pressure);
+ ResponseAppend_P(PSTR(",\"%s\":{\"" D_JSON_TEMPERATURE "\":%*_f,\"" D_JSON_PRESSURE "\":%s"),
+ sensor_name, Settings.flag2.temperature_resolution, &hp303b_sensor[i].temperature, str_pressure);
if (Settings.altitude != 0) {
ResponseAppend_P(PSTR(",\"" D_JSON_PRESSUREATSEALEVEL "\":%s"), sea_pressure);
}
@@ -123,12 +122,12 @@ void HP303B_Show(bool json) {
#ifdef USE_DOMOTICZ
// Domoticz and knx only support one temp sensor
if ((0 == TasmotaGlobal.tele_period) && (0 == i)) {
- DomoticzSensor(DZ_TEMP, hp303b_sensor[i].temperature);
+ DomoticzFloatSensor(DZ_TEMP, hp303b_sensor[i].temperature);
}
#endif // USE_DOMOTICZ
#ifdef USE_WEBSERVER
} else {
- WSContentSend_PD(HTTP_SNS_TEMP, sensor_name, str_temperature, TempUnit());
+ WSContentSend_Temp(sensor_name, hp303b_sensor[i].temperature);
WSContentSend_PD(HTTP_SNS_PRESSURE, sensor_name, str_pressure, PressureUnit().c_str());
if (Settings.altitude != 0) {
WSContentSend_PD(HTTP_SNS_SEAPRESSURE, sensor_name, sea_pressure, PressureUnit().c_str());
diff --git a/tasmota/xsns_74_lmt01.ino b/tasmota/xsns_74_lmt01.ino
index 8c6cfdb92..cce7288db 100644
--- a/tasmota/xsns_74_lmt01.ino
+++ b/tasmota/xsns_74_lmt01.ino
@@ -85,14 +85,11 @@ int LMT01_getPulses(void) {
}
void LMT01_Show(bool Json) {
- char temp[33];
- dtostrfd(lmt01_temperature, Settings.flag2.temperature_resolution, temp);
-
if (Json) {
- ResponseAppend_P(JSON_SNS_TEMP, "LMT01", temp);
+ ResponseAppend_P(JSON_SNS_F_TEMP, "LMT01", Settings.flag2.temperature_resolution, &lmt01_temperature);
#ifdef USE_DOMOTICZ
if (0 == TasmotaGlobal.tele_period) {
- DomoticzSensor(DZ_TEMP, temp);
+ DomoticzFloatSensor(DZ_TEMP, lmt01_temperature);
}
#endif // USE_DOMOTICZ
#ifdef USE_KNX
@@ -102,7 +99,7 @@ void LMT01_Show(bool Json) {
#endif // USE_KNX
#ifdef USE_WEBSERVER
} else {
- WSContentSend_PD(HTTP_SNS_TEMP, "LMT01", temp, TempUnit());
+ WSContentSend_Temp("LMT01", lmt01_temperature);
#endif // USE_WEBSERVER
}
}
diff --git a/tasmota/xsns_78_ezortd.ino b/tasmota/xsns_78_ezortd.ino
index cf731a346..c9d37fa68 100644
--- a/tasmota/xsns_78_ezortd.ino
+++ b/tasmota/xsns_78_ezortd.ino
@@ -35,15 +35,14 @@ struct EZORTD : public EZOStruct {
virtual void Show(bool json, const char *name)
{
- char str[10];
- dtostrfd(ConvertTemp(temperature), Settings.flag2.temperature_resolution, str);
+ float temp = ConvertTemp(temperature);
if (json) {
- ResponseAppend_P(PSTR(",\"%s\":{\"" D_JSON_TEMPERATURE "\":%s}"), name, str);
+ ResponseAppend_P(JSON_SNS_F_TEMP, name, Settings.flag2.temperature_resolution, &temp);
}
#ifdef USE_WEBSERVER
else {
- WSContentSend_PD(HTTP_SNS_TEMP, name, str, TempUnit());
+ WSContentSend_Temp(name, temp);
#endif // USE_WEBSERVER
}
}
diff --git a/tasmota/xsns_81_seesaw_soil.ino b/tasmota/xsns_81_seesaw_soil.ino
index e18a5db5c..23962275d 100644
--- a/tasmota/xsns_81_seesaw_soil.ino
+++ b/tasmota/xsns_81_seesaw_soil.ino
@@ -272,11 +272,9 @@ void seeSoilEverySecond(void) { // update sensor values and publ
#endif // SEESAW_SOIL_PUBLISH
void seeSoilShow(bool json) {
- char temperature[FLOATSZ];
char sensor_name[sizeof(SeeSoil.name) + 3];
for (uint32_t i = 0; i < SeeSoil.count; i++) {
- dtostrfd(SeeSoilSNS[i].temperature, Settings.flag2.temperature_resolution, temperature);
seeSoilName(i, sensor_name, sizeof(sensor_name));
if (json) {
ResponseAppend_P(PSTR(",")); // compose tele json
@@ -296,20 +294,20 @@ void seeSoilShow(bool json) {
WSContentSend_PD(HTTP_SNS_ANALOG, sensor_name, 0, SeeSoilSNS[i].capacitance);
#endif // SEESAW_SOIL_RAW
WSContentSend_PD(HTTP_SNS_MOISTURE, sensor_name, (uint32_t) SeeSoilSNS[i].moisture);
- WSContentSend_PD(HTTP_SNS_TEMP, sensor_name, temperature, TempUnit());
+ WSContentSend_Temp(sensor_name, SeeSoilSNS[i].temperature);
#endif // USE_WEBSERVER
}
} // for each sensor connected
}
void seeSoilJson(int no) { // common json
- char temperature[FLOATSZ];
char sensor_name[sizeof(SeeSoil.name) + 3];
-
seeSoilName(no, sensor_name, sizeof(sensor_name));
- dtostrfd(SeeSoilSNS[no].temperature, Settings.flag2.temperature_resolution, temperature);
- ResponseAppend_P(PSTR ("\"%s\":{\"" D_JSON_ID "\":\"%02X\",\"" D_JSON_TEMPERATURE "\":%s,\"" D_JSON_MOISTURE "\":%u}"),
- sensor_name, SeeSoilSNS[no].address, temperature, (uint32_t) SeeSoilSNS[no].moisture);
+
+ ResponseAppend_P(PSTR ("\"%s\":{\"" D_JSON_ID "\":\"%02X\",\"" D_JSON_TEMPERATURE "\":%*_f,\"" D_JSON_MOISTURE "\":%u}"),
+ sensor_name, SeeSoilSNS[no].address,
+ Settings.flag2.temperature_resolution, &SeeSoilSNS[no].temperature,
+ (uint32_t) SeeSoilSNS[no].moisture);
}
void seeSoilName(int no, char *name, int len) // generates a sensor name
diff --git a/tasmota/xsns_83_neopool.ino b/tasmota/xsns_83_neopool.ino
index 588f87ce5..2bf87acd0 100644
--- a/tasmota/xsns_83_neopool.ino
+++ b/tasmota/xsns_83_neopool.ino
@@ -866,10 +866,14 @@ void NeoPoolShow(bool json)
// Temperature
if (NeoPoolGetData(MBF_PAR_TEMPERATURE_ACTIVE)) {
+/*
dtostrfd(Settings.flag.temperature_conversion ?
(float)NeoPoolGetData(MBF_MEASURE_TEMPERATURE)/10 * 1.8 + 32 :
(float)NeoPoolGetData(MBF_MEASURE_TEMPERATURE)/10, Settings.flag2.temperature_resolution, parameter);
ResponseAppend_P(PSTR("%s\"" D_TEMPERATURE "\":%s"), delimiter, parameter);
+*/
+ float temp = ConvertTemp((float)NeoPoolGetData(MBF_MEASURE_TEMPERATURE) / 10);
+ ResponseAppend_P(PSTR("%s\"" D_TEMPERATURE "\":%*_f"), delimiter, Settings.flag2.temperature_resolution, &temp);
*delimiter = ',';
}
@@ -939,8 +943,12 @@ void NeoPoolShow(bool json)
// Temperature
if (NeoPoolGetData(MBF_PAR_TEMPERATURE_ACTIVE)) {
+/*
dtostrfd(Settings.flag.temperature_conversion?(float)NeoPoolGetData(MBF_MEASURE_TEMPERATURE)/10 * 1.8 + 32:(float)NeoPoolGetData(MBF_MEASURE_TEMPERATURE)/10, Settings.flag2.temperature_resolution, parameter);
WSContentSend_PD(HTTP_SNS_TEMP, neopool_type, parameter, TempUnit());
+*/
+ float temp = ConvertTemp((float)NeoPoolGetData(MBF_MEASURE_TEMPERATURE) / 10);
+ WSContentSend_Temp(neopool_type, temp);
}
// pH