diff --git a/CHANGELOG.md b/CHANGELOG.md index 9820b7e44..d54df1c76 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -9,16 +9,18 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 ### Added - Solar Module SM200 support -- `set master_thermostat ` to choose with thermostat is master when there are multiple on the bus +- Support writing to Junkers FR100 thermostats +- Support writing to RC100, Moduline 1000/1010 thermostats - MM10 Mixing module support (thanks @MichaelDvP) - MM200 warm water circuits (https://github.com/proddy/EMS-ESP/pull/315) -- First implementation of writing to Junker Thermostats (thanks @Neonox31) +- Support for Moduline 200 and Sieger ES72 thermostats +- First implementation of writing to generic Junker Thermostats (thanks @Neonox31) - Added model type (Buderus, Sieger, Junkers, Nefit, Bosch, Worcester) to device names +- `set master_thermostat ` to choose with thermostat is master when there are multiple on the bus - `boiler wwonetime` command from Telnet - `set bus_id ` to support multiple EMS-ESP circuits. Default is 0x0B to mimic a service key. +- `mqtt_nestedjson` option to disable multiple data records being nested into a single JSON string - MQTT publish messages are queued and gracefully published every second to avoid TCP blocks -- Added `mqtt_nestedjson` option to disable multiple data records being nested into a single JSON string -- Support for Moduline 200 and Sieger ES72 thermostats - Added features to WW messages (0x33, 0x34) to improve WW monitoring. (PR#338 by @ypaindaveine) - Added mixing log and stub for EMS type 0xAC (PR#338 by @ypaindaveine) @@ -31,6 +33,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 - improved MQTT publishing to stop network flooding. `publish_time` of -1 is no publish, 0 is automatic otherwise its a time interval - External sensors (like Dallas DS18*) are sent as a nested MQTT topic including their unqiue identifier - `mqttlog` console command renamed to `mqttqueue` to only show the current publish queue +- `status` payload on start-up shows the IP and Version of EMS-ESP ### Removed - `autodetect scan` diff --git a/src/MyESP.cpp b/src/MyESP.cpp index 3327da461..9ca191110 100644 --- a/src/MyESP.cpp +++ b/src/MyESP.cpp @@ -598,7 +598,14 @@ void MyESP::_mqttOnConnect() { _mqtt_last_connection = millis(); // say we're alive to the Last Will topic - mqttPublish(_mqtt_will_topic, _mqtt_will_online_payload, true); // force retain on + // send online appended with the version information as JSON + const size_t capacity = JSON_OBJECT_SIZE(3); + StaticJsonDocument doc; + JsonObject payload = doc.to(); + payload["status"] = _mqtt_will_online_payload; + payload["version"] = _app_version; + payload["IP"] = WiFi.localIP().toString(); + mqttPublish(_mqtt_will_topic, doc, true); // force retain on // subscribe to general subs mqttSubscribe(MQTT_TOPIC_RESTART); diff --git a/src/MyESP.h b/src/MyESP.h index c93c54707..aa50c097f 100644 --- a/src/MyESP.h +++ b/src/MyESP.h @@ -9,7 +9,7 @@ #ifndef MyESP_h #define MyESP_h -#define MYESP_VERSION "1.2.33" +#define MYESP_VERSION "1.2.34" #include #include diff --git a/src/ems-esp.cpp b/src/ems-esp.cpp index 92742f577..ebe108b09 100644 --- a/src/ems-esp.cpp +++ b/src/ems-esp.cpp @@ -154,7 +154,7 @@ _EMS_THERMOSTAT_MODE _getThermostatMode(uint8_t hc_num) { } else if (mode == 2) { thermoMode = EMS_THERMOSTAT_MODE_AUTO; } - } else if (model == EMS_DEVICE_FLAG_RC300) { + } else if ((model == EMS_DEVICE_FLAG_RC300) || (model == EMS_DEVICE_FLAG_RC100)) { if (mode == 0) { thermoMode = EMS_THERMOSTAT_MODE_MANUAL; } else if (mode == 1) { @@ -206,6 +206,8 @@ _EMS_THERMOSTAT_MODE _getThermostatMode2(uint8_t hc_num) { } else if (mode == 1) { thermoMode = EMS_THERMOSTAT_MODE_COMFORT; } + } else if (model == EMS_DEVICE_FLAG_RC100) { + thermoMode = EMS_THERMOSTAT_MODE_DAY; // no modes on these devices } return thermoMode; @@ -425,7 +427,7 @@ void showInfo() { // Render Thermostat Date & Time uint8_t model = ems_getThermostatFlags(); - if ((model != EMS_DEVICE_FLAG_EASY)) { + if (strlen(EMS_Thermostat.datetime) > 2) { myDebug_P(PSTR(" Thermostat time is %s"), EMS_Thermostat.datetime); } diff --git a/src/ems.cpp b/src/ems.cpp index f18926959..412b23e14 100644 --- a/src/ems.cpp +++ b/src/ems.cpp @@ -666,7 +666,7 @@ void _ems_sendTelegram() { } // send the telegram to the UART Tx - _EMS_TX_STATUS _txStatus = emsuart_tx_buffer(EMS_TxTelegram.data, EMS_TxTelegram.length); // send the telegram to the UART Tx + _EMS_TX_STATUS _txStatus = emsuart_tx_buffer(EMS_TxTelegram.data, EMS_TxTelegram.length); if (EMS_TX_STATUS_OK == _txStatus || EMS_TX_STATUS_IDLE == _txStatus) EMS_Sys_Status.emsTxStatus = EMS_TX_STATUS_WAIT; else { @@ -1386,7 +1386,7 @@ void _process_JunkersStatusMessage(_EMS_RxTelegram * EMS_RxTelegram) { _setValue(EMS_RxTelegram, &EMS_Thermostat.hc[hc].curr_roomTemp, EMS_OFFSET_JunkersStatusMessage_curr); // value is * 10 _setValue(EMS_RxTelegram, &EMS_Thermostat.hc[hc].setpoint_roomTemp, EMS_OFFSET_JunkersStatusMessage_setpoint); // value is * 10 - _setValue(EMS_RxTelegram, &EMS_Thermostat.hc[hc].mode_type, EMS_OFFSET_JunkersStatusMessage_daymode); // 3 = day, 2 = night + _setValue(EMS_RxTelegram, &EMS_Thermostat.hc[hc].mode_type, EMS_OFFSET_JunkersStatusMessage_daymode, 0); // first bit 1=day, 0=night _setValue(EMS_RxTelegram, &EMS_Thermostat.hc[hc].mode, EMS_OFFSET_JunkersStatusMessage_mode); // 1 = manual, 2 = auto } @@ -1841,14 +1841,15 @@ void _process_Version(_EMS_RxTelegram * EMS_RxTelegram) { brand = 0; // unknown } - /* +#ifdef EMSESP_SIMULATE // override to emulate other thermostats - FR100 if (device_id == 0x17) { - brand = 2; - device_id = 0x10; - product_id = 107; + brand = 2; + device_id = 0x10; + //product_id = 107; // FR100 + product_id = 192; // FW120 } -*/ +#endif // first scan through matching boilers, as these are unique to DeviceID 0x08 uint8_t i = 0; @@ -2045,6 +2046,7 @@ void ems_getThermostatValues() { } break; case EMS_DEVICE_FLAG_RC300: + case EMS_DEVICE_FLAG_RC100: ems_doReadCommand(EMS_TYPE_RCPLUSStatusMessage_HC1, device_id); ems_doReadCommand(EMS_TYPE_RCPLUSStatusMessage_HC2, device_id); ems_doReadCommand(EMS_TYPE_RCPLUSStatusMessage_HC3, device_id); @@ -2369,8 +2371,10 @@ void ems_setThermostatTemp(float temperature, uint8_t hc_num, _THERMOSTAT_TEMP_M _float_to_char(s, temperature), hc_num, temptype); - } else { + } else if (hc_num != 1) { myDebug_P(PSTR("Setting new thermostat temperature to %s for heating circuit %d"), _float_to_char(s, temperature), hc_num); + } else { + myDebug_P(PSTR("Setting new thermostat temperature to %s"), _float_to_char(s, temperature)); } if (model == EMS_DEVICE_FLAG_RC10) { @@ -2394,7 +2398,7 @@ void ems_setThermostatTemp(float temperature, uint8_t hc_num, _THERMOSTAT_TEMP_M EMS_TxTelegram.type_validate = EMS_TxTelegram.type; } - else if (model == EMS_DEVICE_FLAG_RC300) { + else if ((model == EMS_DEVICE_FLAG_RC300) || (model == EMS_DEVICE_FLAG_RC100)) { // check mode to determine offset if (EMS_Thermostat.hc[hc_num - 1].mode == 1) { // auto EMS_TxTelegram.offset = 0x08; // auto offset @@ -2433,14 +2437,9 @@ void ems_setThermostatTemp(float temperature, uint8_t hc_num, _THERMOSTAT_TEMP_M default: case THERMOSTAT_TEMP_MODE_AUTO: // automatic selection, if no type is defined, we use the standard code if (model == EMS_DEVICE_FLAG_RC35) { - // https://github.com/proddy/EMS-ESP/issues/310 - EMS_TxTelegram.offset = EMS_OFFSET_RC35Set_seltemp; + EMS_TxTelegram.offset = EMS_OFFSET_RC35Set_seltemp; // https://github.com/proddy/EMS-ESP/issues/310 } else { - if (EMS_Thermostat.hc[hc_num - 1].mode_type == 0) { - EMS_TxTelegram.offset = EMS_OFFSET_RC35Set_temp_night; - } else if (EMS_Thermostat.hc[hc_num - 1].mode_type == 1) { - EMS_TxTelegram.offset = EMS_OFFSET_RC35Set_temp_day; - } + EMS_TxTelegram.offset = (EMS_Thermostat.hc[hc_num - 1].mode_type == 0) ? EMS_OFFSET_RC35Set_temp_night : EMS_OFFSET_RC35Set_temp_day; } break; } @@ -2480,11 +2479,8 @@ void ems_setThermostatTemp(float temperature, uint8_t hc_num, _THERMOSTAT_TEMP_M break; default: case THERMOSTAT_TEMP_MODE_AUTO: // automatic selection, if no type is defined, we use the standard code - if (EMS_Thermostat.hc[hc_num - 1].mode_type == 0) { - EMS_TxTelegram.offset = EMS_OFFSET_JunkersSetMessage_night_temp; - } else if (EMS_Thermostat.hc[hc_num - 1].mode_type == 1) { - EMS_TxTelegram.offset = EMS_OFFSET_JunkersSetMessage_day_temp; - } + EMS_TxTelegram.offset = + (EMS_Thermostat.hc[hc_num - 1].mode_type == 0) ? EMS_OFFSET_JunkersSetMessage_night_temp : EMS_OFFSET_JunkersSetMessage_day_temp; break; } EMS_TxTelegram.type = EMS_TYPE_JunkersSetMessage1_HC1 + hc_num - 1; // 0x65 @@ -2546,7 +2542,7 @@ void ems_setThermostatMode(uint8_t mode, uint8_t hc_num) { uint8_t set_mode; // RC300/1000/3000 have different settings - if (model == EMS_DEVICE_FLAG_RC300) { + if ((model == EMS_DEVICE_FLAG_RC300) || (model == EMS_DEVICE_FLAG_RC100)) { if (mode == 1) { set_mode = 0; // manual } else { @@ -2617,7 +2613,7 @@ void ems_setThermostatMode(uint8_t mode, uint8_t hc_num) { EMS_TxTelegram.type_validate = EMS_TxTelegram.type; } - else if (model == EMS_DEVICE_FLAG_RC300) { + else if ((model == EMS_DEVICE_FLAG_RC300) || (model == EMS_DEVICE_FLAG_RC100)) { EMS_TxTelegram.offset = EMS_OFFSET_RCPLUSSet_mode; if (hc_num == 1) { @@ -2959,7 +2955,7 @@ const _EMS_Type EMS_Types[] = { // Easy {EMS_DEVICE_UPDATE_FLAG_THERMOSTAT, EMS_TYPE_EasyStatusMessage, "EasyStatusMessage", _process_EasyStatusMessage}, - // Nefit 1010, RC300, RC310 (EMS Plus) + // Nefit 1010, RC300, RC100, RC310 (EMS Plus) {EMS_DEVICE_UPDATE_FLAG_THERMOSTAT, EMS_TYPE_RCPLUSStatusMessage_HC1, "RCPLUSStatusMessage_HC1", _process_RCPLUSStatusMessage}, {EMS_DEVICE_UPDATE_FLAG_THERMOSTAT, EMS_TYPE_RCPLUSStatusMessage_HC2, "RCPLUSStatusMessage_HC2", _process_RCPLUSStatusMessage}, {EMS_DEVICE_UPDATE_FLAG_THERMOSTAT, EMS_TYPE_RCPLUSStatusMessage_HC3, "RCPLUSStatusMessage_HC3", _process_RCPLUSStatusMessage}, diff --git a/src/ems.h b/src/ems.h index 9856313be..18844b1ce 100644 --- a/src/ems.h +++ b/src/ems.h @@ -59,7 +59,8 @@ enum EMS_DEVICE_FLAG_TYPES : uint8_t { EMS_DEVICE_FLAG_RC30 = 4, EMS_DEVICE_FLAG_RC30N = 5, // newer type of RC30 with RC35 circuit EMS_DEVICE_FLAG_RC35 = 6, - EMS_DEVICE_FLAG_RC300 = 7, + EMS_DEVICE_FLAG_RC100 = 7, + EMS_DEVICE_FLAG_RC300 = 8, EMS_DEVICE_FLAG_JUNKERS1 = 31, // use 0x65 for HC EMS_DEVICE_FLAG_JUNKERS2 = 32, // use 0x79 for HC, older models EMS_DEVICE_FLAG_JUNKERS = (1 << 6), // 6th bit set if its junkers HT3 diff --git a/src/ems_devices.h b/src/ems_devices.h index 273b178da..e9ffbe6a1 100644 --- a/src/ems_devices.h +++ b/src/ems_devices.h @@ -287,15 +287,15 @@ static const _EMS_Device EMS_Devices[] = { {157, EMS_DEVICE_TYPE_THERMOSTAT, "Buderus RC200/Bosch CW100/Junkers CW100", EMS_DEVICE_FLAG_NO_WRITE}, // 0x18, cannot write // Buderus/Nefit specific - {79, EMS_DEVICE_TYPE_THERMOSTAT, "RC10/Moduline 100", EMS_DEVICE_FLAG_RC10}, // 0x17 - {80, EMS_DEVICE_TYPE_THERMOSTAT, "Moduline 200", EMS_DEVICE_FLAG_RC10}, // 0x17 - {77, EMS_DEVICE_TYPE_THERMOSTAT, "RC20/Moduline 300", EMS_DEVICE_FLAG_RC20}, // 0x17 - {67, EMS_DEVICE_TYPE_THERMOSTAT, "RC30", EMS_DEVICE_FLAG_RC30N}, // 0x10 - based on RC35 - {78, EMS_DEVICE_TYPE_THERMOSTAT, "Moduline 400", EMS_DEVICE_FLAG_RC30}, // 0x10 - {86, EMS_DEVICE_TYPE_THERMOSTAT, "RC35", EMS_DEVICE_FLAG_RC35}, // 0x10 - {93, EMS_DEVICE_TYPE_THERMOSTAT, "RC20RF", EMS_DEVICE_FLAG_RC20}, // 0x19 - {158, EMS_DEVICE_TYPE_THERMOSTAT, "RC300/RC310/Moduline 3000/Bosch CW400/W-B Sense II", EMS_DEVICE_FLAG_RC300}, // 0x10 - {165, EMS_DEVICE_TYPE_THERMOSTAT, "RC100/Moduline 1000/1010", EMS_DEVICE_FLAG_RC300 | EMS_DEVICE_FLAG_NO_WRITE}, // 0x18, 0x38 - cannot write + {79, EMS_DEVICE_TYPE_THERMOSTAT, "RC10/Moduline 100", EMS_DEVICE_FLAG_RC10}, // 0x17 + {80, EMS_DEVICE_TYPE_THERMOSTAT, "Moduline 200", EMS_DEVICE_FLAG_RC10}, // 0x17 + {77, EMS_DEVICE_TYPE_THERMOSTAT, "RC20/Moduline 300", EMS_DEVICE_FLAG_RC20}, // 0x17 + {67, EMS_DEVICE_TYPE_THERMOSTAT, "RC30", EMS_DEVICE_FLAG_RC30N}, // 0x10 - based on RC35 + {78, EMS_DEVICE_TYPE_THERMOSTAT, "Moduline 400", EMS_DEVICE_FLAG_RC30}, // 0x10 + {86, EMS_DEVICE_TYPE_THERMOSTAT, "RC35", EMS_DEVICE_FLAG_RC35}, // 0x10 + {93, EMS_DEVICE_TYPE_THERMOSTAT, "RC20RF", EMS_DEVICE_FLAG_RC20}, // 0x19 + {158, EMS_DEVICE_TYPE_THERMOSTAT, "RC300/RC310/Moduline 3000/Bosch CW400/W-B Sense II", EMS_DEVICE_FLAG_RC300}, // 0x10 + {165, EMS_DEVICE_TYPE_THERMOSTAT, "RC100/Moduline 1000/1010", EMS_DEVICE_FLAG_RC100}, // 0x18, 0x38 // Sieger {76, EMS_DEVICE_TYPE_THERMOSTAT, "Sieger ES73", EMS_DEVICE_FLAG_RC35}, // 0x10 diff --git a/src/version.h b/src/version.h index 28bd23e18..4036f5327 100644 --- a/src/version.h +++ b/src/version.h @@ -1 +1 @@ -#define APP_VERSION "1.9.5b49" +#define APP_VERSION "1.9.5b50"