From cccab556d89f847dce604bc2d396e767407f8c7b Mon Sep 17 00:00:00 2001 From: matthias882 <30553262+matthias882@users.noreply.github.com> Date: Tue, 6 Feb 2024 07:04:22 +0100 Subject: [PATCH 01/14] add cmd f3 --- components/samsung_ac/protocol_non_nasa.h | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/components/samsung_ac/protocol_non_nasa.h b/components/samsung_ac/protocol_non_nasa.h index dce34c97..90153646 100644 --- a/components/samsung_ac/protocol_non_nasa.h +++ b/components/samsung_ac/protocol_non_nasa.h @@ -62,6 +62,17 @@ namespace esphome }; }; + struct NonNasaCommandF3 + { + uint8_t inverter_max_frequency = 0; + uint8_t inverter_total_capacity_requirement = 0; + uint8_t inverter_current = 0; + uint16_t inverter_voltage = 0; + + std::string to_string(); + }; + + struct NonNasaCommandRaw { uint8_t length; @@ -78,6 +89,7 @@ namespace esphome { Cmd20 = 0x20, CmdC6 = 0xc6, + CmdF3 = 0xf3, CmdF8 = 0xF8, }; @@ -96,6 +108,7 @@ namespace esphome { NonNasaCommand20 command20; NonNasaCommandC6 commandC6; + NonNasaCommandF3 commandF3; NonNasaCommandRaw commandF8; // Unknown structure for now NonNasaCommandRaw commandRaw; }; From 746f4162f8e22fff05b13c49376d9b1fd72b58a9 Mon Sep 17 00:00:00 2001 From: matthias882 <30553262+matthias882@users.noreply.github.com> Date: Tue, 6 Feb 2024 07:22:06 +0100 Subject: [PATCH 02/14] tostring cmdf3 --- components/samsung_ac/protocol_non_nasa.cpp | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/components/samsung_ac/protocol_non_nasa.cpp b/components/samsung_ac/protocol_non_nasa.cpp index 90f88437..551d9246 100644 --- a/components/samsung_ac/protocol_non_nasa.cpp +++ b/components/samsung_ac/protocol_non_nasa.cpp @@ -39,6 +39,16 @@ namespace esphome return str; } + std::string NonNasaCommandF3::to_string() + { + std::string str; + str += "inverter_max_frequency[Hz]:" + std::to_string(inverter_max_frequency) + ";"; + str += "inverter_total_capacity_requirement[kW]:" + std::to_string(inverter_total_capacity_requirement) + ";"; + str += "inverter_current[ADC]:" + std::to_string(inverter_current) + ";"; + str += "inverter_voltage[VDC]:" + std::to_string(inverter_voltage) + ";"; + return str; + } + std::string NonNasaDataPacket::to_string() { std::string str; From fd36d2943cae257f8b3ddcda0f2913429c94f871 Mon Sep 17 00:00:00 2001 From: matthias882 <30553262+matthias882@users.noreply.github.com> Date: Tue, 6 Feb 2024 07:30:54 +0100 Subject: [PATCH 03/14] Update protocol_non_nasa.h --- components/samsung_ac/protocol_non_nasa.h | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/components/samsung_ac/protocol_non_nasa.h b/components/samsung_ac/protocol_non_nasa.h index 90153646..91535e56 100644 --- a/components/samsung_ac/protocol_non_nasa.h +++ b/components/samsung_ac/protocol_non_nasa.h @@ -65,9 +65,9 @@ namespace esphome struct NonNasaCommandF3 { uint8_t inverter_max_frequency = 0; - uint8_t inverter_total_capacity_requirement = 0; - uint8_t inverter_current = 0; - uint16_t inverter_voltage = 0; + float inverter_total_capacity_requirement = 0; + float inverter_current = 0; + float inverter_voltage = 0; std::string to_string(); }; From df16cc1ad2d20ae703dd111429be96e7e55b654e Mon Sep 17 00:00:00 2001 From: matthias882 <30553262+matthias882@users.noreply.github.com> Date: Tue, 6 Feb 2024 07:39:34 +0100 Subject: [PATCH 04/14] Update protocol_non_nasa.cpp --- components/samsung_ac/protocol_non_nasa.cpp | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/components/samsung_ac/protocol_non_nasa.cpp b/components/samsung_ac/protocol_non_nasa.cpp index 551d9246..a8acfb3b 100644 --- a/components/samsung_ac/protocol_non_nasa.cpp +++ b/components/samsung_ac/protocol_non_nasa.cpp @@ -130,6 +130,15 @@ namespace esphome commandC6.control_status = data[4]; return DecodeResult::Ok; } + case NonNasaCommand::CmdF3: // power consumption + { + commandF3.inverter_max_frequency = data[4]; + commandF3.inverter_total_capacity_requirement = (float)data[5] / 10; + commandF3.inverter_current = (float)data[8] / 10; + commandF3.inverter_voltage = (float)data[9] * 2; + commandF3.inverter_power = inverter_current * inverter_voltage; + return DecodeResult::Ok; + } default: { commandRaw.length = data.size() - 4 - 1; From 2b7c73508251bc0b87ff54d66d04d295c3626b77 Mon Sep 17 00:00:00 2001 From: matthias882 <30553262+matthias882@users.noreply.github.com> Date: Tue, 6 Feb 2024 07:40:23 +0100 Subject: [PATCH 05/14] Update protocol_non_nasa.h --- components/samsung_ac/protocol_non_nasa.h | 1 + 1 file changed, 1 insertion(+) diff --git a/components/samsung_ac/protocol_non_nasa.h b/components/samsung_ac/protocol_non_nasa.h index 91535e56..2137e1d8 100644 --- a/components/samsung_ac/protocol_non_nasa.h +++ b/components/samsung_ac/protocol_non_nasa.h @@ -68,6 +68,7 @@ namespace esphome float inverter_total_capacity_requirement = 0; float inverter_current = 0; float inverter_voltage = 0; + float inverter_power = 0; std::string to_string(); }; From e7002f6679267baf617157c1a75484744c7f2c66 Mon Sep 17 00:00:00 2001 From: matthias882 <30553262+matthias882@users.noreply.github.com> Date: Tue, 6 Feb 2024 08:10:13 +0100 Subject: [PATCH 06/14] Update protocol_non_nasa.cpp --- components/samsung_ac/protocol_non_nasa.cpp | 1 + 1 file changed, 1 insertion(+) diff --git a/components/samsung_ac/protocol_non_nasa.cpp b/components/samsung_ac/protocol_non_nasa.cpp index a8acfb3b..aee2d899 100644 --- a/components/samsung_ac/protocol_non_nasa.cpp +++ b/components/samsung_ac/protocol_non_nasa.cpp @@ -46,6 +46,7 @@ namespace esphome str += "inverter_total_capacity_requirement[kW]:" + std::to_string(inverter_total_capacity_requirement) + ";"; str += "inverter_current[ADC]:" + std::to_string(inverter_current) + ";"; str += "inverter_voltage[VDC]:" + std::to_string(inverter_voltage) + ";"; + str += "inverter_voltage[W]:" + std::to_string(inverter_power) + ";"; return str; } From 2e7bf66759d47c0bb6571c2a98a03b6ae6155ade Mon Sep 17 00:00:00 2001 From: matthias882 <30553262+matthias882@users.noreply.github.com> Date: Tue, 6 Feb 2024 08:11:48 +0100 Subject: [PATCH 07/14] Update protocol_non_nasa.cpp --- components/samsung_ac/protocol_non_nasa.cpp | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/components/samsung_ac/protocol_non_nasa.cpp b/components/samsung_ac/protocol_non_nasa.cpp index aee2d899..67097ef1 100644 --- a/components/samsung_ac/protocol_non_nasa.cpp +++ b/components/samsung_ac/protocol_non_nasa.cpp @@ -69,6 +69,11 @@ namespace esphome str += "commandC6:{" + commandC6.to_string() + "}"; break; } + case NonNasaCommand::CmdF3: + { + str += "commandF3:{" + commandF3.to_string() + "}"; + break; + } case NonNasaCommand::CmdF8: { str += "commandF8:{" + commandF8.to_string() + "}"; From d52fec1b65fc4bb4449e4639add6f5f5915f8df3 Mon Sep 17 00:00:00 2001 From: matthias882 <30553262+matthias882@users.noreply.github.com> Date: Tue, 6 Feb 2024 08:14:13 +0100 Subject: [PATCH 08/14] Update protocol_non_nasa.cpp --- components/samsung_ac/protocol_non_nasa.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/components/samsung_ac/protocol_non_nasa.cpp b/components/samsung_ac/protocol_non_nasa.cpp index 67097ef1..62aa9bfe 100644 --- a/components/samsung_ac/protocol_non_nasa.cpp +++ b/components/samsung_ac/protocol_non_nasa.cpp @@ -142,7 +142,7 @@ namespace esphome commandF3.inverter_total_capacity_requirement = (float)data[5] / 10; commandF3.inverter_current = (float)data[8] / 10; commandF3.inverter_voltage = (float)data[9] * 2; - commandF3.inverter_power = inverter_current * inverter_voltage; + commandF3.inverter_power = commandF3.inverter_current * commandF3.inverter_voltage; return DecodeResult::Ok; } default: From fbc20a33224a80712221aaceb90e115c71c9639c Mon Sep 17 00:00:00 2001 From: matthias882 <30553262+matthias882@users.noreply.github.com> Date: Tue, 6 Feb 2024 08:16:35 +0100 Subject: [PATCH 09/14] Update protocol_non_nasa.cpp --- components/samsung_ac/protocol_non_nasa.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/components/samsung_ac/protocol_non_nasa.cpp b/components/samsung_ac/protocol_non_nasa.cpp index 62aa9bfe..03c5f994 100644 --- a/components/samsung_ac/protocol_non_nasa.cpp +++ b/components/samsung_ac/protocol_non_nasa.cpp @@ -46,7 +46,7 @@ namespace esphome str += "inverter_total_capacity_requirement[kW]:" + std::to_string(inverter_total_capacity_requirement) + ";"; str += "inverter_current[ADC]:" + std::to_string(inverter_current) + ";"; str += "inverter_voltage[VDC]:" + std::to_string(inverter_voltage) + ";"; - str += "inverter_voltage[W]:" + std::to_string(inverter_power) + ";"; + str += "inverter_power[W]:" + std::to_string(inverter_power) + ";"; return str; } From baaf14a42c9da9e85f7280d110690945c4f9fd41 Mon Sep 17 00:00:00 2001 From: matthias882 <30553262+matthias882@users.noreply.github.com> Date: Tue, 6 Feb 2024 12:57:13 +0100 Subject: [PATCH 10/14] some comments to the units --- components/samsung_ac/protocol_non_nasa.cpp | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/components/samsung_ac/protocol_non_nasa.cpp b/components/samsung_ac/protocol_non_nasa.cpp index 03c5f994..7f5d37ae 100644 --- a/components/samsung_ac/protocol_non_nasa.cpp +++ b/components/samsung_ac/protocol_non_nasa.cpp @@ -138,11 +138,11 @@ namespace esphome } case NonNasaCommand::CmdF3: // power consumption { - commandF3.inverter_max_frequency = data[4]; - commandF3.inverter_total_capacity_requirement = (float)data[5] / 10; - commandF3.inverter_current = (float)data[8] / 10; - commandF3.inverter_voltage = (float)data[9] * 2; - commandF3.inverter_power = commandF3.inverter_current * commandF3.inverter_voltage; + commandF3.inverter_max_frequency = data[4]; // Maximum frequency for Inverter (compressor-motor of outdoor-unit) in Hz + commandF3.inverter_total_capacity_requirement = (float)data[5] / 10; // Sum of required heating/cooling capacity ordered by the indoor-units in W + commandF3.inverter_current = (float)data[8] / 10; // DC-current to the inverter of outdoor-unit in A + commandF3.inverter_voltage = (float)data[9] * 2; // voltage of the DC-link to inverter in V + commandF3.inverter_power = commandF3.inverter_current * commandF3.inverter_voltage; //Power consumption of the outdoo unit inverter in W return DecodeResult::Ok; } default: From d0254eb7895d816db7ccf2784aa3f2e728be92a4 Mon Sep 17 00:00:00 2001 From: matthias882 <30553262+matthias882@users.noreply.github.com> Date: Tue, 6 Feb 2024 17:19:56 +0100 Subject: [PATCH 11/14] rename_values --- components/samsung_ac/protocol_non_nasa.cpp | 25 ++++++++++++--------- 1 file changed, 15 insertions(+), 10 deletions(-) diff --git a/components/samsung_ac/protocol_non_nasa.cpp b/components/samsung_ac/protocol_non_nasa.cpp index 7f5d37ae..5ea60795 100644 --- a/components/samsung_ac/protocol_non_nasa.cpp +++ b/components/samsung_ac/protocol_non_nasa.cpp @@ -42,11 +42,11 @@ namespace esphome std::string NonNasaCommandF3::to_string() { std::string str; - str += "inverter_max_frequency[Hz]:" + std::to_string(inverter_max_frequency) + ";"; - str += "inverter_total_capacity_requirement[kW]:" + std::to_string(inverter_total_capacity_requirement) + ";"; - str += "inverter_current[ADC]:" + std::to_string(inverter_current) + ";"; - str += "inverter_voltage[VDC]:" + std::to_string(inverter_voltage) + ";"; - str += "inverter_power[W]:" + std::to_string(inverter_power) + ";"; + str += "inverter_max_frequency[Hz]:" + std::to_string(inverter_max_frequency_hz) + ";"; + str += "inverter_total_capacity_requirement[kW]:" + std::to_string(inverter_total_capacity_requirement_w) + ";"; + str += "inverter_current[ADC]:" + std::to_string(inverter_current_a) + ";"; + str += "inverter_voltage[VDC]:" + std::to_string(inverter_voltage_v) + ";"; + str += "inverter_power[W]:" + std::to_string(inverter_power_w) + ";"; return str; } @@ -138,11 +138,16 @@ namespace esphome } case NonNasaCommand::CmdF3: // power consumption { - commandF3.inverter_max_frequency = data[4]; // Maximum frequency for Inverter (compressor-motor of outdoor-unit) in Hz - commandF3.inverter_total_capacity_requirement = (float)data[5] / 10; // Sum of required heating/cooling capacity ordered by the indoor-units in W - commandF3.inverter_current = (float)data[8] / 10; // DC-current to the inverter of outdoor-unit in A - commandF3.inverter_voltage = (float)data[9] * 2; // voltage of the DC-link to inverter in V - commandF3.inverter_power = commandF3.inverter_current * commandF3.inverter_voltage; //Power consumption of the outdoo unit inverter in W + // Maximum frequency for Inverter (compressor-motor of outdoor-unit) in Hz + commandF3.inverter_max_frequency_hz = data[4]; + // Sum of required heating/cooling capacity ordered by the indoor-units in W + commandF3.inverter_total_capacity_requirement_w = (float)data[5] / 10; + // DC-current to the inverter of outdoor-unit in A + commandF3.inverter_current_a = (float)data[8] / 10; + // voltage of the DC-link to inverter in V + commandF3.inverter_voltage_v = (float)data[9] * 2; + //Power consumption of the outdoo unit inverter in W + commandF3.inverter_power_w = commandF3.inverter_current_a * commandF3.inverter_voltage_v; return DecodeResult::Ok; } default: From b780a7942f8e40cafa04b0b0af3cfcc84479446e Mon Sep 17 00:00:00 2001 From: matthias882 <30553262+matthias882@users.noreply.github.com> Date: Tue, 6 Feb 2024 17:29:17 +0100 Subject: [PATCH 12/14] Update protocol_non_nasa.cpp --- components/samsung_ac/protocol_non_nasa.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/components/samsung_ac/protocol_non_nasa.cpp b/components/samsung_ac/protocol_non_nasa.cpp index 5ea60795..4920304a 100644 --- a/components/samsung_ac/protocol_non_nasa.cpp +++ b/components/samsung_ac/protocol_non_nasa.cpp @@ -43,7 +43,7 @@ namespace esphome { std::string str; str += "inverter_max_frequency[Hz]:" + std::to_string(inverter_max_frequency_hz) + ";"; - str += "inverter_total_capacity_requirement[kW]:" + std::to_string(inverter_total_capacity_requirement_w) + ";"; + str += "inverter_total_capacity_requirement[kW]:" + std::to_string(inverter_total_capacity_requirement_kw) + ";"; str += "inverter_current[ADC]:" + std::to_string(inverter_current_a) + ";"; str += "inverter_voltage[VDC]:" + std::to_string(inverter_voltage_v) + ";"; str += "inverter_power[W]:" + std::to_string(inverter_power_w) + ";"; @@ -140,7 +140,7 @@ namespace esphome { // Maximum frequency for Inverter (compressor-motor of outdoor-unit) in Hz commandF3.inverter_max_frequency_hz = data[4]; - // Sum of required heating/cooling capacity ordered by the indoor-units in W + // Sum of required heating/cooling capacity ordered by the indoor-units in kW commandF3.inverter_total_capacity_requirement_w = (float)data[5] / 10; // DC-current to the inverter of outdoor-unit in A commandF3.inverter_current_a = (float)data[8] / 10; From 51a2416ce11e99a62d3f4ce25c78f923f0e4e978 Mon Sep 17 00:00:00 2001 From: matthias882 <30553262+matthias882@users.noreply.github.com> Date: Tue, 6 Feb 2024 17:30:12 +0100 Subject: [PATCH 13/14] Update protocol_non_nasa.cpp --- components/samsung_ac/protocol_non_nasa.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/components/samsung_ac/protocol_non_nasa.cpp b/components/samsung_ac/protocol_non_nasa.cpp index 4920304a..334fb38c 100644 --- a/components/samsung_ac/protocol_non_nasa.cpp +++ b/components/samsung_ac/protocol_non_nasa.cpp @@ -141,7 +141,7 @@ namespace esphome // Maximum frequency for Inverter (compressor-motor of outdoor-unit) in Hz commandF3.inverter_max_frequency_hz = data[4]; // Sum of required heating/cooling capacity ordered by the indoor-units in kW - commandF3.inverter_total_capacity_requirement_w = (float)data[5] / 10; + commandF3.inverter_total_capacity_requirement_kw = (float)data[5] / 10; // DC-current to the inverter of outdoor-unit in A commandF3.inverter_current_a = (float)data[8] / 10; // voltage of the DC-link to inverter in V From 2665a761678201c01dc02f9c1b833329be4cb44e Mon Sep 17 00:00:00 2001 From: matthias882 <30553262+matthias882@users.noreply.github.com> Date: Tue, 6 Feb 2024 17:31:13 +0100 Subject: [PATCH 14/14] Update protocol_non_nasa.h --- components/samsung_ac/protocol_non_nasa.h | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/components/samsung_ac/protocol_non_nasa.h b/components/samsung_ac/protocol_non_nasa.h index 2137e1d8..fcb8e1ab 100644 --- a/components/samsung_ac/protocol_non_nasa.h +++ b/components/samsung_ac/protocol_non_nasa.h @@ -64,11 +64,11 @@ namespace esphome struct NonNasaCommandF3 { - uint8_t inverter_max_frequency = 0; - float inverter_total_capacity_requirement = 0; - float inverter_current = 0; - float inverter_voltage = 0; - float inverter_power = 0; + uint8_t inverter_max_frequency_hz = 0; + float inverter_total_capacity_requirement_kw = 0; + float inverter_current_a = 0; + float inverter_voltage_v = 0; + float inverter_power_w = 0; std::string to_string(); };