diff --git a/CHANGELOG.md b/CHANGELOG.md index c53b8e0e3..9820b7e44 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -10,7 +10,7 @@ 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 -- MM10 Mixer support (thanks @MichaelDvP) +- 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) - Added model type (Buderus, Sieger, Junkers, Nefit, Bosch, Worcester) to device names @@ -19,6 +19,8 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 - 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) ### Fixed - set boiler warm water temp on Junkers/Bosch HT3 diff --git a/src/MyESP.h b/src/MyESP.h index 25adf82aa..c93c54707 100644 --- a/src/MyESP.h +++ b/src/MyESP.h @@ -9,7 +9,7 @@ #ifndef MyESP_h #define MyESP_h -#define MYESP_VERSION "1.2.32" +#define MYESP_VERSION "1.2.33" #include #include @@ -215,7 +215,7 @@ static_assert(sizeof(RtcmemData) <= (RTCMEM_BLOCKS * 4u), "RTCMEM struct is too typedef struct { bool set; // is it a set command? - char key[55]; // longest is log (alternatively, the log command description could be shortened) + char key[60]; char description[110]; } command_t; diff --git a/src/ems-esp.cpp b/src/ems-esp.cpp index f9fa985ff..8d3d50fb4 100644 --- a/src/ems-esp.cpp +++ b/src/ems-esp.cpp @@ -105,14 +105,8 @@ static const command_t project_cmds[] PROGMEM = { {true, "tx_mode ", "changes Tx logic. 1=EMS generic, 2=EMS+, 3=HT3"}, {true, "bus_id ", "EMS-ESP's deviceID. 0B=Service Key (default), 0D=Modem, 0A=Hand terminal, 0F=Time module, 12=Error module"}, {true, "master_thermostat [product id]", "set default thermostat to use. No argument lists options"}, - {false, "info", "show current values deciphered from the EMS messages"}, - {false, "log ", "logging: none, basic, thermo, solar, mixer, raw, jabber, verbose, watch a type or device"}, - -#ifdef TESTS - {false, "test ", "insert a test telegram on to the EMS bus"}, -#endif - + {false, "log ", "logging: none, basic, thermo, solar, mixing, raw, jabber, verbose, watch a type or device"}, {false, "publish", "publish all values to MQTT"}, {false, "refresh", "fetch values from the EMS devices"}, {false, "devices [scan] | [scan deep] | [save]", "list detected devices, quick scan or deep scan and save as known devices"}, @@ -231,8 +225,8 @@ void showInfo() { myDebug_P(PSTR(" System logging set to Thermostat only")); } else if (sysLog == EMS_SYS_LOGGING_SOLARMODULE) { myDebug_P(PSTR(" System logging set to Solar Module only")); - } else if (sysLog == EMS_SYS_LOGGING_MIXERMODULE) { - myDebug_P(PSTR(" System logging set to Mixer Module only")); + } else if (sysLog == EMS_SYS_LOGGING_MIXINGMODULE) { + myDebug_P(PSTR(" System logging set to Mixing Module only")); } else if (sysLog == EMS_SYS_LOGGING_JABBER) { myDebug_P(PSTR(" System logging set to Jabber")); } else if (sysLog == EMS_SYS_LOGGING_WATCH) { @@ -1587,7 +1581,7 @@ void TelnetCommandCallback(uint8_t wc, const char * commandLine) { ems_setLogging(EMS_SYS_LOGGING_SOLARMODULE); ok = true; } else if (strcmp(second_cmd, "m") == 0) { - ems_setLogging(EMS_SYS_LOGGING_MIXERMODULE); + ems_setLogging(EMS_SYS_LOGGING_MIXINGMODULE); ok = true; } else if (strcmp(second_cmd, "r") == 0) { ems_setLogging(EMS_SYS_LOGGING_RAW); diff --git a/src/ems.cpp b/src/ems.cpp index e971402bf..bfb45634c 100644 --- a/src/ems.cpp +++ b/src/ems.cpp @@ -146,7 +146,7 @@ void ems_init() { EMS_Boiler.wWSelTemp = EMS_VALUE_INT_NOTSET; // Warm Water selected temperature EMS_Boiler.wWCircPump = EMS_VALUE_BOOL_NOTSET; // Warm Water circulation pump available EMS_Boiler.wWCircPumpMode = EMS_VALUE_INT_NOTSET; // Warm Water circulation pump mode - EMS_Boiler.wWCircPumpType = EMS_VALUE_BOOL_NOTSET; // Warm Water circulation pump type + EMS_Boiler.wWCircPumpType = EMS_VALUE_BOOL_NOTSET; // Warm Water circulation pump type EMS_Boiler.wWDesinfectTemp = EMS_VALUE_INT_NOTSET; // Warm Water desinfection temperature to prevent infection EMS_Boiler.wWComfort = EMS_VALUE_INT_NOTSET; // WW comfort mode @@ -180,16 +180,16 @@ void ems_init() { EMS_Boiler.switchTemp = EMS_VALUE_USHORT_NOTSET; // UBAMonitorWWMessage - EMS_Boiler.wWCurTmp = EMS_VALUE_USHORT_NOTSET; // Warm Water current temperature - EMS_Boiler.wWStarts = EMS_VALUE_LONG_NOTSET; // Warm Water # starts - EMS_Boiler.wWWorkM = EMS_VALUE_LONG_NOTSET; // Warm Water # minutes - EMS_Boiler.wWOneTime = EMS_VALUE_INT_NOTSET; // Warm Water one time function on/off - EMS_Boiler.wWDesinfecting = EMS_VALUE_INT_NOTSET; // Warm Water desinfection on/off - EMS_Boiler.wWReadiness = EMS_VALUE_INT_NOTSET; // Warm Water readiness on/off - EMS_Boiler.wWRecharging = EMS_VALUE_INT_NOTSET; // Warm Water recharge on/off - EMS_Boiler.wWTemperaturOK = EMS_VALUE_INT_NOTSET; // Warm Water temperatur ok on/off + EMS_Boiler.wWCurTmp = EMS_VALUE_USHORT_NOTSET; // Warm Water current temperature + EMS_Boiler.wWStarts = EMS_VALUE_LONG_NOTSET; // Warm Water # starts + EMS_Boiler.wWWorkM = EMS_VALUE_LONG_NOTSET; // Warm Water # minutes + EMS_Boiler.wWOneTime = EMS_VALUE_INT_NOTSET; // Warm Water one time function on/off + EMS_Boiler.wWDesinfecting = EMS_VALUE_INT_NOTSET; // Warm Water desinfection on/off + EMS_Boiler.wWReadiness = EMS_VALUE_INT_NOTSET; // Warm Water readiness on/off + EMS_Boiler.wWRecharging = EMS_VALUE_INT_NOTSET; // Warm Water recharge on/off + EMS_Boiler.wWTemperaturOK = EMS_VALUE_INT_NOTSET; // Warm Water temperatur ok on/off - EMS_Boiler.wWCurFlow = EMS_VALUE_INT_NOTSET; // WW current flow temp + EMS_Boiler.wWCurFlow = EMS_VALUE_INT_NOTSET; // WW current flow temp // UBATotalUptimeMessage EMS_Boiler.UBAuptime = EMS_VALUE_LONG_NOTSET; // Total UBA working hours @@ -326,8 +326,8 @@ void ems_setLogging(_EMS_SYS_LOGGING loglevel, bool quiet) { myDebug_P(PSTR("System Logging set to Thermostat only")); } else if (loglevel == EMS_SYS_LOGGING_SOLARMODULE) { myDebug_P(PSTR("System Logging set to Solar Module only")); - } else if (loglevel == EMS_SYS_LOGGING_MIXERMODULE) { - myDebug_P(PSTR("System Logging set to Mixer Module only")); + } else if (loglevel == EMS_SYS_LOGGING_MIXINGMODULE) { + myDebug_P(PSTR("System Logging set to Mixing Module only")); } else if (loglevel == EMS_SYS_LOGGING_RAW) { myDebug_P(PSTR("System Logging set to Raw mode")); } else if (loglevel == EMS_SYS_LOGGING_JABBER) { @@ -938,7 +938,7 @@ void _removeTxQueue() { /** * Check if hot tap water or heating is active - * using a quick hack for checking the heating. Selected Flow Temp >= 30 + * using a quick hack for checking the heating by looking at the Selected Flow Temp */ void _checkActive() { // hot tap water, using flow to check instead of the burner power @@ -957,10 +957,10 @@ void _checkActive() { * received only after requested (not broadcasted) */ void _process_UBAParameterWW(_EMS_RxTelegram * EMS_RxTelegram) { - _setValue(EMS_RxTelegram, &EMS_Boiler.wWActivated, 1); // 0xFF means on - _setValue(EMS_RxTelegram, &EMS_Boiler.wWCircPump, 6); // 0xFF means on - _setValue(EMS_RxTelegram, &EMS_Boiler.wWCircPumpMode, 7); // 1=1x3min... 6=6x3min, 7=continuous - _setValue(EMS_RxTelegram, &EMS_Boiler.wWCircPumpType, 10); // 0 = charge pump, 0xff = 3-way valve + _setValue(EMS_RxTelegram, &EMS_Boiler.wWActivated, 1); // 0xFF means on + _setValue(EMS_RxTelegram, &EMS_Boiler.wWCircPump, 6); // 0xFF means on + _setValue(EMS_RxTelegram, &EMS_Boiler.wWCircPumpMode, 7); // 1=1x3min... 6=6x3min, 7=continuous + _setValue(EMS_RxTelegram, &EMS_Boiler.wWCircPumpType, 10); // 0 = charge pump, 0xff = 3-way valve _setValue(EMS_RxTelegram, &EMS_Boiler.wWSelTemp, 2); _setValue(EMS_RxTelegram, &EMS_Boiler.wWDesinfectTemp, 8); _setValue(EMS_RxTelegram, &EMS_Boiler.wWComfort, EMS_OFFSET_UBAParameterWW_wwComfort); @@ -1121,7 +1121,7 @@ void _process_UBAMonitorSlow(_EMS_RxTelegram * EMS_RxTelegram) { _setValue(EMS_RxTelegram, &EMS_Boiler.extTemp, 0); _setValue(EMS_RxTelegram, &EMS_Boiler.boilTemp, 2); _setValue(EMS_RxTelegram, &EMS_Boiler.exhaustTemp, 4); - _setValue(EMS_RxTelegram, &EMS_Boiler.switchTemp, 25); // only if there is a mixer + _setValue(EMS_RxTelegram, &EMS_Boiler.switchTemp, 25); // only if there is a mixing module present _setValue(EMS_RxTelegram, &EMS_Boiler.pumpMod, 9); _setValue(EMS_RxTelegram, &EMS_Boiler.burnStarts, 10); _setValue(EMS_RxTelegram, &EMS_Boiler.burnWorkMin, 13); @@ -1305,7 +1305,7 @@ void _process_MMPLUSStatusMessageWW(_EMS_RxTelegram * EMS_RxTelegram) { _setValue(EMS_RxTelegram, &EMS_MixingModule.wwc[wwc].tempStatus, EMS_OFFSET_MMPLUSStatusMessage_WW_temp_status); } -// Mixer - 0xAB +// Mixing - 0xAB // https://github.com/proddy/EMS-ESP/issues/270 // We assume MM10 is on HC2 and WM10 is using HC1 void _process_MMStatusMessage(_EMS_RxTelegram * EMS_RxTelegram) { @@ -1319,7 +1319,7 @@ void _process_MMStatusMessage(_EMS_RxTelegram * EMS_RxTelegram) { //_setValue(EMS_RxTelegram, &EMS_MixingModule.hc[hc].valveStatus, EMS_OFFSET_MMStatusMessage_valve_status); } -// Mixer Parameters - 0xAC +// Mixing Parameters - 0xAC // We assume MM10 is on HC2 and WM10 is using HC1 void _process_MM10ParameterMessage(_EMS_RxTelegram * EMS_RxTelegram) { //uint8_t hc = 1; // fixed to HC2 @@ -2961,8 +2961,7 @@ const _EMS_Type EMS_Types[] = { {EMS_DEVICE_UPDATE_FLAG_MIXING, EMS_TYPE_MMPLUSStatusMessage_WWC1, "MMPLUSStatusMessage_WWC1", _process_MMPLUSStatusMessageWW}, {EMS_DEVICE_UPDATE_FLAG_MIXING, EMS_TYPE_MMPLUSStatusMessage_WWC2, "MMPLUSStatusMessage_WWC2", _process_MMPLUSStatusMessageWW}, {EMS_DEVICE_UPDATE_FLAG_MIXING, EMS_TYPE_MMStatusMessage, "MMStatusMessage", _process_MMStatusMessage}, - {EMS_DEVICE_UPDATE_FLAG_MIXING, EMS_TYPE_MM10ParameterMessage, "MM10ParameterMessage", _process_MM10ParameterMessage} -}; + {EMS_DEVICE_UPDATE_FLAG_MIXING, EMS_TYPE_MM10ParameterMessage, "MM10ParameterMessage", _process_MM10ParameterMessage}}; // calculate sizes of arrays at compile time uint8_t _EMS_Types_max = ArraySize(EMS_Types); @@ -3059,13 +3058,14 @@ void _printMessage(_EMS_RxTelegram * EMS_RxTelegram, const int8_t show_type) { if ((src == EMS_SolarModule.device_id) || (dest == EMS_SolarModule.device_id)) { _debugPrintTelegram(output_str, EMS_RxTelegram, color_s); } - } else if (EMS_Sys_Status.emsLogging == EMS_SYS_LOGGING_MIXERMODULE) { - // only print ones to/from mixer module if logging is set to mixer module only + } else if (EMS_Sys_Status.emsLogging == EMS_SYS_LOGGING_MIXINGMODULE) { + // only print ones to/from mixing module if logging is set to mixing module only if ((src == EMS_MixingModule.device_id) || (dest == EMS_MixingModule.device_id)) { _debugPrintTelegram(output_str, EMS_RxTelegram, color_s); - // also analyse the sequence of instructions prior to instructions to/from mixer module - // typically: EMS_TYPE_MM10ParameterMessage(0xAC) - EMS_TYPE_UBASetPoints(0x1A) - EMS_TYPE_UBAFlags(0x35) - } else if ((type == EMS_TYPE_MMStatusMessage) || (type == EMS_TYPE_MM10ParameterMessage) || (type == EMS_TYPE_UBASetPoints) || (type == EMS_TYPE_UBAFlags)) { + // also analyse the sequence of instructions prior to instructions to/from mixing module + // typically: EMS_TYPE_MM10ParameterMessage(0xAC) - EMS_TYPE_UBASetPoints(0x1A) - EMS_TYPE_UBAFlags(0x35) + } else if ((type == EMS_TYPE_MMStatusMessage) || (type == EMS_TYPE_MM10ParameterMessage) || (type == EMS_TYPE_UBASetPoints) + || (type == EMS_TYPE_UBAFlags)) { _debugPrintTelegram(output_str, EMS_RxTelegram, color_s); } } else if (EMS_Sys_Status.emsLogging == EMS_SYS_LOGGING_DEVICE) { diff --git a/src/ems.h b/src/ems.h index 7f8bfcc64..9132a5f63 100644 --- a/src/ems.h +++ b/src/ems.h @@ -120,16 +120,16 @@ typedef enum { /* EMS logging */ typedef enum { - EMS_SYS_LOGGING_NONE, // no messages - EMS_SYS_LOGGING_RAW, // raw data mode - EMS_SYS_LOGGING_WATCH, // watch a specific type ID - EMS_SYS_LOGGING_BASIC, // only basic read/write messages - EMS_SYS_LOGGING_THERMOSTAT, // only telegrams sent from thermostat - EMS_SYS_LOGGING_SOLARMODULE, // only telegrams sent from solar module - EMS_SYS_LOGGING_MIXERMODULE, // only telegrams sent from mixer module - EMS_SYS_LOGGING_VERBOSE, // everything - EMS_SYS_LOGGING_JABBER, // lots of debug output... - EMS_SYS_LOGGING_DEVICE // watch the device ID + EMS_SYS_LOGGING_NONE, // no messages + EMS_SYS_LOGGING_RAW, // raw data mode + EMS_SYS_LOGGING_WATCH, // watch a specific type ID + EMS_SYS_LOGGING_BASIC, // only basic read/write messages + EMS_SYS_LOGGING_THERMOSTAT, // only telegrams sent from thermostat + EMS_SYS_LOGGING_SOLARMODULE, // only telegrams sent from solar module + EMS_SYS_LOGGING_MIXINGMODULE, // only telegrams sent from mixing module + EMS_SYS_LOGGING_VERBOSE, // everything + EMS_SYS_LOGGING_JABBER, // lots of debug output... + EMS_SYS_LOGGING_DEVICE // watch the device ID } _EMS_SYS_LOGGING; // status/counters since last power on @@ -324,15 +324,15 @@ typedef struct { uint16_t switchTemp; // Switch temperature // UBAMonitorWWMessage - uint16_t wWCurTmp; // Warm Water current temperature - uint32_t wWStarts; // Warm Water # starts - uint32_t wWWorkM; // Warm Water # minutes - uint8_t wWOneTime; // Warm Water one time function on/off + uint16_t wWCurTmp; // Warm Water current temperature + uint32_t wWStarts; // Warm Water # starts + uint32_t wWWorkM; // Warm Water # minutes + uint8_t wWOneTime; // Warm Water one time function on/off uint8_t wWDesinfecting; // Warm Water desinfection on/off - uint8_t wWReadiness; // Warm Water readiness on/off - uint8_t wWRecharging; // Warm Water recharge on/off + uint8_t wWReadiness; // Warm Water readiness on/off + uint8_t wWRecharging; // Warm Water recharge on/off uint8_t wWTemperaturOK; // Warm Water temperatur ok on/off - uint8_t wWCurFlow; // Warm Water current flow in l/min + uint8_t wWCurFlow; // Warm Water current flow in l/min // UBATotalUptimeMessage uint32_t UBAuptime; // Total UBA working hours @@ -379,7 +379,7 @@ typedef struct { uint8_t tempStatus; } _EMS_MixingModule_WWC; -// Mixer data +// Mixing data typedef struct { uint8_t device_id; uint8_t device_flags; diff --git a/src/ems_devices.h b/src/ems_devices.h index 4588e3243..1aeb2a16e 100644 --- a/src/ems_devices.h +++ b/src/ems_devices.h @@ -54,12 +54,12 @@ // Mixing Modules // MM100/MM200 (EMS Plus) -#define EMS_TYPE_MMPLUSStatusMessage_HC1 0x01D7 // mixer status HC1 -#define EMS_TYPE_MMPLUSStatusMessage_HC2 0x01D8 // mixer status HC2 -#define EMS_TYPE_MMPLUSStatusMessage_HC3 0x01D9 // mixer status HC3 -#define EMS_TYPE_MMPLUSStatusMessage_HC4 0x01DA // mixer status HC4 -#define EMS_TYPE_MMPLUSStatusMessage_WWC1 0x0231 // mixer status WWC1 -#define EMS_TYPE_MMPLUSStatusMessage_WWC2 0x0232 // mixer status WWC2 +#define EMS_TYPE_MMPLUSStatusMessage_HC1 0x01D7 // mixing status HC1 +#define EMS_TYPE_MMPLUSStatusMessage_HC2 0x01D8 // mixing status HC2 +#define EMS_TYPE_MMPLUSStatusMessage_HC3 0x01D9 // mixing status HC3 +#define EMS_TYPE_MMPLUSStatusMessage_HC4 0x01DA // mixing status HC4 +#define EMS_TYPE_MMPLUSStatusMessage_WWC1 0x0231 // mixing status WWC1 +#define EMS_TYPE_MMPLUSStatusMessage_WWC2 0x0232 // mixing status WWC2 #define EMS_OFFSET_MMPLUSStatusMessage_flow_temp 3 // flow temperature #define EMS_OFFSET_MMPLUSStatusMessage_pump_mod 5 // pump modulation #define EMS_OFFSET_MMPLUSStatusMessage_valve_status 2 // valve in percent @@ -67,12 +67,12 @@ #define EMS_OFFSET_MMPLUSStatusMessage_WW_pump_mod 2 // pump on 6, off 0 #define EMS_OFFSET_MMPLUSStatusMessage_WW_temp_status 11 // 0,1,2 // MM10 -#define EMS_TYPE_MMStatusMessage 0xAB // mixer status +#define EMS_TYPE_MMStatusMessage 0xAB // mixing status #define EMS_OFFSET_MMStatusMessage_flow_set 0 // flow setpoint #define EMS_OFFSET_MMStatusMessage_flow_temp 1 // flow temperature #define EMS_OFFSET_MMStatusMessage_pump_mod 3 // pump modulation in percent #define EMS_OFFSET_MMStatusMessage_valve_status 4 // valve 0..255 -#define EMS_TYPE_MM10ParameterMessage 0xAC // mixer parameters +#define EMS_TYPE_MM10ParameterMessage 0xAC // mixing parameters // Solar Module // Assuming here that the SM200 behaves like SM100