added IP and version to MQTT start payload, added support for RC100/Moduline 1010, Fixed Junkers thermostat writing

This commit is contained in:
Paul
2020-03-06 17:13:29 +01:00
parent 64def6e4cd
commit 1385af3d54
8 changed files with 52 additions and 43 deletions

View File

@@ -9,16 +9,18 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
### Added ### Added
- Solar Module SM200 support - Solar Module SM200 support
- `set master_thermostat <product id>` 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) - MM10 Mixing module support (thanks @MichaelDvP)
- MM200 warm water circuits (https://github.com/proddy/EMS-ESP/pull/315) - 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 - Added model type (Buderus, Sieger, Junkers, Nefit, Bosch, Worcester) to device names
- `set master_thermostat <product id>` to choose with thermostat is master when there are multiple on the bus
- `boiler wwonetime` command from Telnet - `boiler wwonetime` command from Telnet
- `set bus_id <ID>` to support multiple EMS-ESP circuits. Default is 0x0B to mimic a service key. - `set bus_id <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 - 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 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) - 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 - 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 - 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 - `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 ### Removed
- `autodetect scan` - `autodetect scan`

View File

@@ -598,7 +598,14 @@ void MyESP::_mqttOnConnect() {
_mqtt_last_connection = millis(); _mqtt_last_connection = millis();
// say we're alive to the Last Will topic // 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<capacity> doc;
JsonObject payload = doc.to<JsonObject>();
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 // subscribe to general subs
mqttSubscribe(MQTT_TOPIC_RESTART); mqttSubscribe(MQTT_TOPIC_RESTART);

View File

@@ -9,7 +9,7 @@
#ifndef MyESP_h #ifndef MyESP_h
#define MyESP_h #define MyESP_h
#define MYESP_VERSION "1.2.33" #define MYESP_VERSION "1.2.34"
#include <ArduinoJson.h> #include <ArduinoJson.h>
#include <ArduinoOTA.h> #include <ArduinoOTA.h>

View File

@@ -154,7 +154,7 @@ _EMS_THERMOSTAT_MODE _getThermostatMode(uint8_t hc_num) {
} else if (mode == 2) { } else if (mode == 2) {
thermoMode = EMS_THERMOSTAT_MODE_AUTO; 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) { if (mode == 0) {
thermoMode = EMS_THERMOSTAT_MODE_MANUAL; thermoMode = EMS_THERMOSTAT_MODE_MANUAL;
} else if (mode == 1) { } else if (mode == 1) {
@@ -206,6 +206,8 @@ _EMS_THERMOSTAT_MODE _getThermostatMode2(uint8_t hc_num) {
} else if (mode == 1) { } else if (mode == 1) {
thermoMode = EMS_THERMOSTAT_MODE_COMFORT; thermoMode = EMS_THERMOSTAT_MODE_COMFORT;
} }
} else if (model == EMS_DEVICE_FLAG_RC100) {
thermoMode = EMS_THERMOSTAT_MODE_DAY; // no modes on these devices
} }
return thermoMode; return thermoMode;
@@ -425,7 +427,7 @@ void showInfo() {
// Render Thermostat Date & Time // Render Thermostat Date & Time
uint8_t model = ems_getThermostatFlags(); 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); myDebug_P(PSTR(" Thermostat time is %s"), EMS_Thermostat.datetime);
} }

View File

@@ -666,7 +666,7 @@ void _ems_sendTelegram() {
} }
// send the telegram to the UART Tx // 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) if (EMS_TX_STATUS_OK == _txStatus || EMS_TX_STATUS_IDLE == _txStatus)
EMS_Sys_Status.emsTxStatus = EMS_TX_STATUS_WAIT; EMS_Sys_Status.emsTxStatus = EMS_TX_STATUS_WAIT;
else { 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].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].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 _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 brand = 0; // unknown
} }
/* #ifdef EMSESP_SIMULATE
// override to emulate other thermostats - FR100 // override to emulate other thermostats - FR100
if (device_id == 0x17) { if (device_id == 0x17) {
brand = 2; brand = 2;
device_id = 0x10; device_id = 0x10;
product_id = 107; //product_id = 107; // FR100
product_id = 192; // FW120
} }
*/ #endif
// first scan through matching boilers, as these are unique to DeviceID 0x08 // first scan through matching boilers, as these are unique to DeviceID 0x08
uint8_t i = 0; uint8_t i = 0;
@@ -2045,6 +2046,7 @@ void ems_getThermostatValues() {
} }
break; break;
case EMS_DEVICE_FLAG_RC300: case EMS_DEVICE_FLAG_RC300:
case EMS_DEVICE_FLAG_RC100:
ems_doReadCommand(EMS_TYPE_RCPLUSStatusMessage_HC1, device_id); ems_doReadCommand(EMS_TYPE_RCPLUSStatusMessage_HC1, device_id);
ems_doReadCommand(EMS_TYPE_RCPLUSStatusMessage_HC2, device_id); ems_doReadCommand(EMS_TYPE_RCPLUSStatusMessage_HC2, device_id);
ems_doReadCommand(EMS_TYPE_RCPLUSStatusMessage_HC3, 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), _float_to_char(s, temperature),
hc_num, hc_num,
temptype); 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); 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) { 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; 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 // check mode to determine offset
if (EMS_Thermostat.hc[hc_num - 1].mode == 1) { // auto if (EMS_Thermostat.hc[hc_num - 1].mode == 1) { // auto
EMS_TxTelegram.offset = 0x08; // auto offset EMS_TxTelegram.offset = 0x08; // auto offset
@@ -2433,14 +2437,9 @@ void ems_setThermostatTemp(float temperature, uint8_t hc_num, _THERMOSTAT_TEMP_M
default: default:
case THERMOSTAT_TEMP_MODE_AUTO: // automatic selection, if no type is defined, we use the standard code case THERMOSTAT_TEMP_MODE_AUTO: // automatic selection, if no type is defined, we use the standard code
if (model == EMS_DEVICE_FLAG_RC35) { if (model == EMS_DEVICE_FLAG_RC35) {
// https://github.com/proddy/EMS-ESP/issues/310 EMS_TxTelegram.offset = EMS_OFFSET_RC35Set_seltemp; // https://github.com/proddy/EMS-ESP/issues/310
EMS_TxTelegram.offset = EMS_OFFSET_RC35Set_seltemp;
} else { } else {
if (EMS_Thermostat.hc[hc_num - 1].mode_type == 0) { EMS_TxTelegram.offset = (EMS_Thermostat.hc[hc_num - 1].mode_type == 0) ? EMS_OFFSET_RC35Set_temp_night : EMS_OFFSET_RC35Set_temp_day;
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;
}
} }
break; break;
} }
@@ -2480,11 +2479,8 @@ void ems_setThermostatTemp(float temperature, uint8_t hc_num, _THERMOSTAT_TEMP_M
break; break;
default: default:
case THERMOSTAT_TEMP_MODE_AUTO: // automatic selection, if no type is defined, we use the standard code 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_TxTelegram.offset = EMS_OFFSET_JunkersSetMessage_night_temp; (EMS_Thermostat.hc[hc_num - 1].mode_type == 0) ? EMS_OFFSET_JunkersSetMessage_night_temp : EMS_OFFSET_JunkersSetMessage_day_temp;
} else if (EMS_Thermostat.hc[hc_num - 1].mode_type == 1) {
EMS_TxTelegram.offset = EMS_OFFSET_JunkersSetMessage_day_temp;
}
break; break;
} }
EMS_TxTelegram.type = EMS_TYPE_JunkersSetMessage1_HC1 + hc_num - 1; // 0x65 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; uint8_t set_mode;
// RC300/1000/3000 have different settings // 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) { if (mode == 1) {
set_mode = 0; // manual set_mode = 0; // manual
} else { } else {
@@ -2617,7 +2613,7 @@ void ems_setThermostatMode(uint8_t mode, uint8_t hc_num) {
EMS_TxTelegram.type_validate = EMS_TxTelegram.type; 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; EMS_TxTelegram.offset = EMS_OFFSET_RCPLUSSet_mode;
if (hc_num == 1) { if (hc_num == 1) {
@@ -2959,7 +2955,7 @@ const _EMS_Type EMS_Types[] = {
// Easy // Easy
{EMS_DEVICE_UPDATE_FLAG_THERMOSTAT, EMS_TYPE_EasyStatusMessage, "EasyStatusMessage", _process_EasyStatusMessage}, {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_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_HC2, "RCPLUSStatusMessage_HC2", _process_RCPLUSStatusMessage},
{EMS_DEVICE_UPDATE_FLAG_THERMOSTAT, EMS_TYPE_RCPLUSStatusMessage_HC3, "RCPLUSStatusMessage_HC3", _process_RCPLUSStatusMessage}, {EMS_DEVICE_UPDATE_FLAG_THERMOSTAT, EMS_TYPE_RCPLUSStatusMessage_HC3, "RCPLUSStatusMessage_HC3", _process_RCPLUSStatusMessage},

View File

@@ -59,7 +59,8 @@ enum EMS_DEVICE_FLAG_TYPES : uint8_t {
EMS_DEVICE_FLAG_RC30 = 4, EMS_DEVICE_FLAG_RC30 = 4,
EMS_DEVICE_FLAG_RC30N = 5, // newer type of RC30 with RC35 circuit EMS_DEVICE_FLAG_RC30N = 5, // newer type of RC30 with RC35 circuit
EMS_DEVICE_FLAG_RC35 = 6, 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_JUNKERS1 = 31, // use 0x65 for HC
EMS_DEVICE_FLAG_JUNKERS2 = 32, // use 0x79 for HC, older models EMS_DEVICE_FLAG_JUNKERS2 = 32, // use 0x79 for HC, older models
EMS_DEVICE_FLAG_JUNKERS = (1 << 6), // 6th bit set if its junkers HT3 EMS_DEVICE_FLAG_JUNKERS = (1 << 6), // 6th bit set if its junkers HT3

View File

@@ -295,7 +295,7 @@ static const _EMS_Device EMS_Devices[] = {
{86, EMS_DEVICE_TYPE_THERMOSTAT, "RC35", EMS_DEVICE_FLAG_RC35}, // 0x10 {86, EMS_DEVICE_TYPE_THERMOSTAT, "RC35", EMS_DEVICE_FLAG_RC35}, // 0x10
{93, EMS_DEVICE_TYPE_THERMOSTAT, "RC20RF", EMS_DEVICE_FLAG_RC20}, // 0x19 {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 {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 {165, EMS_DEVICE_TYPE_THERMOSTAT, "RC100/Moduline 1000/1010", EMS_DEVICE_FLAG_RC100}, // 0x18, 0x38
// Sieger // Sieger
{76, EMS_DEVICE_TYPE_THERMOSTAT, "Sieger ES73", EMS_DEVICE_FLAG_RC35}, // 0x10 {76, EMS_DEVICE_TYPE_THERMOSTAT, "Sieger ES73", EMS_DEVICE_FLAG_RC35}, // 0x10

View File

@@ -1 +1 @@
#define APP_VERSION "1.9.5b49" #define APP_VERSION "1.9.5b50"