mirror of
https://github.com/emsesp/EMS-ESP32.git
synced 2025-12-07 16:29:51 +03:00
add serviceCode change detect, show serviceCode in web
This commit is contained in:
@@ -105,6 +105,14 @@ void Boiler::register_mqtt_ha_config() {
|
|||||||
void Boiler::device_info(JsonArray & root) {
|
void Boiler::device_info(JsonArray & root) {
|
||||||
JsonObject dataElement;
|
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)) {
|
if (Helpers::hasValue(tap_water_active_, EMS_VALUE_BOOL)) {
|
||||||
dataElement = root.createNestedObject();
|
dataElement = root.createNestedObject();
|
||||||
dataElement["name"] = F("Hot tap water");
|
dataElement["name"] = F("Hot tap water");
|
||||||
@@ -509,8 +517,8 @@ void Boiler::process_UBAMonitorFast(std::shared_ptr<const Telegram> telegram) {
|
|||||||
|
|
||||||
// read the service code / installation status as appears on the display
|
// read the service code / installation status as appears on the display
|
||||||
if ((telegram->message_length > 18) && (telegram->offset == 0)) {
|
if ((telegram->message_length > 18) && (telegram->offset == 0)) {
|
||||||
serviceCodeChar_[0] = char(telegram->message_data[18]); // ascii character 1
|
changed_ |= telegram->read_value(serviceCodeChar_[0], 18);
|
||||||
serviceCodeChar_[1] = char(telegram->message_data[19]); // ascii character 2
|
changed_ |= telegram->read_value(serviceCodeChar_[1], 19);
|
||||||
serviceCodeChar_[2] = '\0'; // null terminate string
|
serviceCodeChar_[2] = '\0'; // null terminate string
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -576,8 +584,8 @@ void Boiler::process_UBAMonitorFastPlus(std::shared_ptr<const Telegram> telegram
|
|||||||
|
|
||||||
// read the service code / installation status as appears on the display
|
// read the service code / installation status as appears on the display
|
||||||
if ((telegram->message_length > 4) && (telegram->offset == 0)) {
|
if ((telegram->message_length > 4) && (telegram->offset == 0)) {
|
||||||
serviceCodeChar_[0] = char(telegram->message_data[4]); // ascii character 1
|
changed_ |= telegram->read_value(serviceCodeChar_[0], 4);
|
||||||
serviceCodeChar_[1] = char(telegram->message_data[5]); // ascii character 2
|
changed_ |= telegram->read_value(serviceCodeChar_[1], 5);
|
||||||
serviceCodeChar_[2] = '\0';
|
serviceCodeChar_[2] = '\0';
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -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 last_boilerState = 0xFF; // remember last state of heating and warm water on/off
|
||||||
uint8_t mqtt_format_; // single, nested or ha
|
uint8_t mqtt_format_; // single, nested or ha
|
||||||
bool changed_ = false;
|
bool changed_ = false;
|
||||||
;
|
|
||||||
|
|
||||||
static constexpr uint8_t EMS_TYPE_UBAParameterWW = 0x33;
|
static constexpr uint8_t EMS_TYPE_UBAParameterWW = 0x33;
|
||||||
static constexpr uint8_t EMS_TYPE_UBAFunctionTest = 0x1D;
|
static constexpr uint8_t EMS_TYPE_UBAFunctionTest = 0x1D;
|
||||||
|
|||||||
Reference in New Issue
Block a user