From 68091b8042bdc4df1412a99c7d2e6febd66e8c57 Mon Sep 17 00:00:00 2001 From: Paul Date: Mon, 10 Jun 2019 12:30:00 +0200 Subject: [PATCH] https://github.com/proddy/EMS-ESP/issues/117 --- src/ems-esp.cpp | 6 ++---- src/ems.cpp | 45 ++++++++++++++++++++++----------------------- src/ems_devices.h | 6 +++--- src/version.h | 2 +- 4 files changed, 28 insertions(+), 31 deletions(-) diff --git a/src/ems-esp.cpp b/src/ems-esp.cpp index b85607069..58d013e8a 100644 --- a/src/ems-esp.cpp +++ b/src/ems-esp.cpp @@ -479,8 +479,7 @@ void showInfo() { myDebug_P(PSTR(" Thermostat: %s"), ems_getThermostatDescription(buffer_type)); // Render Current & Setpoint Room Temperature - if ((ems_getThermostatModel() == EMS_MODEL_EASY) || (ems_getThermostatModel() == EMS_MODEL_BOSCHEASY) || (ems_getThermostatModel() == EMS_MODEL_FR10) - || (ems_getThermostatModel() == EMS_MODEL_FW100)) { + if ((ems_getThermostatModel() == EMS_MODEL_EASY) || (ems_getThermostatModel() == EMS_MODEL_FR10) || (ems_getThermostatModel() == EMS_MODEL_FW100)) { // Temperatures are *10 _renderShortValue("Set room temperature", "C", EMS_Thermostat.setpoint_roomTemp, 10); // *100 _renderShortValue("Current room temperature", "C", EMS_Thermostat.curr_roomTemp, 10); // *100 @@ -695,8 +694,7 @@ void publishValues(bool force) { rootThermostat[THERMOSTAT_HC] = _int_to_char(s, EMSESP_Status.heating_circuit); // different logic depending on thermostat types - if ((ems_getThermostatModel() == EMS_MODEL_EASY) || (ems_getThermostatModel() == EMS_MODEL_BOSCHEASY) || (ems_getThermostatModel() == EMS_MODEL_FR10) - || (ems_getThermostatModel() == EMS_MODEL_FW100)) { + if ((ems_getThermostatModel() == EMS_MODEL_EASY) || (ems_getThermostatModel() == EMS_MODEL_FR10) || (ems_getThermostatModel() == EMS_MODEL_FW100)) { if (abs(EMS_Thermostat.setpoint_roomTemp) < EMS_VALUE_SHORT_NOTSET) rootThermostat[THERMOSTAT_SELTEMP] = (double)EMS_Thermostat.setpoint_roomTemp / 10; if (abs(EMS_Thermostat.curr_roomTemp) < EMS_VALUE_SHORT_NOTSET) diff --git a/src/ems.cpp b/src/ems.cpp index 3f1759f57..2a877499e 100644 --- a/src/ems.cpp +++ b/src/ems.cpp @@ -168,7 +168,6 @@ const _EMS_Type EMS_Types[] = { // Easy {EMS_MODEL_EASY, EMS_TYPE_EasyStatusMessage, "EasyStatusMessage", _process_EasyStatusMessage}, - {EMS_MODEL_BOSCHEASY, EMS_TYPE_EasyStatusMessage, "EasyStatusMessage", _process_EasyStatusMessage}, // Nefit 1010, RC300, RC310 (EMS Plus) {EMS_MODEL_ALL, EMS_TYPE_RCPLUSStatusMessage, "RCPLUSStatusMessage", _process_RCPLUSStatusMessage}, @@ -584,8 +583,8 @@ void _ems_sendTelegram() { } EMS_TxTelegram.data[EMS_TxTelegram.length - 1] = _crcCalculator(EMS_TxTelegram.data, EMS_TxTelegram.length); // add the CRC - emsuart_tx_buffer(EMS_TxTelegram.data, EMS_TxTelegram.length); // send the telegram to the UART Tx - EMS_TxQueue.shift(); // and remove from queue + emsuart_tx_buffer(EMS_TxTelegram.data, EMS_TxTelegram.length); // send the telegram to the UART Tx + EMS_TxQueue.shift(); // and remove from queue return; } @@ -1317,10 +1316,10 @@ void _process_RCPLUSStatusMode(_EMS_RxTelegram * EMS_RxTelegram) { * FR10 Junkers - type x6F01 */ void _process_JunkersStatusMessage(_EMS_RxTelegram * EMS_RxTelegram) { - // e.g. for FR10: 90 00 FF 00 00 6F 03 01 00 BE 00 BF - // e.g. for FW100: 90 00 FF 00 00 6F 03 02 00 D7 00 DA F3 34 00 C4 - EMS_Thermostat.curr_roomTemp = _toShort(EMS_OFFSET_JunkersStatusMessage_curr); // value is * 10 - EMS_Thermostat.setpoint_roomTemp = _toShort(EMS_OFFSET_JunkersStatusMessage_setpoint); // value is * 10 + // e.g. for FR10: 90 00 FF 00 00 6F 03 01 00 BE 00 BF + // e.g. for FW100: 90 00 FF 00 00 6F 03 02 00 D7 00 DA F3 34 00 C4 + EMS_Thermostat.curr_roomTemp = _toShort(EMS_OFFSET_JunkersStatusMessage_curr); // value is * 10 + EMS_Thermostat.setpoint_roomTemp = _toShort(EMS_OFFSET_JunkersStatusMessage_setpoint); // value is * 10 } /** @@ -1484,9 +1483,9 @@ void _process_HPMonitor2(_EMS_RxTelegram * EMS_RxTelegram) { */ void _process_ISM1StatusMessage(_EMS_RxTelegram * EMS_RxTelegram) { // e.g. B0 00 FF 00 00 03 32 00 00 00 00 13 00 D6 00 00 00 FB D0 F0 - EMS_Other.SMcollectorTemp = _toShort(4); // Collector Temperature - EMS_Other.SMbottomTemp = _toShort(6); // Temperature Bottom of Solar Boiler - EMS_Other.SM = true; + EMS_Other.SMcollectorTemp = _toShort(4); // Collector Temperature + EMS_Other.SMbottomTemp = _toShort(6); // Temperature Bottom of Solar Boiler + EMS_Other.SM = true; } /** @@ -1517,7 +1516,7 @@ void _process_SetPoints(_EMS_RxTelegram * EMS_RxTelegram) { * common for all thermostats */ void _process_RCTime(_EMS_RxTelegram * EMS_RxTelegram) { - if ((EMS_Thermostat.model_id == EMS_MODEL_EASY) || (EMS_Thermostat.model_id == EMS_MODEL_BOSCHEASY)) { + if ((EMS_Thermostat.model_id == EMS_MODEL_EASY)) { return; // not supported } @@ -1569,15 +1568,16 @@ void _process_Version(_EMS_RxTelegram * EMS_RxTelegram) { return; } - uint8_t product_id = _toByte(0); - char version[10] = {0}; + uint8_t product_id = _toByte(0); + + char version[10] = {0}; snprintf(version, sizeof(version), "%02d.%02d", _toByte(1), _toByte(2)); // see if its a known boiler int i = 0; bool typeFound = false; while (i < _Boiler_Types_max) { - if (Boiler_Types[i].product_id == product_id) { + if ((Boiler_Types[i].product_id == product_id) && ((EMS_RxTelegram->src & 0x7F) == EMS_ID_BOILER)) { typeFound = true; // we have a matching product id. i is the index. break; } @@ -1586,7 +1586,7 @@ void _process_Version(_EMS_RxTelegram * EMS_RxTelegram) { if (typeFound) { // its a boiler - myDebug_P(PSTR("Boiler found. Model %s (DeviceID:0x%02X ProductID:%d Version:%s)"), Boiler_Types[i].model_string, EMS_ID_BOILER, product_id, version); + myDebug_P(PSTR("Boiler found: %s (DeviceID:0x%02X ProductID:%d Version:%s)"), Boiler_Types[i].model_string, EMS_ID_BOILER, product_id, version); // add to list _addDevice(product_id, EMS_ID_BOILER, version, Boiler_Types[i].model_string); @@ -1629,7 +1629,7 @@ void _process_Version(_EMS_RxTelegram * EMS_RxTelegram) { if (typeFound) { // its a known thermostat if (EMS_Sys_Status.emsLogging >= EMS_SYS_LOGGING_BASIC) { - myDebug_P(PSTR("Thermostat found. Model %s (DeviceID:0x%02X ProductID:%d Version:%s)"), + myDebug_P(PSTR("Thermostat found: %s (DeviceID:0x%02X ProductID:%d Version:%s)"), Thermostat_Types[i].model_string, Thermostat_Types[i].device_id, product_id, @@ -1643,7 +1643,7 @@ void _process_Version(_EMS_RxTelegram * EMS_RxTelegram) { if (((EMS_Thermostat.device_id == EMS_ID_NONE) || (EMS_Thermostat.model_id == EMS_MODEL_NONE) || (EMS_Thermostat.device_id == Thermostat_Types[i].device_id)) && EMS_Thermostat.product_id == EMS_ID_NONE) { - myDebug_P(PSTR("* Setting Thermostat model to %s (DeviceID:0x%02X ProductID:%d Version:%s)"), + myDebug_P(PSTR("* Setting Thermostat to %s (DeviceID:0x%02X ProductID:%d Version:%s)"), Thermostat_Types[i].model_string, Thermostat_Types[i].device_id, product_id, @@ -1674,7 +1674,7 @@ void _process_Version(_EMS_RxTelegram * EMS_RxTelegram) { } if (typeFound) { - myDebug_P(PSTR("Device found. Model %s with DeviceID 0x%02X, ProductID %d, Version %s"), + myDebug_P(PSTR("Device found: %s with DeviceID 0x%02X, ProductID %d, Version %s"), Other_Types[i].model_string, Other_Types[i].device_id, product_id, @@ -1700,7 +1700,7 @@ void _process_Version(_EMS_RxTelegram * EMS_RxTelegram) { return; } else { - myDebug_P(PSTR("Unrecognized device found. DeviceID 0x%02X, ProductID %d, Version %s"), EMS_RxTelegram->src, product_id, version); + myDebug_P(PSTR("Unrecognized device found: DeviceID 0x%02X, ProductID %d, Version %s"), EMS_RxTelegram->src, product_id, version); // add to list _addDevice(product_id, EMS_RxTelegram->src, version, "unknown?"); @@ -1712,7 +1712,7 @@ void _process_Version(_EMS_RxTelegram * EMS_RxTelegram) { * Do a read command for the version with the src having the MSB set */ void _ems_detectJunkers() { - char s[20] = {0}; + char s[30] = {0}; snprintf(s, sizeof(s), "%02X %02X %02X 00 %02X", (EMS_ID_ME | 0x80), (EMS_ID_BOILER | 0x080), EMS_TYPE_Version, EMS_MAX_TELEGRAM_LENGTH); ems_sendRawTelegram(s); } @@ -1725,8 +1725,7 @@ void ems_discoverModels() { // boiler... ems_doReadCommand(EMS_TYPE_Version, EMS_ID_BOILER); - - _ems_detectJunkers(); // special hack for Junkers. + _ems_detectJunkers(); // special hack for Junkers detection // solar module... ems_doReadCommand(EMS_TYPE_Version, EMS_ID_SM); // check if there is Solar Module available @@ -1823,7 +1822,7 @@ void ems_getThermostatValues() { ems_doReadCommand(EMS_TYPE_RC35StatusMessage_HC2, type); // to get the setpoint temp ems_doReadCommand(EMS_TYPE_RC35Set_HC2, type); // to get the mode } - } else if ((model_id == EMS_MODEL_EASY) || (model_id == EMS_MODEL_BOSCHEASY)) { + } else if ((model_id == EMS_MODEL_EASY)) { ems_doReadCommand(EMS_TYPE_EasyStatusMessage, type); } diff --git a/src/ems_devices.h b/src/ems_devices.h index 9c6ff0448..9d0c898bf 100644 --- a/src/ems_devices.h +++ b/src/ems_devices.h @@ -135,7 +135,6 @@ typedef enum { EMS_MODEL_RC30, EMS_MODEL_RC35, EMS_MODEL_EASY, - EMS_MODEL_BOSCHEASY, EMS_MODEL_RC310, EMS_MODEL_CW100, EMS_MODEL_1010, @@ -154,7 +153,7 @@ typedef enum { const _Boiler_Type Boiler_Types[] = { {EMS_MODEL_UBA, 72, "MC10 Module"}, - {EMS_MODEL_UBA, 123, "Buderus GB172/Nefit Trendline"}, + {EMS_MODEL_UBA, 123, "Buderus GB172/Nefit Trendline/Junkers Cerapur"}, {EMS_MODEL_UBA, 115, "Nefit Topline Compact/Buderus GB162"}, {EMS_MODEL_UBA, 203, "Buderus Logamax U122/Junkers Cerapur"}, {EMS_MODEL_UBA, 208, "Buderus Logamax plus/GB192"}, @@ -195,7 +194,8 @@ const _Thermostat_Type Thermostat_Types[] = { // Easy devices - not currently supporting write operations {EMS_MODEL_EASY, 202, 0x18, "TC100/Nefit Easy", EMS_THERMOSTAT_WRITE_NO}, - {EMS_MODEL_BOSCHEASY, 206, 0x02, "Bosch Easy", EMS_THERMOSTAT_WRITE_NO}, + {EMS_MODEL_EASY, 203, 0x18, "Bosch EasyControl CT200", EMS_THERMOSTAT_WRITE_NO}, + {EMS_MODEL_EASY, 206, 0x02, "Bosch Easy", EMS_THERMOSTAT_WRITE_NO}, {EMS_MODEL_CW100, 157, 0x18, "CW100", EMS_THERMOSTAT_WRITE_NO}, // Buderus/Nefit diff --git a/src/version.h b/src/version.h index ff296e1aa..021e95b43 100644 --- a/src/version.h +++ b/src/version.h @@ -6,5 +6,5 @@ #pragma once #define APP_NAME "EMS-ESP" -#define APP_VERSION "1.8.0b12" +#define APP_VERSION "1.8.0b13" #define APP_HOSTNAME "ems-esp"