mirror of
https://github.com/emsesp/EMS-ESP32.git
synced 2025-12-07 16:29:51 +03:00
added EMS_BOILER_TAPWATER_TEMPERATURE_MAX to my_config.h, not all boilers support 90 degrees max
changed tapwater detection mechanism: - added EMS_BOILER.wWCurFlow to be read from 0x34 messages, this gives the current amount of tapwater flowing in dl/min - added wWCurFlow to mqtt message - added wWCurFlow to telnet statistics changed detection from: selBurnPow and selFlowTemp to wWCurFlow added the current servicecode as seen on thermostat and boieler display to telnet statistics and mqtt message
This commit is contained in:
@@ -238,6 +238,19 @@ void _renderIntValue(const char * prefix, const char * postfix, uint8_t value) {
|
|||||||
myDebug("\n");
|
myDebug("\n");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// takes an int value at prints it to debug log
|
||||||
|
void _renderIntfractionalValue(const char * prefix, const char * postfix, uint8_t value, uint8_t decimals) {
|
||||||
|
myDebug(" %s: ", prefix);
|
||||||
|
char s[20];
|
||||||
|
myDebug("%s.", _int_to_char(s, value/(decimals*10)));
|
||||||
|
myDebug("%s", _int_to_char(s, value%(decimals*10)));
|
||||||
|
if (postfix != NULL) {
|
||||||
|
myDebug(" %s", postfix);
|
||||||
|
}
|
||||||
|
|
||||||
|
myDebug("\n");
|
||||||
|
}
|
||||||
|
|
||||||
// takes a bool value at prints it to debug log
|
// takes a bool value at prints it to debug log
|
||||||
void _renderBoolValue(const char * prefix, uint8_t value) {
|
void _renderBoolValue(const char * prefix, uint8_t value) {
|
||||||
myDebug(" %s: ", prefix);
|
myDebug(" %s: ", prefix);
|
||||||
@@ -291,6 +304,7 @@ void showInfo() {
|
|||||||
|
|
||||||
// UBAMonitorWWMessage
|
// UBAMonitorWWMessage
|
||||||
_renderFloatValue("Warm Water current temperature", "C", EMS_Boiler.wWCurTmp);
|
_renderFloatValue("Warm Water current temperature", "C", EMS_Boiler.wWCurTmp);
|
||||||
|
_renderIntfractionalValue("Warm Water current tapwater flow", "l/min", EMS_Boiler.wWCurFlow, 1);
|
||||||
_renderIntValue("Warm Water # starts", "times", EMS_Boiler.wWStarts);
|
_renderIntValue("Warm Water # starts", "times", EMS_Boiler.wWStarts);
|
||||||
myDebug(" Warm Water active time: %d days %d hours %d minutes\n",
|
myDebug(" Warm Water active time: %d days %d hours %d minutes\n",
|
||||||
EMS_Boiler.wWWorkM / 1440,
|
EMS_Boiler.wWWorkM / 1440,
|
||||||
@@ -311,6 +325,7 @@ void showInfo() {
|
|||||||
_renderIntValue("Burner current power", "%", EMS_Boiler.curBurnPow);
|
_renderIntValue("Burner current power", "%", EMS_Boiler.curBurnPow);
|
||||||
_renderFloatValue("Flame current", "uA", EMS_Boiler.flameCurr);
|
_renderFloatValue("Flame current", "uA", EMS_Boiler.flameCurr);
|
||||||
_renderFloatValue("System pressure", "bar", EMS_Boiler.sysPress);
|
_renderFloatValue("System pressure", "bar", EMS_Boiler.sysPress);
|
||||||
|
myDebug(" Current System Service Code: %c%c \n", EMS_Boiler.serviceCodeChar1, EMS_Boiler.serviceCodeChar2);
|
||||||
|
|
||||||
// UBAMonitorSlow
|
// UBAMonitorSlow
|
||||||
_renderFloatValue("Outside temperature", "C", EMS_Boiler.extTemp);
|
_renderFloatValue("Outside temperature", "C", EMS_Boiler.extTemp);
|
||||||
@@ -382,6 +397,9 @@ void publishValues(bool force) {
|
|||||||
rootBoiler["wWSelTemp"] = _int_to_char(s, EMS_Boiler.wWSelTemp);
|
rootBoiler["wWSelTemp"] = _int_to_char(s, EMS_Boiler.wWSelTemp);
|
||||||
rootBoiler["wWActivated"] = _bool_to_char(s, EMS_Boiler.wWActivated);
|
rootBoiler["wWActivated"] = _bool_to_char(s, EMS_Boiler.wWActivated);
|
||||||
rootBoiler["wWCurTmp"] = _float_to_char(s, EMS_Boiler.wWCurTmp);
|
rootBoiler["wWCurTmp"] = _float_to_char(s, EMS_Boiler.wWCurTmp);
|
||||||
|
|
||||||
|
sprintf(s, "%i.%i", EMS_Boiler.wWCurFlow/10, EMS_Boiler.wWCurFlow%10);
|
||||||
|
rootBoiler["wWCurFlow"] = s;
|
||||||
rootBoiler["wWHeat"] = _bool_to_char(s, EMS_Boiler.wWHeat);
|
rootBoiler["wWHeat"] = _bool_to_char(s, EMS_Boiler.wWHeat);
|
||||||
rootBoiler["curFlowTemp"] = _float_to_char(s, EMS_Boiler.curFlowTemp);
|
rootBoiler["curFlowTemp"] = _float_to_char(s, EMS_Boiler.curFlowTemp);
|
||||||
rootBoiler["retTemp"] = _float_to_char(s, EMS_Boiler.retTemp);
|
rootBoiler["retTemp"] = _float_to_char(s, EMS_Boiler.retTemp);
|
||||||
@@ -395,6 +413,8 @@ void publishValues(bool force) {
|
|||||||
rootBoiler["sysPress"] = _float_to_char(s, EMS_Boiler.sysPress);
|
rootBoiler["sysPress"] = _float_to_char(s, EMS_Boiler.sysPress);
|
||||||
rootBoiler["boilTemp"] = _float_to_char(s, EMS_Boiler.boilTemp);
|
rootBoiler["boilTemp"] = _float_to_char(s, EMS_Boiler.boilTemp);
|
||||||
rootBoiler["pumpMod"] = _int_to_char(s, EMS_Boiler.pumpMod);
|
rootBoiler["pumpMod"] = _int_to_char(s, EMS_Boiler.pumpMod);
|
||||||
|
sprintf(s, "%c%c", EMS_Boiler.serviceCodeChar1, EMS_Boiler.serviceCodeChar2);
|
||||||
|
rootBoiler["ServiceCode"] = s;
|
||||||
|
|
||||||
size_t len = rootBoiler.measureLength();
|
size_t len = rootBoiler.measureLength();
|
||||||
rootBoiler.printTo(data, len + 1); // form the json string
|
rootBoiler.printTo(data, len + 1); // form the json string
|
||||||
|
|||||||
14
src/ems.cpp
14
src/ems.cpp
@@ -176,6 +176,8 @@ void ems_init() {
|
|||||||
EMS_Boiler.curBurnPow = EMS_VALUE_INT_NOTSET; // Burner current power
|
EMS_Boiler.curBurnPow = EMS_VALUE_INT_NOTSET; // Burner current power
|
||||||
EMS_Boiler.flameCurr = EMS_VALUE_FLOAT_NOTSET; // Flame current in micro amps
|
EMS_Boiler.flameCurr = EMS_VALUE_FLOAT_NOTSET; // Flame current in micro amps
|
||||||
EMS_Boiler.sysPress = EMS_VALUE_FLOAT_NOTSET; // System pressure
|
EMS_Boiler.sysPress = EMS_VALUE_FLOAT_NOTSET; // System pressure
|
||||||
|
EMS_Boiler.serviceCodeChar1 = EMS_VALUE_INT_NOTSET; //
|
||||||
|
EMS_Boiler.serviceCodeChar2 = EMS_VALUE_INT_NOTSET; //
|
||||||
|
|
||||||
// UBAMonitorSlow
|
// UBAMonitorSlow
|
||||||
EMS_Boiler.extTemp = EMS_VALUE_FLOAT_NOTSET; // Outside temperature
|
EMS_Boiler.extTemp = EMS_VALUE_FLOAT_NOTSET; // Outside temperature
|
||||||
@@ -190,6 +192,7 @@ void ems_init() {
|
|||||||
EMS_Boiler.wWStarts = EMS_VALUE_INT_NOTSET; // Warm Water # starts
|
EMS_Boiler.wWStarts = EMS_VALUE_INT_NOTSET; // Warm Water # starts
|
||||||
EMS_Boiler.wWWorkM = EMS_VALUE_INT_NOTSET; // Warm Water # minutes
|
EMS_Boiler.wWWorkM = EMS_VALUE_INT_NOTSET; // Warm Water # minutes
|
||||||
EMS_Boiler.wWOneTime = EMS_VALUE_INT_NOTSET; // Warm Water one time function on/off
|
EMS_Boiler.wWOneTime = EMS_VALUE_INT_NOTSET; // Warm Water one time function on/off
|
||||||
|
EMS_Boiler.wWCurFlow = EMS_VALUE_INT_NOTSET;
|
||||||
|
|
||||||
EMS_Boiler.tapwaterActive = EMS_VALUE_INT_NOTSET; // Hot tap water is on/off
|
EMS_Boiler.tapwaterActive = EMS_VALUE_INT_NOTSET; // Hot tap water is on/off
|
||||||
EMS_Boiler.heatingActive = EMS_VALUE_INT_NOTSET; // Central heating is on/off
|
EMS_Boiler.heatingActive = EMS_VALUE_INT_NOTSET; // Central heating is on/off
|
||||||
@@ -723,8 +726,8 @@ void _processType(uint8_t * telegram, uint8_t length) {
|
|||||||
bool _checkActive() {
|
bool _checkActive() {
|
||||||
// hot tap water
|
// hot tap water
|
||||||
EMS_Boiler.tapwaterActive =
|
EMS_Boiler.tapwaterActive =
|
||||||
((EMS_Boiler.selFlowTemp == 0)
|
((EMS_Boiler.wWCurFlow != 0) //this is easier
|
||||||
&& (EMS_Boiler.selBurnPow >= EMS_BOILER_BURNPOWER_TAPWATER) & (EMS_Boiler.burnGas == EMS_VALUE_INT_ON));
|
&& (EMS_Boiler.burnGas == EMS_VALUE_INT_ON));
|
||||||
|
|
||||||
// heating
|
// heating
|
||||||
EMS_Boiler.heatingActive =
|
EMS_Boiler.heatingActive =
|
||||||
@@ -754,6 +757,7 @@ void _process_UBAMonitorWWMessage(uint8_t * data, uint8_t length) {
|
|||||||
EMS_Boiler.wWStarts = _toLong(13, data);
|
EMS_Boiler.wWStarts = _toLong(13, data);
|
||||||
EMS_Boiler.wWWorkM = _toLong(10, data);
|
EMS_Boiler.wWWorkM = _toLong(10, data);
|
||||||
EMS_Boiler.wWOneTime = bitRead(data[5], 1);
|
EMS_Boiler.wWOneTime = bitRead(data[5], 1);
|
||||||
|
EMS_Boiler.wWCurFlow = data[9];
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -778,6 +782,10 @@ void _process_UBAMonitorFast(uint8_t * data, uint8_t length) {
|
|||||||
|
|
||||||
EMS_Boiler.flameCurr = _toFloat(15, data);
|
EMS_Boiler.flameCurr = _toFloat(15, data);
|
||||||
|
|
||||||
|
//read the service code / installation status as appears on the display
|
||||||
|
EMS_Boiler.serviceCodeChar1 = data[18]; //ascii character 1
|
||||||
|
EMS_Boiler.serviceCodeChar2 = data[19]; //ascii character 2
|
||||||
|
|
||||||
if (data[17] == 0xFF) { // missing value for system pressure
|
if (data[17] == 0xFF) { // missing value for system pressure
|
||||||
EMS_Boiler.sysPress = 0;
|
EMS_Boiler.sysPress = 0;
|
||||||
} else {
|
} else {
|
||||||
@@ -1187,7 +1195,7 @@ void ems_setThermostatMode(uint8_t mode) {
|
|||||||
*/
|
*/
|
||||||
void ems_setWarmWaterTemp(uint8_t temperature) {
|
void ems_setWarmWaterTemp(uint8_t temperature) {
|
||||||
// check for invalid temp values
|
// check for invalid temp values
|
||||||
if ((temperature < 30) || (temperature > 90)) {
|
if ((temperature < 30) || (temperature > EMS_BOILER_TAPWATER_TEMPERATURE_MAX)) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
29
src/ems.h
29
src/ems.h
@@ -162,19 +162,21 @@ typedef struct { // UBAParameterWW
|
|||||||
uint8_t wWDesiredTemp; // Warm Water desired temperature
|
uint8_t wWDesiredTemp; // Warm Water desired temperature
|
||||||
|
|
||||||
// UBAMonitorFast
|
// UBAMonitorFast
|
||||||
uint8_t selFlowTemp; // Selected flow temperature
|
uint8_t selFlowTemp; // Selected flow temperature
|
||||||
float curFlowTemp; // Current flow temperature
|
float curFlowTemp; // Current flow temperature
|
||||||
float retTemp; // Return temperature
|
float retTemp; // Return temperature
|
||||||
uint8_t burnGas; // Gas on/off
|
uint8_t burnGas; // Gas on/off
|
||||||
uint8_t fanWork; // Fan on/off
|
uint8_t fanWork; // Fan on/off
|
||||||
uint8_t ignWork; // Ignition on/off
|
uint8_t ignWork; // Ignition on/off
|
||||||
uint8_t heatPmp; // Circulating pump on/off
|
uint8_t heatPmp; // Circulating pump on/off
|
||||||
uint8_t wWHeat; // 3-way valve on WW
|
uint8_t wWHeat; // 3-way valve on WW
|
||||||
uint8_t wWCirc; // Circulation on/off
|
uint8_t wWCirc; // Circulation on/off
|
||||||
uint8_t selBurnPow; // Burner max power
|
uint8_t selBurnPow; // Burner max power
|
||||||
uint8_t curBurnPow; // Burner current power
|
uint8_t curBurnPow; // Burner current power
|
||||||
float flameCurr; // Flame current in micro amps
|
float flameCurr; // Flame current in micro amps
|
||||||
float sysPress; // System pressure
|
float sysPress; // System pressure
|
||||||
|
uint8_t serviceCodeChar1; // First Character in status/service code
|
||||||
|
uint8_t serviceCodeChar2; // Second Character in status/service code
|
||||||
|
|
||||||
// UBAMonitorSlow
|
// UBAMonitorSlow
|
||||||
float extTemp; // Outside temperature
|
float extTemp; // Outside temperature
|
||||||
@@ -189,6 +191,7 @@ typedef struct { // UBAParameterWW
|
|||||||
uint32_t wWStarts; // Warm Water # starts
|
uint32_t wWStarts; // Warm Water # starts
|
||||||
uint32_t wWWorkM; // Warm Water # minutes
|
uint32_t wWWorkM; // Warm Water # minutes
|
||||||
uint8_t wWOneTime; // Warm Water one time function on/off
|
uint8_t wWOneTime; // Warm Water one time function on/off
|
||||||
|
uint8_t wWCurFlow; // Warm Water current flow in l/min
|
||||||
|
|
||||||
// calculated values
|
// calculated values
|
||||||
uint8_t tapwaterActive; // Hot tap water is on/off
|
uint8_t tapwaterActive; // Hot tap water is on/off
|
||||||
|
|||||||
@@ -34,6 +34,9 @@
|
|||||||
#define EMS_BOILER_BURNPOWER_TAPWATER 100
|
#define EMS_BOILER_BURNPOWER_TAPWATER 100
|
||||||
#define EMS_BOILER_SELFLOWTEMP_HEATING 70
|
#define EMS_BOILER_SELFLOWTEMP_HEATING 70
|
||||||
|
|
||||||
|
//define maximum settable tapwater temperature, not every installation supports 90 degrees
|
||||||
|
#define EMS_BOILER_TAPWATER_TEMPERATURE_MAX 60
|
||||||
|
|
||||||
// if using the shower timer, change these settings
|
// if using the shower timer, change these settings
|
||||||
#define SHOWER_PAUSE_TIME 15000 // in ms. 15 seconds, max time if water is switched off & on during a shower
|
#define SHOWER_PAUSE_TIME 15000 // in ms. 15 seconds, max time if water is switched off & on during a shower
|
||||||
#define SHOWER_MIN_DURATION 120000 // in ms. 2 minutes, before recognizing its a shower
|
#define SHOWER_MIN_DURATION 120000 // in ms. 2 minutes, before recognizing its a shower
|
||||||
|
|||||||
Reference in New Issue
Block a user