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:
Bonusbartus
2018-12-28 11:05:37 +01:00
parent a172546203
commit d520b97aa7
4 changed files with 50 additions and 16 deletions

View File

@@ -238,6 +238,19 @@ void _renderIntValue(const char * prefix, const char * postfix, uint8_t value) {
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
void _renderBoolValue(const char * prefix, uint8_t value) {
myDebug(" %s: ", prefix);
@@ -291,6 +304,7 @@ void showInfo() {
// UBAMonitorWWMessage
_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);
myDebug(" Warm Water active time: %d days %d hours %d minutes\n",
EMS_Boiler.wWWorkM / 1440,
@@ -311,6 +325,7 @@ void showInfo() {
_renderIntValue("Burner current power", "%", EMS_Boiler.curBurnPow);
_renderFloatValue("Flame current", "uA", EMS_Boiler.flameCurr);
_renderFloatValue("System pressure", "bar", EMS_Boiler.sysPress);
myDebug(" Current System Service Code: %c%c \n", EMS_Boiler.serviceCodeChar1, EMS_Boiler.serviceCodeChar2);
// UBAMonitorSlow
_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["wWActivated"] = _bool_to_char(s, EMS_Boiler.wWActivated);
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["curFlowTemp"] = _float_to_char(s, EMS_Boiler.curFlowTemp);
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["boilTemp"] = _float_to_char(s, EMS_Boiler.boilTemp);
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();
rootBoiler.printTo(data, len + 1); // form the json string

View File

@@ -176,6 +176,8 @@ void ems_init() {
EMS_Boiler.curBurnPow = EMS_VALUE_INT_NOTSET; // Burner current power
EMS_Boiler.flameCurr = EMS_VALUE_FLOAT_NOTSET; // Flame current in micro amps
EMS_Boiler.sysPress = EMS_VALUE_FLOAT_NOTSET; // System pressure
EMS_Boiler.serviceCodeChar1 = EMS_VALUE_INT_NOTSET; //
EMS_Boiler.serviceCodeChar2 = EMS_VALUE_INT_NOTSET; //
// UBAMonitorSlow
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.wWWorkM = EMS_VALUE_INT_NOTSET; // Warm Water # minutes
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.heatingActive = EMS_VALUE_INT_NOTSET; // Central heating is on/off
@@ -723,8 +726,8 @@ void _processType(uint8_t * telegram, uint8_t length) {
bool _checkActive() {
// hot tap water
EMS_Boiler.tapwaterActive =
((EMS_Boiler.selFlowTemp == 0)
&& (EMS_Boiler.selBurnPow >= EMS_BOILER_BURNPOWER_TAPWATER) & (EMS_Boiler.burnGas == EMS_VALUE_INT_ON));
((EMS_Boiler.wWCurFlow != 0) //this is easier
&& (EMS_Boiler.burnGas == EMS_VALUE_INT_ON));
// heating
EMS_Boiler.heatingActive =
@@ -754,6 +757,7 @@ void _process_UBAMonitorWWMessage(uint8_t * data, uint8_t length) {
EMS_Boiler.wWStarts = _toLong(13, data);
EMS_Boiler.wWWorkM = _toLong(10, data);
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);
//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
EMS_Boiler.sysPress = 0;
} else {
@@ -1187,7 +1195,7 @@ void ems_setThermostatMode(uint8_t mode) {
*/
void ems_setWarmWaterTemp(uint8_t temperature) {
// check for invalid temp values
if ((temperature < 30) || (temperature > 90)) {
if ((temperature < 30) || (temperature > EMS_BOILER_TAPWATER_TEMPERATURE_MAX)) {
return;
}

View File

@@ -175,6 +175,8 @@ typedef struct { // UBAParameterWW
uint8_t curBurnPow; // Burner current power
float flameCurr; // Flame current in micro amps
float sysPress; // System pressure
uint8_t serviceCodeChar1; // First Character in status/service code
uint8_t serviceCodeChar2; // Second Character in status/service code
// UBAMonitorSlow
float extTemp; // Outside temperature
@@ -189,6 +191,7 @@ typedef struct { // UBAParameterWW
uint32_t wWStarts; // Warm Water # starts
uint32_t wWWorkM; // Warm Water # minutes
uint8_t wWOneTime; // Warm Water one time function on/off
uint8_t wWCurFlow; // Warm Water current flow in l/min
// calculated values
uint8_t tapwaterActive; // Hot tap water is on/off

View File

@@ -34,6 +34,9 @@
#define EMS_BOILER_BURNPOWER_TAPWATER 100
#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
#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