diff --git a/src/ems-esp.ino b/src/ems-esp.ino index 3a2570d60..395fb186f 100644 --- a/src/ems-esp.ino +++ b/src/ems-esp.ino @@ -392,13 +392,9 @@ void showInfo() { // For SM10 Solar Module if (EMS_Other.SM10) { - _renderIntValue("SM10 modulation pump", "%", EMS_Other.SM10modulationSolarPump); _renderFloatValue("SM10 collector temperature", "C", EMS_Other.SM10collectorTemp); - _renderBoolValue("SM10 pump", EMS_Other.SM10pumpOn); - myDebug(" SM10 uptime: %d days %d hours %d minutes", - EMS_Other.SM10Uptime / 1440, - (EMS_Other.SM10Uptime % 1440) / 60, - EMS_Other.SM10Uptime % 60); + _renderFloatValue("SM10 bottom temperature", "C", EMS_Other.SM10bottomTemp); + _renderIntValue("SM10 pump", "%", EMS_Other.SM10pumpModulation); } myDebug(""); // newline diff --git a/src/ems.cpp b/src/ems.cpp index dc0078add..3ac573d70 100644 --- a/src/ems.cpp +++ b/src/ems.cpp @@ -235,10 +235,9 @@ void ems_init() { EMS_Boiler.pump_mod_min = EMS_VALUE_INT_NOTSET; // Boiler circuit pump modulation min. power // Other EMS devices values - EMS_Other.SM10collectorTemp = EMS_VALUE_FLOAT_NOTSET; // collector temp from SM10 - EMS_Other.SM10modulationSolarPump = EMS_VALUE_INT_NOTSET; // modulation solar pump - EMS_Other.SM10pumpOn = EMS_VALUE_INT_NOTSET; // SM10 pump on/off - EMS_Other.SM10Uptime = EMS_VALUE_LONG_NOTSET; // SM10 uptime + EMS_Other.SM10collectorTemp = EMS_VALUE_FLOAT_NOTSET; // collector temp from SM10 + EMS_Other.SM10bottomTemp = EMS_VALUE_FLOAT_NOTSET; // bottom temp from SM10 + EMS_Other.SM10pumpModulation = EMS_VALUE_INT_NOTSET; // modulation solar pump SM10 // calculated values EMS_Boiler.tapwaterActive = EMS_VALUE_INT_NOTSET; // Hot tap water is on/off @@ -712,6 +711,8 @@ void _ems_processTelegram(_EMS_RxTelegram EMS_RxTelegram) { strlcpy(output_str, "Boiler", sizeof(output_str)); } else if (src == EMS_Thermostat.type_id) { strlcpy(output_str, "Thermostat", sizeof(output_str)); + } else if (src == EMS_ID_SM10) { + strlcpy(output_str, "SM10", sizeof(output_str)); } else { strlcpy(output_str, "0x", sizeof(output_str)); strlcat(output_str, _hextoa(src, buffer), sizeof(output_str)); @@ -729,6 +730,9 @@ void _ems_processTelegram(_EMS_RxTelegram EMS_RxTelegram) { } else if (dest == EMS_Boiler.type_id) { strlcat(output_str, "Boiler", sizeof(output_str)); strlcpy(color_s, COLOR_MAGENTA, sizeof(color_s)); + } else if (dest == EMS_ID_SM10) { + strlcat(output_str, "SM10", sizeof(output_str)); + strlcpy(color_s, COLOR_MAGENTA, sizeof(color_s)); } else if (dest == EMS_Thermostat.type_id) { strlcat(output_str, "Thermostat", sizeof(output_str)); strlcpy(color_s, COLOR_MAGENTA, sizeof(color_s)); @@ -1329,10 +1333,9 @@ void _ems_setThermostatModel(uint8_t thermostat_modelid) { */ void _process_SM10Monitor(uint8_t type, uint8_t * data, uint8_t length) { // TODO: polish off - EMS_Other.SM10collectorTemp = _toFloat(2, data); // collector temp from SM10 - EMS_Other.SM10modulationSolarPump = data[4]; // modulation solar pump - EMS_Other.SM10pumpOn = bitRead(data[6], 1); // SM10 pump on/off - EMS_Other.SM10Uptime = _toLong(8, data); // SM10 uptime + EMS_Other.SM10collectorTemp = _toFloat(2, data); // collector temp from SM10 + EMS_Other.SM10bottomTemp = _toFloat(5, data); // bottom temp from SM10 + EMS_Other.SM10pumpModulation = data[4]; // modulation solar pump } diff --git a/src/ems.h b/src/ems.h index 04db7eaca..90027f4da 100644 --- a/src/ems.h +++ b/src/ems.h @@ -20,8 +20,8 @@ #define EMS_MIN_TELEGRAM_LENGTH 6 // minimal length for a validation telegram, including CRC -// max length of a telegram, including CRC, for Rx and Tx. Data size is 32, so reserving 40 to be safe -#define EMS_MAX_TELEGRAM_LENGTH 40 +// max length of a telegram, including CRC, for Rx and Tx. +#define EMS_MAX_TELEGRAM_LENGTH 32 // default values #define EMS_VALUE_INT_ON 1 // boolean true @@ -228,11 +228,10 @@ typedef struct { // UBAParameterWW */ typedef struct { // SM10 Solar Module - SM10Monitor - bool SM10; // set true if there is a SM10 available - float SM10collectorTemp; // collector temp from SM10 - uint8_t SM10modulationSolarPump; // modulation solar pump - uint8_t SM10pumpOn; // SM10 pump on/off - uint32_t SM10Uptime; // SM10 uptime + bool SM10; // set true if there is a SM10 available + float SM10collectorTemp; // collector temp from SM10 + float SM10bottomTemp; // bottom temp from SM10 + uint8_t SM10pumpModulation; // modulation solar pump } _EMS_Other; // Thermostat data