From a22e64a8caaa8b1f9b2f11c0e45f89abb74eda14 Mon Sep 17 00:00:00 2001 From: MichaelDvP Date: Mon, 30 Dec 2019 13:35:23 +0100 Subject: [PATCH] MM10 mixer added, changed WWDesired to WWDesinfection, added boier exhaust temperature --- src/ems-esp.cpp | 18 +++++++++++++----- src/ems.cpp | 23 ++++++++++++++++++++--- src/ems.h | 4 +++- src/ems_devices.h | 7 +++++++ 4 files changed, 43 insertions(+), 9 deletions(-) diff --git a/src/ems-esp.cpp b/src/ems-esp.cpp index 7cd4fa0f5..c1ca94e1c 100644 --- a/src/ems-esp.cpp +++ b/src/ems-esp.cpp @@ -296,7 +296,7 @@ void showInfo() { } _renderIntValue("Warm Water selected temperature", "C", EMS_Boiler.wWSelTemp); - _renderIntValue("Warm Water desired temperature", "C", EMS_Boiler.wWDesiredTemp); + _renderIntValue("Warm Water desinfection temperature", "C", EMS_Boiler.wWDesinfectTemp); // UBAMonitorWWMessage _renderUShortValue("Warm Water current temperature", "C", EMS_Boiler.wWCurTmp); @@ -339,6 +339,7 @@ void showInfo() { _renderShortValue("Outside temperature", "C", EMS_Boiler.extTemp); } _renderUShortValue("Boiler temperature", "C", EMS_Boiler.boilTemp); + _renderUShortValue("Exhaust temperature", "C", EMS_Boiler.exhaustTemp); _renderIntValue("Pump modulation", "%", EMS_Boiler.pumpMod); _renderLongValue("Burner # starts", "times", EMS_Boiler.burnStarts); if (EMS_Boiler.burnWorkMin != EMS_VALUE_LONG_NOTSET) { @@ -475,8 +476,12 @@ void showInfo() { if (EMS_Mixing.hc[hc_num - 1].active) { myDebug_P(PSTR(" Mixing Circuit %d"), hc_num); _renderUShortValue(" Current flow temperature", "C", EMS_Mixing.hc[hc_num - 1].flowTemp); + if (EMS_Mixing.hc[hc_num - 1].flowSetTemp != EMS_VALUE_INT_NOTSET) + _renderIntValue(" Setpoint flow temperature", "C", EMS_Mixing.hc[hc_num - 1].flowSetTemp); _renderIntValue(" Current pump modulation", "%", EMS_Mixing.hc[hc_num - 1].pumpMod); - _renderIntValue(" Current valve status", "%", EMS_Mixing.hc[hc_num - 1].valveStatus); + if (EMS_Mixing.hc[hc_num - 1].valveStatus != EMS_VALUE_INT_NOTSET) + _renderIntValue(" Current valve status", "", EMS_Mixing.hc[hc_num - 1].valveStatus); + } } } @@ -561,8 +566,8 @@ void publishEMSValues(bool force) { if (EMS_Boiler.wWSelTemp != EMS_VALUE_INT_NOTSET) rootBoiler["wWSelTemp"] = EMS_Boiler.wWSelTemp; - if (EMS_Boiler.wWDesiredTemp != EMS_VALUE_INT_NOTSET) - rootBoiler["wWDesiredTemp"] = EMS_Boiler.wWDesiredTemp; + if (EMS_Boiler.wWDesinfectTemp != EMS_VALUE_INT_NOTSET) + rootBoiler["wWDesinfectionTemp"] = EMS_Boiler.wWDesinfectTemp; if (EMS_Boiler.selFlowTemp != EMS_VALUE_INT_NOTSET) rootBoiler["selFlowTemp"] = EMS_Boiler.selFlowTemp; if (EMS_Boiler.selBurnPow != EMS_VALUE_INT_NOTSET) @@ -590,7 +595,8 @@ void publishEMSValues(bool force) { rootBoiler["sysPress"] = (float)EMS_Boiler.sysPress / 10; if (EMS_Boiler.boilTemp != EMS_VALUE_USHORT_NOTSET) rootBoiler["boilTemp"] = (float)EMS_Boiler.boilTemp / 10; - + if (EMS_Boiler.exhaustTemp != EMS_VALUE_USHORT_NOTSET) + rootBoiler["exhaustTemp"] = (float)EMS_Boiler.exhaustTemp / 10; if (EMS_Boiler.wWActivated != EMS_VALUE_BOOL_NOTSET) rootBoiler["wWActivated"] = _bool_to_char(s, EMS_Boiler.wWActivated); @@ -750,6 +756,8 @@ void publishEMSValues(bool force) { if (mixing->flowTemp != EMS_VALUE_SHORT_NOTSET) dataMixing["flowTemp"] = (float)mixing->flowTemp / 10; + if (mixing->flowSetTemp != EMS_VALUE_INT_NOTSET) + dataMixing["setflowTemp"] = mixing->flowSetTemp; if (mixing->pumpMod != EMS_VALUE_INT_NOTSET) dataMixing["pumpMod"] = mixing->pumpMod; if (mixing->valveStatus != EMS_VALUE_INT_NOTSET) diff --git a/src/ems.cpp b/src/ems.cpp index 4801b2de2..756261a5d 100644 --- a/src/ems.cpp +++ b/src/ems.cpp @@ -121,13 +121,14 @@ void ems_init() { EMS_Mixing.hc[i].flowTemp = EMS_VALUE_SHORT_NOTSET; EMS_Mixing.hc[i].pumpMod = EMS_VALUE_INT_NOTSET; EMS_Mixing.hc[i].valveStatus = EMS_VALUE_INT_NOTSET; + EMS_Mixing.hc[i].flowSetTemp = EMS_VALUE_INT_NOTSET; } // UBAParameterWW EMS_Boiler.wWActivated = EMS_VALUE_BOOL_NOTSET; // Warm Water activated 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.wWDesiredTemp = EMS_VALUE_INT_NOTSET; // Warm Water desired temperature to prevent infection + EMS_Boiler.wWDesinfectTemp = EMS_VALUE_INT_NOTSET; // Warm Water desinfection temperature to prevent infection EMS_Boiler.wWComfort = EMS_VALUE_INT_NOTSET; // WW comfort mode // UBAMonitorFast @@ -150,6 +151,7 @@ void ems_init() { // UBAMonitorSlow EMS_Boiler.extTemp = EMS_VALUE_SHORT_NOTSET; // Outside temperature EMS_Boiler.boilTemp = EMS_VALUE_USHORT_NOTSET; // Boiler temperature + EMS_Boiler.exhaustTemp = EMS_VALUE_USHORT_NOTSET; // Exhaust temperature EMS_Boiler.pumpMod = EMS_VALUE_INT_NOTSET; // Pump modulation % EMS_Boiler.burnStarts = EMS_VALUE_LONG_NOTSET; // # burner restarts EMS_Boiler.burnWorkMin = EMS_VALUE_LONG_NOTSET; // Total burner operating time @@ -951,7 +953,7 @@ 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.wWSelTemp, 2); - _setValue(EMS_RxTelegram, &EMS_Boiler.wWDesiredTemp, 8); + _setValue(EMS_RxTelegram, &EMS_Boiler.wWDesinfectTemp, 8); _setValue(EMS_RxTelegram, &EMS_Boiler.wWComfort, EMS_OFFSET_UBAParameterWW_wwComfort); } @@ -1083,6 +1085,7 @@ void _process_UBAMonitorFast2(_EMS_RxTelegram * EMS_RxTelegram) { 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.pumpMod, 9); _setValue(EMS_RxTelegram, &EMS_Boiler.burnStarts, 10); @@ -1226,6 +1229,19 @@ void _process_MMPLUSStatusMessage(_EMS_RxTelegram * EMS_RxTelegram) { _setValue(EMS_RxTelegram, &EMS_Mixing.hc[hc].valveStatus, EMS_OFFSET_MMPLUSStatusMessage_valve_status); } +void _process_MMStatusMessage(_EMS_RxTelegram * EMS_RxTelegram) { + uint8_t hc = (EMS_RxTelegram->type - EMS_TYPE_MMStatusMessage); + if (hc!=0) { + return; // invalid type + } + EMS_Mixing.hc[hc].active = true; + + _setValue(EMS_RxTelegram, &EMS_Mixing.hc[hc].flowTemp, EMS_OFFSET_MMStatusMessage_flow_temp); + _setValue(EMS_RxTelegram, &EMS_Mixing.hc[hc].pumpMod, EMS_OFFSET_MMStatusMessage_pump_mod); + //_setValue(EMS_RxTelegram, &EMS_Mixing.hc[hc].valveStatus, EMS_OFFSET_MMStatusMessage_valve_status); + _setValue(EMS_RxTelegram, &EMS_Mixing.hc[hc].flowSetTemp, EMS_OFFSET_MMStatusMessage_flow_set); +} + /** * type 0x01A5 - data from the Nefit RC1010/3000 thermostat (0x18) and RC300/310s on 0x10 * EMS+ messages may come in with different offsets so handle them here @@ -2667,7 +2683,8 @@ const _EMS_Type EMS_Types[] = { // Mixing devices {EMS_DEVICE_UPDATE_FLAG_MIXING, EMS_TYPE_MMPLUSStatusMessage_HC1, "MMPLUSStatusMessage_HC1", _process_MMPLUSStatusMessage}, - {EMS_DEVICE_UPDATE_FLAG_MIXING, EMS_TYPE_MMPLUSStatusMessage_HC2, "MMPLUSStatusMessage_HC2", _process_MMPLUSStatusMessage} + {EMS_DEVICE_UPDATE_FLAG_MIXING, EMS_TYPE_MMPLUSStatusMessage_HC2, "MMPLUSStatusMessage_HC2", _process_MMPLUSStatusMessage}, + {EMS_DEVICE_UPDATE_FLAG_MIXING, EMS_TYPE_MMStatusMessage, "MMStatusMessage", _process_MMStatusMessage} }; diff --git a/src/ems.h b/src/ems.h index ecb10e951..9956b1dc9 100644 --- a/src/ems.h +++ b/src/ems.h @@ -253,7 +253,7 @@ typedef struct { uint8_t wWActivated; // Warm Water activated uint8_t wWSelTemp; // Warm Water selected temperature uint8_t wWCircPump; // Warm Water circulation pump Available - uint8_t wWDesiredTemp; // Warm Water desired temperature + uint8_t wWDesinfectTemp; // Warm Water desinfection temperature uint8_t wWComfort; // Warm water comfort or ECO mode // UBAMonitorFast @@ -276,6 +276,7 @@ typedef struct { // UBAMonitorSlow int16_t extTemp; // Outside temperature uint16_t boilTemp; // Boiler temperature + uint16_t exhaustTemp; // Exhaust temperature uint8_t pumpMod; // Pump modulation uint32_t burnStarts; // # burner starts uint32_t burnWorkMin; // Total burner operating time @@ -323,6 +324,7 @@ typedef struct { uint16_t flowTemp; uint8_t pumpMod; uint8_t valveStatus; + uint8_t flowSetTemp; } _EMS_Mixing_HC; // Mixer data diff --git a/src/ems_devices.h b/src/ems_devices.h index 25865e9ff..8ea8e34d0 100644 --- a/src/ems_devices.h +++ b/src/ems_devices.h @@ -196,6 +196,13 @@ const _EMS_Device_Types EMS_Devices_Types[] = { #define EMS_OFFSET_MMPLUSStatusMessage_pump_mod 5 // pump modulation #define EMS_OFFSET_MMPLUSStatusMessage_valve_status 2 // valve in percent +// MM10 +#define EMS_TYPE_MMStatusMessage 0xAB // mixer 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 + /* * Table of all known EMS Devices * ProductID, DeviceType, Description, Flags