diff --git a/interface/package.json b/interface/package.json index de9d51290..20ed71327 100644 --- a/interface/package.json +++ b/interface/package.json @@ -67,5 +67,5 @@ "vite-plugin-imagemin": "^0.6.1", "vite-tsconfig-paths": "^6.1.0" }, - "packageManager": "pnpm@10.29.1" + "packageManager": "pnpm@10.29.2" } diff --git a/src/devices/boiler.cpp b/src/devices/boiler.cpp index 3b2b49c1e..1c6157cf9 100644 --- a/src/devices/boiler.cpp +++ b/src/devices/boiler.cpp @@ -647,6 +647,7 @@ Boiler::Boiler(uint8_t device_type, int8_t device_id, uint8_t product_id, const DeviceValueUOM::DEGREES, MAKE_CF_CB(set_pool_temp)); // register_device_value(DeviceValueTAG::TAG_DEVICE_DATA, &hp4wayValve_, DeviceValueType::ENUM, FL_(enum_4way), FL_(hp4wayValve), DeviceValueUOM::NONE); + register_device_value(DeviceValueTAG::TAG_DEVICE_DATA, &hp4wayValve_, DeviceValueType::BOOL, FL_(hp4wayValve), DeviceValueUOM::NONE); register_device_value(DeviceValueTAG::TAG_DEVICE_DATA, &hpInput[0].state, DeviceValueType::BOOL, FL_(hpInput1), DeviceValueUOM::NONE); register_device_value(DeviceValueTAG::TAG_DEVICE_DATA, &hpInput[0].option, @@ -1731,7 +1732,9 @@ void Boiler::process_HpPower(std::shared_ptr telegram) { has_bitupdate(telegram, hp3wayValve_, 0, 6); // has_bitupdate(telegram, heating_, 0, 0); // heating on? https://github.com/emsesp/EMS-ESP32/discussions/1898 has_bitupdate(telegram, hpSwitchValve_, 0, 4); - + if (coolingType_ == 3) { + has_bitupdate(telegram, hp4wayValve_, 0, 3); // https://github.com/emsesp/EMS-ESP32/issues/2844#issuecomment-3869770845 + } has_bitupdate(telegram, elHeatStep1_, 3, 0); has_bitupdate(telegram, elHeatStep2_, 3, 1); has_bitupdate(telegram, elHeatStep3_, 3, 2); @@ -1831,6 +1834,8 @@ void Boiler::process_HpInConfig(std::shared_ptr telegram) { // Boiler(0x08) -W-> Me(0x0B), HpHeaterConfig(0x0485) void Boiler::process_HpCooling(std::shared_ptr telegram) { + // coolingtype to set 4wayvalve (0x48D), type not published yet, https://github.com/emsesp/EMS-ESP32/issues/2844#issuecomment-3869770845 + has_update(telegram, coolingType_, 0); // none = 0, passive cooling box = 1, active cooling box = 2, 4-way valve = 3, active and passive cooling box = 4. has_update(telegram, pvCooling_, 21); } diff --git a/src/devices/boiler.h b/src/devices/boiler.h index 3de7aec72..becd74bb2 100644 --- a/src/devices/boiler.h +++ b/src/devices/boiler.h @@ -270,6 +270,7 @@ class Boiler : public EMSdevice { uint8_t powerReduction_; uint8_t pvCooling_; + uint8_t coolingType_; uint8_t auxHeatMode_; uint8_t auxMaxLimit_; uint8_t auxLimitStart_; diff --git a/src/web/WebCustomEntityService.cpp b/src/web/WebCustomEntityService.cpp index eb5cef8a9..3e4356318 100644 --- a/src/web/WebCustomEntityService.cpp +++ b/src/web/WebCustomEntityService.cpp @@ -137,8 +137,6 @@ StateUpdateResult WebCustomEntity::update(JsonObject root, WebCustomEntity & web snprintf(key, sizeof(key), "c:%s", entityItem.name); if (EMSESP::nvs_.isKey(key)) { entityItem.data = EMSESP::nvs_.getString(key).c_str(); - } else { - EMSESP::nvs_.putString(key, entityItem.data.c_str()); } } webCustomEntity.customEntityItems.push_back(entityItem); // add to list @@ -174,13 +172,16 @@ bool WebCustomEntityService::command_setvalue(const char * value, const int8_t i for (CustomEntityItem & entityItem : *customEntityItems_) { if (Helpers::toLower(entityItem.name) == Helpers::toLower(name)) { + if (entityItem.data == value) { + return true; // no change + } if (entityItem.ram == 1) { entityItem.data = value; } else if (entityItem.ram == 2) { // NVS entityItem.data = value; char key[sizeof(entityItem.name) + 2]; snprintf(key, sizeof(key), "c:%s", entityItem.name); - if (EMSESP::nvs_.getString(key) != entityItem.data.c_str()) { + if (!EMSESP::nvs_.isKey(key) || EMSESP::nvs_.getString(key) != entityItem.data.c_str()) { EMSESP::nvs_.putString(key, entityItem.data.c_str()); } } else if (entityItem.value_type == DeviceValueType::STRING) {