mirror of
https://github.com/emsesp/EMS-ESP32.git
synced 2025-12-08 16:59:50 +03:00
fix error with servicecode rendering
This commit is contained in:
@@ -327,7 +327,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(" System Service Code: %s(%d)", EMS_Boiler.serviceCodeChar, EMS_Boiler.serviceCode);
|
myDebug(" System Service Code: %s (%d)", EMS_Boiler.serviceCodeChar, EMS_Boiler.serviceCode);
|
||||||
|
|
||||||
// UBAParametersMessage
|
// UBAParametersMessage
|
||||||
_renderIntValue("Heating temperature setting on the boiler", "C", EMS_Boiler.heating_temp);
|
_renderIntValue("Heating temperature setting on the boiler", "C", EMS_Boiler.heating_temp);
|
||||||
@@ -431,22 +431,22 @@ void publishValues(bool force) {
|
|||||||
rootBoiler["wWComfort"] = EMS_Boiler.wWComfort ? "Comfort" : "ECO";
|
rootBoiler["wWComfort"] = EMS_Boiler.wWComfort ? "Comfort" : "ECO";
|
||||||
rootBoiler["wWCurTmp"] = _float_to_char(s, EMS_Boiler.wWCurTmp);
|
rootBoiler["wWCurTmp"] = _float_to_char(s, EMS_Boiler.wWCurTmp);
|
||||||
snprintf(s, sizeof(s), "%i.%i", EMS_Boiler.wWCurFlow / 10, EMS_Boiler.wWCurFlow % 10);
|
snprintf(s, sizeof(s), "%i.%i", EMS_Boiler.wWCurFlow / 10, EMS_Boiler.wWCurFlow % 10);
|
||||||
rootBoiler["wWCurFlow"] = s;
|
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);
|
||||||
rootBoiler["burnGas"] = _bool_to_char(s, EMS_Boiler.burnGas);
|
rootBoiler["burnGas"] = _bool_to_char(s, EMS_Boiler.burnGas);
|
||||||
rootBoiler["heatPmp"] = _bool_to_char(s, EMS_Boiler.heatPmp);
|
rootBoiler["heatPmp"] = _bool_to_char(s, EMS_Boiler.heatPmp);
|
||||||
rootBoiler["fanWork"] = _bool_to_char(s, EMS_Boiler.fanWork);
|
rootBoiler["fanWork"] = _bool_to_char(s, EMS_Boiler.fanWork);
|
||||||
rootBoiler["ignWork"] = _bool_to_char(s, EMS_Boiler.ignWork);
|
rootBoiler["ignWork"] = _bool_to_char(s, EMS_Boiler.ignWork);
|
||||||
rootBoiler["wWCirc"] = _bool_to_char(s, EMS_Boiler.wWCirc);
|
rootBoiler["wWCirc"] = _bool_to_char(s, EMS_Boiler.wWCirc);
|
||||||
rootBoiler["selBurnPow"] = _int_to_char(s, EMS_Boiler.selBurnPow);
|
rootBoiler["selBurnPow"] = _int_to_char(s, EMS_Boiler.selBurnPow);
|
||||||
rootBoiler["curBurnPow"] = _int_to_char(s, EMS_Boiler.curBurnPow);
|
rootBoiler["curBurnPow"] = _int_to_char(s, EMS_Boiler.curBurnPow);
|
||||||
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);
|
||||||
rootBoiler["ServiceCode"] = EMS_Boiler.serviceCodeChar;
|
rootBoiler["ServiceCode"] = EMS_Boiler.serviceCodeChar;
|
||||||
rootBoiler["ServiceCodeNumber"] = EMS_Boiler.serviceCode;
|
rootBoiler["ServiceCodeNumber"] = EMS_Boiler.serviceCode;
|
||||||
|
|
||||||
serializeJson(doc, data, sizeof(data));
|
serializeJson(doc, data, sizeof(data));
|
||||||
|
|
||||||
@@ -994,7 +994,7 @@ void initEMSESP() {
|
|||||||
// call PublishValues without forcing, so using CRC to see if we really need to publish
|
// call PublishValues without forcing, so using CRC to see if we really need to publish
|
||||||
void do_publishValues() {
|
void do_publishValues() {
|
||||||
// don't publish if we're not connected to the EMS bus
|
// don't publish if we're not connected to the EMS bus
|
||||||
if ((ems_getBusConnected()) && (!myESP.getUseSerial()) && myESP.isMQTTConnected() ) {
|
if ((ems_getBusConnected()) && (!myESP.getUseSerial()) && myESP.isMQTTConnected()) {
|
||||||
publishValues(false);
|
publishValues(false);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -203,7 +203,7 @@ void ems_init() {
|
|||||||
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
|
||||||
strlcpy(EMS_Boiler.serviceCodeChar, "??", sizeof(EMS_Boiler.serviceCodeChar));
|
strlcpy(EMS_Boiler.serviceCodeChar, "??", sizeof(EMS_Boiler.serviceCodeChar));
|
||||||
EMS_Boiler.serviceCode = EMS_VALUE_SHORT_NOTSET;
|
EMS_Boiler.serviceCode = EMS_VALUE_SHORT_NOTSET;
|
||||||
|
|
||||||
// UBAMonitorSlow
|
// UBAMonitorSlow
|
||||||
EMS_Boiler.extTemp = EMS_VALUE_FLOAT_NOTSET; // Outside temperature
|
EMS_Boiler.extTemp = EMS_VALUE_FLOAT_NOTSET; // Outside temperature
|
||||||
@@ -950,6 +950,7 @@ void _process_UBAMonitorFast(uint8_t type, uint8_t * data, uint8_t length) {
|
|||||||
// read the service code / installation status as appears on the display
|
// read the service code / installation status as appears on the display
|
||||||
EMS_Boiler.serviceCodeChar[0] = char(data[18]); // ascii character 1
|
EMS_Boiler.serviceCodeChar[0] = char(data[18]); // ascii character 1
|
||||||
EMS_Boiler.serviceCodeChar[1] = char(data[19]); // ascii character 2
|
EMS_Boiler.serviceCodeChar[1] = char(data[19]); // ascii character 2
|
||||||
|
EMS_Boiler.serviceCodeChar[2] = '\0'; // null terminate string
|
||||||
|
|
||||||
// read error code
|
// read error code
|
||||||
EMS_Boiler.serviceCode = (data[20] << 8) + data[21];
|
EMS_Boiler.serviceCode = (data[20] << 8) + data[21];
|
||||||
@@ -1514,7 +1515,7 @@ void ems_printAllTypes() {
|
|||||||
*/
|
*/
|
||||||
void ems_doReadCommand(uint8_t type, uint8_t dest, bool forceRefresh) {
|
void ems_doReadCommand(uint8_t type, uint8_t dest, bool forceRefresh) {
|
||||||
// if not a valid type of boiler is not accessible then quits
|
// if not a valid type of boiler is not accessible then quits
|
||||||
if ( (type == EMS_ID_NONE) || (dest == EMS_ID_NONE) ) {
|
if ((type == EMS_ID_NONE) || (dest == EMS_ID_NONE)) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -1561,13 +1562,13 @@ void ems_sendRawTelegram(char * telegram) {
|
|||||||
EMS_Sys_Status.txRetryCount = 0; // reset retry counter
|
EMS_Sys_Status.txRetryCount = 0; // reset retry counter
|
||||||
|
|
||||||
// get first value, which should be the src
|
// get first value, which should be the src
|
||||||
if ( (p = strtok(telegram, " ,")) ) { // delimiter
|
if ((p = strtok(telegram, " ,"))) { // delimiter
|
||||||
strlcpy(value, p, sizeof(value));
|
strlcpy(value, p, sizeof(value));
|
||||||
EMS_TxTelegram.data[0] = (uint8_t)strtol(value, 0, 16);
|
EMS_TxTelegram.data[0] = (uint8_t)strtol(value, 0, 16);
|
||||||
}
|
}
|
||||||
// and interate until end
|
// and interate until end
|
||||||
while (p != 0) {
|
while (p != 0) {
|
||||||
if ( (p = strtok(NULL, " ,")) ) {
|
if ((p = strtok(NULL, " ,"))) {
|
||||||
strlcpy(value, p, sizeof(value));
|
strlcpy(value, p, sizeof(value));
|
||||||
uint8_t val = (uint8_t)strtol(value, 0, 16);
|
uint8_t val = (uint8_t)strtol(value, 0, 16);
|
||||||
EMS_TxTelegram.data[++count] = val;
|
EMS_TxTelegram.data[++count] = val;
|
||||||
|
|||||||
@@ -172,7 +172,7 @@ typedef struct { // UBAParameterWW
|
|||||||
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
|
||||||
char serviceCodeChar[2]; // 2 character status/service code
|
char serviceCodeChar[3]; // 2 character status/service code
|
||||||
uint16_t serviceCode; // error/service code
|
uint16_t serviceCode; // error/service code
|
||||||
|
|
||||||
// UBAMonitorSlow
|
// UBAMonitorSlow
|
||||||
|
|||||||
Reference in New Issue
Block a user