diff --git a/components/samsung_ac/protocol_non_nasa.cpp b/components/samsung_ac/protocol_non_nasa.cpp index 90f88437..334fb38c 100644 --- a/components/samsung_ac/protocol_non_nasa.cpp +++ b/components/samsung_ac/protocol_non_nasa.cpp @@ -39,6 +39,17 @@ namespace esphome return str; } + std::string NonNasaCommandF3::to_string() + { + 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_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) + ";"; + return str; + } + std::string NonNasaDataPacket::to_string() { std::string str; @@ -58,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() + "}"; @@ -120,6 +136,20 @@ namespace esphome commandC6.control_status = data[4]; return DecodeResult::Ok; } + case NonNasaCommand::CmdF3: // power consumption + { + // 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_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 + 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: { commandRaw.length = data.size() - 4 - 1; diff --git a/components/samsung_ac/protocol_non_nasa.h b/components/samsung_ac/protocol_non_nasa.h index c176d7fc..b411eb77 100644 --- a/components/samsung_ac/protocol_non_nasa.h +++ b/components/samsung_ac/protocol_non_nasa.h @@ -62,6 +62,18 @@ namespace esphome }; }; + struct NonNasaCommandF3 + { + 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(); + }; + + struct NonNasaCommandRaw { uint8_t length; @@ -78,6 +90,7 @@ namespace esphome { Cmd20 = 0x20, CmdC6 = 0xc6, + CmdF3 = 0xf3, CmdF8 = 0xF8, }; @@ -96,6 +109,7 @@ namespace esphome { NonNasaCommand20 command20; NonNasaCommandC6 commandC6; + NonNasaCommandF3 commandF3; NonNasaCommandRaw commandF8; // Unknown structure for now NonNasaCommandRaw commandRaw; };