From bf95205af6b8859e54d9f23f1697e9cf44b669ef Mon Sep 17 00:00:00 2001 From: MichaelDvP Date: Sat, 6 Jan 2024 16:10:12 +0100 Subject: [PATCH] fix #1495 wwComfort mode --- interface/package.json | 6 +-- interface/yarn.lock | 114 +++++++++++++++++++-------------------- src/devices/boiler.cpp | 15 ++++-- src/devices/boiler.h | 3 +- src/devices/heatpump.cpp | 4 +- src/locale_common.h | 4 +- 6 files changed, 78 insertions(+), 68 deletions(-) diff --git a/interface/package.json b/interface/package.json index 5526c91b0..72a2d9a3b 100644 --- a/interface/package.json +++ b/interface/package.json @@ -30,7 +30,7 @@ "@types/imagemin": "^8.0.5", "@types/lodash-es": "^4.17.12", "@types/node": "^20.10.6", - "@types/react": "^18.2.46", + "@types/react": "^18.2.47", "@types/react-dom": "^18.2.18", "@types/react-router-dom": "^5.3.3", "alova": "^2.16.2", @@ -52,8 +52,8 @@ "devDependencies": { "@preact/compat": "^17.1.2", "@preact/preset-vite": "^2.8.1", - "@typescript-eslint/eslint-plugin": "^6.17.0", - "@typescript-eslint/parser": "^6.17.0", + "@typescript-eslint/eslint-plugin": "^6.18.0", + "@typescript-eslint/parser": "^6.18.0", "concurrently": "^8.2.2", "eslint": "^8.56.0", "eslint-config-airbnb": "^19.0.4", diff --git a/interface/yarn.lock b/interface/yarn.lock index 5dc0ded15..2422f54df 100644 --- a/interface/yarn.lock +++ b/interface/yarn.lock @@ -1648,14 +1648,14 @@ __metadata: languageName: node linkType: hard -"@types/react@npm:^18.2.46": - version: 18.2.46 - resolution: "@types/react@npm:18.2.46" +"@types/react@npm:^18.2.47": + version: 18.2.47 + resolution: "@types/react@npm:18.2.47" dependencies: "@types/prop-types": "npm:*" "@types/scheduler": "npm:*" csstype: "npm:^3.0.2" - checksum: 10fb28a5b8504106512ce3b154c45d1ac045c31633786773a29f003b3079b434060368bb56f95ef6c39510835ceec4fb8fdc271d6ca2b9cdd979379cf53f126b + checksum: 0a98c2ef8303909f78c973ac9731cb671f3a0b96bc5213b538d1a50cbaae6e51b6befd64845a9cb95af8528767315d5bd99a85608eb716c020393c7d33a9b477 languageName: node linkType: hard @@ -1691,15 +1691,15 @@ __metadata: languageName: node linkType: hard -"@typescript-eslint/eslint-plugin@npm:^6.17.0": - version: 6.17.0 - resolution: "@typescript-eslint/eslint-plugin@npm:6.17.0" +"@typescript-eslint/eslint-plugin@npm:^6.18.0": + version: 6.18.0 + resolution: "@typescript-eslint/eslint-plugin@npm:6.18.0" dependencies: "@eslint-community/regexpp": "npm:^4.5.1" - "@typescript-eslint/scope-manager": "npm:6.17.0" - "@typescript-eslint/type-utils": "npm:6.17.0" - "@typescript-eslint/utils": "npm:6.17.0" - "@typescript-eslint/visitor-keys": "npm:6.17.0" + "@typescript-eslint/scope-manager": "npm:6.18.0" + "@typescript-eslint/type-utils": "npm:6.18.0" + "@typescript-eslint/utils": "npm:6.18.0" + "@typescript-eslint/visitor-keys": "npm:6.18.0" debug: "npm:^4.3.4" graphemer: "npm:^1.4.0" ignore: "npm:^5.2.4" @@ -1712,44 +1712,44 @@ __metadata: peerDependenciesMeta: typescript: optional: true - checksum: f2a5774e9cc03e491a5a488501e5622c7eebd766f5a4fc2c30642864a3b89b0807946bde33a678f326ba7032f3f6a51aa0bf9c2d10adc823804fc9fb47db55a6 + checksum: 7810a84f6d9cb735f6848aa4a7ef64c77740812afc0248fda63ec182910a1d045cd9a32d8e49b0e5323266db6da12a2fe50171147927b3186815a56f12c16ee7 languageName: node linkType: hard -"@typescript-eslint/parser@npm:^6.17.0": - version: 6.17.0 - resolution: "@typescript-eslint/parser@npm:6.17.0" +"@typescript-eslint/parser@npm:^6.18.0": + version: 6.18.0 + resolution: "@typescript-eslint/parser@npm:6.18.0" dependencies: - "@typescript-eslint/scope-manager": "npm:6.17.0" - "@typescript-eslint/types": "npm:6.17.0" - "@typescript-eslint/typescript-estree": "npm:6.17.0" - "@typescript-eslint/visitor-keys": "npm:6.17.0" + "@typescript-eslint/scope-manager": "npm:6.18.0" + "@typescript-eslint/types": "npm:6.18.0" + "@typescript-eslint/typescript-estree": "npm:6.18.0" + "@typescript-eslint/visitor-keys": "npm:6.18.0" debug: "npm:^4.3.4" peerDependencies: eslint: ^7.0.0 || ^8.0.0 peerDependenciesMeta: typescript: optional: true - checksum: 2ed0ed4a5b30e953430ce3279df3655af09fa1caed2abf11804d239717daefc32a22864f6620ef57bb9c684c74a99a13241384fea5096e961385e3678fc2e920 + checksum: 6798332819f839454a8405e31cfaa0fe908d5966be929bef55e78ac51a0ff3868feb42b38e7772cedf88277f6b2841b3d91f6c573eacb945e2741ecae94047c7 languageName: node linkType: hard -"@typescript-eslint/scope-manager@npm:6.17.0": - version: 6.17.0 - resolution: "@typescript-eslint/scope-manager@npm:6.17.0" +"@typescript-eslint/scope-manager@npm:6.18.0": + version: 6.18.0 + resolution: "@typescript-eslint/scope-manager@npm:6.18.0" dependencies: - "@typescript-eslint/types": "npm:6.17.0" - "@typescript-eslint/visitor-keys": "npm:6.17.0" - checksum: fe09c628553c9336e6a36d32c1d34e78ebd20aa02130a6bf535329621ba5a98aaac171f607bc6e4d17b3478c42e7de6476376636897ce3f227c754eb99acd07e + "@typescript-eslint/types": "npm:6.18.0" + "@typescript-eslint/visitor-keys": "npm:6.18.0" + checksum: c2c465e6803f78d3300142167a8a79dd2613c64cf464a40a9cf6b13a2c10c3d82ca30bb9c2d26aba7f054b8740b38e1d25f377fcdf917aba489d5b5ea2550858 languageName: node linkType: hard -"@typescript-eslint/type-utils@npm:6.17.0": - version: 6.17.0 - resolution: "@typescript-eslint/type-utils@npm:6.17.0" +"@typescript-eslint/type-utils@npm:6.18.0": + version: 6.18.0 + resolution: "@typescript-eslint/type-utils@npm:6.18.0" dependencies: - "@typescript-eslint/typescript-estree": "npm:6.17.0" - "@typescript-eslint/utils": "npm:6.17.0" + "@typescript-eslint/typescript-estree": "npm:6.18.0" + "@typescript-eslint/utils": "npm:6.18.0" debug: "npm:^4.3.4" ts-api-utils: "npm:^1.0.1" peerDependencies: @@ -1757,23 +1757,23 @@ __metadata: peerDependenciesMeta: typescript: optional: true - checksum: dc7938429193acfda61b7282197ec046039e2c4da41cdcddf4daaf300d10229e4e23bb0fcf0503b19c0b99a874849c8a9f5bb35ce106260f56a14106d2b41d8c + checksum: 9f4a392fe7b7f6b1fb02acbdaa331e764775f6404c29ca66774419e39552523d878227020526ca9c438d997555a99600f8d711496e9a435fb14a779e25ed094e languageName: node linkType: hard -"@typescript-eslint/types@npm:6.17.0": - version: 6.17.0 - resolution: "@typescript-eslint/types@npm:6.17.0" - checksum: 87ab1b5a3270ab34b917c22a2fb90a9ad7d9f3b19d73a337bc9efbe65f924da13482c97e8ccbe3bd3d081aa96039eeff50de41c1da2a2128066429b931cdb21d +"@typescript-eslint/types@npm:6.18.0": + version: 6.18.0 + resolution: "@typescript-eslint/types@npm:6.18.0" + checksum: fc507ca7a1bfec04467087165ff6722f7b9aa9a089ecf0c17656824a951b92ca014766e480122de850057c63a3066628985eb0681c5bbb80ab41d94e7bb52288 languageName: node linkType: hard -"@typescript-eslint/typescript-estree@npm:6.17.0": - version: 6.17.0 - resolution: "@typescript-eslint/typescript-estree@npm:6.17.0" +"@typescript-eslint/typescript-estree@npm:6.18.0": + version: 6.18.0 + resolution: "@typescript-eslint/typescript-estree@npm:6.18.0" dependencies: - "@typescript-eslint/types": "npm:6.17.0" - "@typescript-eslint/visitor-keys": "npm:6.17.0" + "@typescript-eslint/types": "npm:6.18.0" + "@typescript-eslint/visitor-keys": "npm:6.18.0" debug: "npm:^4.3.4" globby: "npm:^11.1.0" is-glob: "npm:^4.0.3" @@ -1783,34 +1783,34 @@ __metadata: peerDependenciesMeta: typescript: optional: true - checksum: 1671b0d2f2fdf07074fb1e2524d61935cec173bd8db6e482cc5b2dcc77aed3ffa831396736ffa0ee2fdbddd8585ae9ca8d6c97bcaea1385b23907a1ec0508f83 + checksum: b65392e944baba97ed98e99a1e7122b7b05fa0d9a082b48d0190b377ae9e2ae4ed72d505a2f0f05f2ca78908f0e4b0f1acd44d345c7f4f4415fcec6bb2c57791 languageName: node linkType: hard -"@typescript-eslint/utils@npm:6.17.0": - version: 6.17.0 - resolution: "@typescript-eslint/utils@npm:6.17.0" +"@typescript-eslint/utils@npm:6.18.0": + version: 6.18.0 + resolution: "@typescript-eslint/utils@npm:6.18.0" dependencies: "@eslint-community/eslint-utils": "npm:^4.4.0" "@types/json-schema": "npm:^7.0.12" "@types/semver": "npm:^7.5.0" - "@typescript-eslint/scope-manager": "npm:6.17.0" - "@typescript-eslint/types": "npm:6.17.0" - "@typescript-eslint/typescript-estree": "npm:6.17.0" + "@typescript-eslint/scope-manager": "npm:6.18.0" + "@typescript-eslint/types": "npm:6.18.0" + "@typescript-eslint/typescript-estree": "npm:6.18.0" semver: "npm:^7.5.4" peerDependencies: eslint: ^7.0.0 || ^8.0.0 - checksum: 37c63afcf66124bf84808699997953b8c84a378aa2c490a771b611d82cdac8499c58fac8eeb8378528e97660b59563d99297bfec4b982cd68760b0ffe54aa714 + checksum: f91798069e337ed42b7e415aabded833d540dab9adf66ae88183003428892584946f20a5496aae2dc65fc0f65b66496baed785a3470ee782b6e2dd25b9200c6c languageName: node linkType: hard -"@typescript-eslint/visitor-keys@npm:6.17.0": - version: 6.17.0 - resolution: "@typescript-eslint/visitor-keys@npm:6.17.0" +"@typescript-eslint/visitor-keys@npm:6.18.0": + version: 6.18.0 + resolution: "@typescript-eslint/visitor-keys@npm:6.18.0" dependencies: - "@typescript-eslint/types": "npm:6.17.0" + "@typescript-eslint/types": "npm:6.18.0" eslint-visitor-keys: "npm:^3.4.1" - checksum: a2aed0e1437fdab8858ab9c7c8e355f8b72a5fa4b0adc54f28b8a2bbc29d4bb93214968ee940f83d013d0a4b83d00cd4eeeb05fb4c2c7d0ead324c6793f7d6d4 + checksum: bf34a357549d515607c761f385b7c7c82aaa07795cada0be2e1e3860c5103fbf731408ac07eaeb0517b51426d77ef9b194dfb94f205c776107a46e0d0027b452 languageName: node linkType: hard @@ -1837,11 +1837,11 @@ __metadata: "@types/imagemin": "npm:^8.0.5" "@types/lodash-es": "npm:^4.17.12" "@types/node": "npm:^20.10.6" - "@types/react": "npm:^18.2.46" + "@types/react": "npm:^18.2.47" "@types/react-dom": "npm:^18.2.18" "@types/react-router-dom": "npm:^5.3.3" - "@typescript-eslint/eslint-plugin": "npm:^6.17.0" - "@typescript-eslint/parser": "npm:^6.17.0" + "@typescript-eslint/eslint-plugin": "npm:^6.18.0" + "@typescript-eslint/parser": "npm:^6.18.0" alova: "npm:^2.16.2" async-validator: "npm:^4.2.5" concurrently: "npm:^8.2.2" diff --git a/src/devices/boiler.cpp b/src/devices/boiler.cpp index 90ee562b1..5bf11ce39 100644 --- a/src/devices/boiler.cpp +++ b/src/devices/boiler.cpp @@ -846,6 +846,7 @@ Boiler::Boiler(uint8_t device_type, int8_t device_id, uint8_t product_id, const FL_(wwComfort), DeviceValueUOM::NONE, MAKE_CF_CB(set_ww_mode)); + wwComfort2_ = EMS_VALUE_UINT_NOTSET; // read separately, but published as wwComfort1_ register_device_value(DeviceValueTAG::TAG_BOILER_DATA_WW, &wwComfort1_, DeviceValueType::ENUM, @@ -1469,8 +1470,11 @@ void Boiler::process_UBAParameterWWPlus(std::shared_ptr telegram has_update(telegram, wwChargeOptimization_, 25); has_update(telegram, wwSelTempEcoplus_, 27); + telegram->read_value(wwComfort2_, 26); uint8_t wwComfort1 = EMS_VALUE_UINT_NOTSET; - if (telegram->read_value(wwComfort1, 13)) { + if (Helpers::hasValue(wwComfort2_)) { + has_update(wwComfort1_, wwComfort2_); + } else if (telegram->read_value(wwComfort1, 13)) { if (wwComfort1 == 0) { wwComfort1 = 0; // High_Comfort } else if (wwComfort1 == 0xD8) { @@ -2417,10 +2421,15 @@ bool Boiler::set_ww_mode(const char * value, const int8_t id) { uint8_t set; uint8_t comfort[] = {0x00, 0xD8, 0xEC}; // heat, eco, intelligent - if (is_received(EMS_TYPE_UBAParameterWWPlus)) { + if (Helpers::hasValue(wwComfort2_)) { + if (Helpers::value2enum(value, set, FL_(enum_comfort1))) { + write_command(EMS_TYPE_UBAParameterWWPlus, 26, set, EMS_TYPE_UBAParameterWWPlus); + return true; + } + } else if (is_received(EMS_TYPE_UBAParameterWWPlus)) { if (Helpers::value2enum(value, set, FL_(enum_comfort1))) { write_command(EMS_TYPE_UBAParameterWWPlus, 13, comfort[set], EMS_TYPE_UBAParameterWWPlus); - write_command(0x05, 70, set == 0 ? 0xAA : 0x55); // + write_command(0x05, 70, set == 1 ? 0xAA : 0x55); // return true; } } else { diff --git a/src/devices/boiler.h b/src/devices/boiler.h index 7a76337f5..70fa992c0 100644 --- a/src/devices/boiler.h +++ b/src/devices/boiler.h @@ -60,7 +60,8 @@ class Boiler : public EMSdevice { uint8_t wwSelTempEcoplus_; // DHW ECO+ temperature uint8_t wwType_; // 0-off, 1-flow, 2-flowbuffer, 3-buffer, 4-layered buffer uint8_t wwComfort_; // WW comfort mode - uint8_t wwComfort1_; // WW comfort mode RC310 + uint8_t wwComfort1_; // WW comfort mode RC310, 0xEA offset 13 + uint8_t wwComfort2_; // WW comfort mode emsplus 0xEA, offset 26 uint8_t wwCircPump_; // DHW circulation pump available uint8_t wwChargeType_; // DHW charge type (pump or 3-way-valve) uint8_t wwChargeOptimization_; // DHW charge optimization diff --git a/src/devices/heatpump.cpp b/src/devices/heatpump.cpp index 862ba121a..8a1c214b6 100644 --- a/src/devices/heatpump.cpp +++ b/src/devices/heatpump.cpp @@ -88,7 +88,7 @@ Heatpump::Heatpump(uint8_t device_type, uint8_t device_id, uint8_t product_id, c register_device_value(DeviceValueTAG::TAG_DEVICE_DATA, &hybridDHW_, DeviceValueType::ENUM, - FL_(enum_comfort1), + FL_(enum_comfort2), FL_(hybridDHW), DeviceValueUOM::NONE, MAKE_CF_CB(set_hybridDHW)); @@ -332,7 +332,7 @@ bool Heatpump::set_lowNoiseStop(const char * value, const int8_t id) { } bool Heatpump::set_hybridDHW(const char * value, const int8_t id) { uint8_t v; - if (!Helpers::value2enum(value, v, FL_(enum_comfort1))) { + if (!Helpers::value2enum(value, v, FL_(enum_comfort2))) { return false; } write_command(0x998, 1, v, 0x998); diff --git a/src/locale_common.h b/src/locale_common.h index d793be134..1c69a1870 100644 --- a/src/locale_common.h +++ b/src/locale_common.h @@ -277,8 +277,8 @@ MAKE_ENUM(enum_charge, FL_(chargepump), FL_(3wayvalve)) MAKE_ENUM(enum_freq, FL_(off), FL_(1x3min), FL_(2x3min), FL_(3x3min), FL_(4x3min), FL_(5x3min), FL_(6x3min), FL_(continuous)) MAKE_ENUM(enum_off_time_date_manual, FL_(off), FL_(time), FL_(date), FL_(manual)) MAKE_ENUM(enum_comfort, FL_(hot), FL_(eco), FL_(intelligent)) -// MAKE_ENUM(enum_comfort1, FL_(high_comfort), FL_(eco)) -MAKE_ENUM(enum_comfort1, FL_(eco), FL_(high_comfort)) +MAKE_ENUM(enum_comfort1, FL_(high_comfort), FL_(eco)) +MAKE_ENUM(enum_comfort2, FL_(eco), FL_(high_comfort)) MAKE_ENUM(enum_flow, FL_(off), FL_(flow), FL_(bufferedflow), FL_(buffer), FL_(layeredbuffer)) MAKE_ENUM(enum_reset, FL_(dash), FL_(maintenance), FL_(error)) MAKE_ENUM(enum_maxHeat, FL_(0kW), FL_(2kW), FL_(3kW), FL_(4kW), FL_(6kW), FL_(9kW))