diff --git a/src/devices/boiler.cpp b/src/devices/boiler.cpp index 5f75e7ed8..8928d5f58 100644 --- a/src/devices/boiler.cpp +++ b/src/devices/boiler.cpp @@ -105,6 +105,14 @@ void Boiler::register_mqtt_ha_config() { void Boiler::device_info(JsonArray & root) { JsonObject dataElement; + if (serviceCodeChar_[0] && Helpers::hasValue(serviceCode_)) { + dataElement = root.createNestedObject(); + dataElement["name"] = F("Service Code"); + char s[12]; + snprintf_P(s, 12, PSTR("%s (%d)"), serviceCodeChar_, serviceCode_); + dataElement["value"] = s; + } + if (Helpers::hasValue(tap_water_active_, EMS_VALUE_BOOL)) { dataElement = root.createNestedObject(); dataElement["name"] = F("Hot tap water"); @@ -509,8 +517,8 @@ void Boiler::process_UBAMonitorFast(std::shared_ptr telegram) { // read the service code / installation status as appears on the display if ((telegram->message_length > 18) && (telegram->offset == 0)) { - serviceCodeChar_[0] = char(telegram->message_data[18]); // ascii character 1 - serviceCodeChar_[1] = char(telegram->message_data[19]); // ascii character 2 + changed_ |= telegram->read_value(serviceCodeChar_[0], 18); + changed_ |= telegram->read_value(serviceCodeChar_[1], 19); serviceCodeChar_[2] = '\0'; // null terminate string } @@ -576,8 +584,8 @@ void Boiler::process_UBAMonitorFastPlus(std::shared_ptr telegram // read the service code / installation status as appears on the display if ((telegram->message_length > 4) && (telegram->offset == 0)) { - serviceCodeChar_[0] = char(telegram->message_data[4]); // ascii character 1 - serviceCodeChar_[1] = char(telegram->message_data[5]); // ascii character 2 + changed_ |= telegram->read_value(serviceCodeChar_[0], 4); + changed_ |= telegram->read_value(serviceCodeChar_[1], 5); serviceCodeChar_[2] = '\0'; } diff --git a/src/devices/boiler.h b/src/devices/boiler.h index c149df1b5..a511c05f6 100644 --- a/src/devices/boiler.h +++ b/src/devices/boiler.h @@ -54,7 +54,6 @@ class Boiler : public EMSdevice { uint8_t last_boilerState = 0xFF; // remember last state of heating and warm water on/off uint8_t mqtt_format_; // single, nested or ha bool changed_ = false; - ; static constexpr uint8_t EMS_TYPE_UBAParameterWW = 0x33; static constexpr uint8_t EMS_TYPE_UBAFunctionTest = 0x1D;