From 585abe4b272bcb8a7c371b1449b2feb7a9c304f7 Mon Sep 17 00:00:00 2001 From: rysiulg <43485433+rysiulg@users.noreply.github.com> Date: Sun, 20 Oct 2024 13:49:32 +0200 Subject: [PATCH 1/6] Update CHANGELOG.md Added COP -efficiency of heat pump -tells how much energy is produced from 1kWh of energy consumed -eg 3.69 means 3.69 more kWh energy in heat was produced consumed 1kWh of power energy -bigger is better moved register 101 to text sensor with status from hp -status 5 was missing in service manual but is assumed as dhw heat register 200 is moved to text sensor and decoded with apliance type etc with easly add new values if needed -for only alreadey filled i have data --- CHANGELOG.md | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index a873e02..1fe8497 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -9,6 +9,10 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 ### Changed +- Add COP -efficiency of heat pump +- Update Register: 103 -convert valve open position to percent representation +- Update Register: 101 is moved to text sensor with status +- Update Register: 200 is moved to text sensor - Update Register: 211 to be fully configurable except reserved values - Update Register: 210 to be fully configurable except reserved values From 8d41b1c9e6363029d72b98b0679ac6bd9b939706 Mon Sep 17 00:00:00 2001 From: rysiulg <43485433+rysiulg@users.noreply.github.com> Date: Sun, 20 Oct 2024 13:52:48 +0200 Subject: [PATCH 2/6] Update heatpump.yaml add cop/ update registers: 101, 102, 200 Added COP -efficiency of heat pump -tells how much energy is produced from 1kWh of energy consumed -eg 3.69 means 3.69 more kWh energy in heat was produced consumed 1kWh of power energy -bigger is better moved register 101 to text sensor with status from hp -status 5 was missing in service manual but is assumed as dhw heat register 200 is moved to text sensor and decoded with apliance type etc with easly add new values if needed -for only alreadey filled i have data --- heatpump.yaml | 139 ++++++++++++++++++++++++++++++++++++-------------- 1 file changed, 100 insertions(+), 39 deletions(-) diff --git a/heatpump.yaml b/heatpump.yaml index ff13f5e..d2c7de0 100644 --- a/heatpump.yaml +++ b/heatpump.yaml @@ -335,6 +335,16 @@ sensor: name: Uptime id: "${devicename}_uptime" icon: mdi:timelapse + - platform: template + id: "${devicename}_cop" + name: "COP" + icon: mdi:copyleft + accuracy_decimals: 2 + lambda: |- + // Verify that electricity_consumption is <> 0 to avoid division by 0 error + if (id(${devicename}_electricity_consumption).state != 0) { + return id(${devicename}_power_output).state / id(${devicename}_electricity_consumption).state; + } else return {}; # Register: 0 -> Config is present as select, but now we need get value from heatpump and save it as global var - platform: modbus_controller modbus_controller_id: "${devicename}" @@ -436,15 +446,7 @@ sensor: address: 0x64 value_type: U_WORD unit_of_measurement: Hz - # Register: 101 - - platform: modbus_controller - modbus_controller_id: "${devicename}" - name: "Operating Mode" - id: "${devicename}_operating_mode" - icon: mdi:state-machine - register_type: holding - address: 0x65 - value_type: U_WORD + # Register: 101 ->moved text_sensor # Register: 102 - platform: modbus_controller modbus_controller_id: "${devicename}" @@ -465,6 +467,11 @@ sensor: address: 0x67 value_type: U_WORD unit_of_measurement: "%" + filters: + - calibrate_linear: + # York, MIDEA have movement 0-480 + - 0 -> 0.0 + - 480 -> 100.0 # Register: 104 - platform: modbus_controller modbus_controller_id: "${devicename}" @@ -862,36 +869,7 @@ sensor: # The following register address 200-208 can only use 03H (Read register) function code. # Register address 209 and after can use 03H, 06H (write single register), 10H (write multiple register). - # Register: 200 (High byte) - - platform: modbus_controller - modbus_controller_id: "${devicename}" - name: "Home Appliance Type" - id: "${devicename}_home_appliance_type" - icon: mdi:state-machine - register_type: holding - address: 0xc8 - value_type: U_WORD - bitmask: 0x00FF - # Register: 200 (Low byte, first 4 bits) - - platform: modbus_controller - modbus_controller_id: "${devicename}" - name: "Home Appliance Sub Type" - id: "${devicename}_home_appliance_sub_type" - icon: "mdi:information-box-outline" - register_type: holding - address: 0xc8 - value_type: U_WORD - bitmask: 0xF000 - # Register: 200 (Low byte, second 4 bits) - - platform: modbus_controller - modbus_controller_id: "${devicename}" - name: "Home Appliance Product Code" - id: "${devicename}_home_appliance_product_code" - icon: "mdi:information-box-outline" - register_type: holding - address: 0xc8 - value_type: U_WORD - bitmask: 0x0F00 + # Register: 200 ->moved to text_sensor # Register: 201 (Low), default: 25, TODO: verify default - platform: modbus_controller modbus_controller_id: "${devicename}" @@ -4547,3 +4525,86 @@ text_sensor: - 141 -> L7 - 142 -> L8 - 143 -> L9 + # Register: 101 + - platform: modbus_controller + modbus_controller_id: "${devicename}" + name: "Operating Mode" + id: "${devicename}_operating_mode" + icon: mdi:state-machine + register_type: holding + address: 0x65 + response_size: 2 + lambda: |- + int idx = item->offset; + uint16_t rawdata = (uint16_t(data[idx]) << 8) + uint16_t(data[idx + 1]); + std::string output = "Unknown: "; + output += to_string(rawdata); + if (rawdata == 0) output = "OFF"; + else if (rawdata == 2) output = "Cooling"; + else if (rawdata == 3) output = "CO Heating"; + else if (rawdata == 5) output = "DHW Heating"; + // ESP_LOGD("Register 101","Operating mode %s (%d)", output.c_str(), rawdata); + return output; + # Register: 200 (High byte) + - platform: modbus_controller + modbus_controller_id: "${devicename}" + name: "Home Appliance Type" + id: "${devicename}_home_appliance_type" + icon: mdi:state-machine + register_type: holding + address: 0xc8 + response_size: 2 + raw_encode: HEXBYTES + lambda: |- + int idx = item->offset; + std::string z = ""; + uint16_t rawdata = (uint16_t(data[idx]) << 8) + uint16_t(data[idx + 1]); + // ESP_LOGD("Register 200", "The current version is 0x%x", rawdata); + if ((rawdata >> 8) == 7) { + z = "Air to water heat pump"; + } else { + z = std::to_string(data[idx]); + } + return {z}; + # Register: 200 (Low byte, first 4 bits) + - platform: modbus_controller + modbus_controller_id: "${devicename}" + name: "Home Appliance Sub Type" + id: "${devicename}_home_appliance_sub_type" + icon: "mdi:information-box-outline" + register_type: holding + address: 0xc8 + response_size: 2 + raw_encode: HEXBYTES + lambda: |- + int idx = item->offset; + std::string z = ""; + uint16_t rawdata = (uint16_t(data[idx]) << 8) + uint16_t(data[idx + 1]); + // ESP_LOGD("Register 200", "The current version is 0x%x", rawdata); + if (((rawdata & 0x000F) ) == 2) { + z = "R32"; + } else { + z = std::to_string(rawdata & 0x0F) ; + } + return {z}; + # Register: 200 (Low byte, second 4 bits) + - platform: modbus_controller + modbus_controller_id: "${devicename}" + name: "Home Appliance Product Code" + id: "${devicename}_home_appliance_product_code" + icon: "mdi:information-box-outline" + register_type: holding + response_size: 2 + raw_encode: HEXBYTES + address: 0xc8 + lambda: |- + int idx = item->offset; + std::string z = ""; + uint16_t rawdata = (uint16_t(data[idx]) << 8) + uint16_t(data[idx + 1]); + // ESP_LOGD("Register 200", "The current version is 0x%x rawdata ", rawdata); + if (((rawdata & 0x00F0) >> 4) == 4) { + z = "4"; + } else { + z = std::to_string((rawdata & 0x00F0) >> 4); + } + return {z}; From 1ccd59f90ce2de622b28255bfc2f03e73e339606 Mon Sep 17 00:00:00 2001 From: rysiulg <43485433+rysiulg@users.noreply.github.com> Date: Sun, 20 Oct 2024 13:53:13 +0200 Subject: [PATCH 3/6] Update CHANGELOG.md --- CHANGELOG.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 1fe8497..8428edc 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -10,7 +10,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 ### Changed - Add COP -efficiency of heat pump -- Update Register: 103 -convert valve open position to percent representation +- Update Register: 102 -convert valve open position to percent representation - Update Register: 101 is moved to text sensor with status - Update Register: 200 is moved to text sensor - Update Register: 211 to be fully configurable except reserved values From bdc18566a9dd0c5e7ddbea8d019de8d687fe9797 Mon Sep 17 00:00:00 2001 From: rysiulg <43485433+rysiulg@users.noreply.github.com> Date: Sun, 20 Oct 2024 16:23:32 +0200 Subject: [PATCH 4/6] Update CHANGELOG.md --- CHANGELOG.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 8428edc..1fe8497 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -10,7 +10,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 ### Changed - Add COP -efficiency of heat pump -- Update Register: 102 -convert valve open position to percent representation +- Update Register: 103 -convert valve open position to percent representation - Update Register: 101 is moved to text sensor with status - Update Register: 200 is moved to text sensor - Update Register: 211 to be fully configurable except reserved values From aa9464f701bbe077c807956ceeddf103dce8f005 Mon Sep 17 00:00:00 2001 From: rysiulg <43485433+rysiulg@users.noreply.github.com> Date: Mon, 21 Oct 2024 09:13:30 +0200 Subject: [PATCH 5/6] Update heatpump.yaml COP and comments namings ;) --- heatpump.yaml | 17 +++++++++-------- 1 file changed, 9 insertions(+), 8 deletions(-) diff --git a/heatpump.yaml b/heatpump.yaml index d2c7de0..b0ef3c2 100644 --- a/heatpump.yaml +++ b/heatpump.yaml @@ -336,10 +336,11 @@ sensor: id: "${devicename}_uptime" icon: mdi:timelapse - platform: template - id: "${devicename}_cop" - name: "COP" + name: "Coefficient of Performance" + id: "${devicename}_coefficient_of_performance" icon: mdi:copyleft accuracy_decimals: 2 + unit_of_measurement: "COP" lambda: |- // Verify that electricity_consumption is <> 0 to avoid division by 0 error if (id(${devicename}_electricity_consumption).state != 0) { @@ -446,7 +447,7 @@ sensor: address: 0x64 value_type: U_WORD unit_of_measurement: Hz - # Register: 101 ->moved text_sensor + # Register: 101 -> Is present in this config as a 'text_sensor' # Register: 102 - platform: modbus_controller modbus_controller_id: "${devicename}" @@ -869,7 +870,7 @@ sensor: # The following register address 200-208 can only use 03H (Read register) function code. # Register address 209 and after can use 03H, 06H (write single register), 10H (write multiple register). - # Register: 200 ->moved to text_sensor + # Register: 200 -> Is present in this config as a 'text_sensor' # Register: 201 (Low), default: 25, TODO: verify default - platform: modbus_controller modbus_controller_id: "${devicename}" @@ -4541,7 +4542,7 @@ text_sensor: output += to_string(rawdata); if (rawdata == 0) output = "OFF"; else if (rawdata == 2) output = "Cooling"; - else if (rawdata == 3) output = "CO Heating"; + else if (rawdata == 3) output = "Heating"; else if (rawdata == 5) output = "DHW Heating"; // ESP_LOGD("Register 101","Operating mode %s (%d)", output.c_str(), rawdata); return output; @@ -4559,7 +4560,7 @@ text_sensor: int idx = item->offset; std::string z = ""; uint16_t rawdata = (uint16_t(data[idx]) << 8) + uint16_t(data[idx + 1]); - // ESP_LOGD("Register 200", "The current version is 0x%x", rawdata); + // ESP_LOGD("Register 200", "The home appliance type is 0x%x", rawdata); if ((rawdata >> 8) == 7) { z = "Air to water heat pump"; } else { @@ -4580,7 +4581,7 @@ text_sensor: int idx = item->offset; std::string z = ""; uint16_t rawdata = (uint16_t(data[idx]) << 8) + uint16_t(data[idx + 1]); - // ESP_LOGD("Register 200", "The current version is 0x%x", rawdata); + // ESP_LOGD("Register 200", "The home appliance sub type is 0x%x", rawdata); if (((rawdata & 0x000F) ) == 2) { z = "R32"; } else { @@ -4601,7 +4602,7 @@ text_sensor: int idx = item->offset; std::string z = ""; uint16_t rawdata = (uint16_t(data[idx]) << 8) + uint16_t(data[idx + 1]); - // ESP_LOGD("Register 200", "The current version is 0x%x rawdata ", rawdata); + // ESP_LOGD("Register 200", "The home appliance product code is 0x%x rawdata ", rawdata); if (((rawdata & 0x00F0) >> 4) == 4) { z = "4"; } else { From 75907c88896f4fb2043272eeec5848441a27847e Mon Sep 17 00:00:00 2001 From: rysiulg <43485433+rysiulg@users.noreply.github.com> Date: Mon, 21 Oct 2024 09:15:33 +0200 Subject: [PATCH 6/6] Update CHANGELOG.md --- CHANGELOG.md | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 1fe8497..c5a1a7f 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -9,10 +9,10 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 ### Changed -- Add COP -efficiency of heat pump -- Update Register: 103 -convert valve open position to percent representation +- Add COP -Heat pump efficiency factor +- Update Register: 103 -Convert valve open position to percent representation - Update Register: 101 is moved to text sensor with status -- Update Register: 200 is moved to text sensor +- Update Register: 200 is moved to text sensor with Homapliance decode value code to text names - Update Register: 211 to be fully configurable except reserved values - Update Register: 210 to be fully configurable except reserved values