From e584d320370432a5e292be1f1032ac74ba5e0007 Mon Sep 17 00:00:00 2001 From: KM011092 Date: Fri, 19 Apr 2024 11:41:43 +0200 Subject: [PATCH] Additional EP600 values Added Consumption and Grid, Consumption and Solar in Totals --- .idea/.gitignore | 3 +++ .idea/hassio-bluetti-bt-KM1.iml | 12 +++++++++++ .../inspectionProfiles/profiles_settings.xml | 6 ++++++ .idea/misc.xml | 7 +++++++ .idea/modules.xml | 8 +++++++ .idea/vcs.xml | 6 ++++++ .../bluetti_bt_lib/devices/ep600.py | 21 +++++++++++++++++++ .../bluetti_bt_lib/field_attributes.py | 20 ++++++++++++++++++ 8 files changed, 83 insertions(+) create mode 100644 .idea/.gitignore create mode 100644 .idea/hassio-bluetti-bt-KM1.iml create mode 100644 .idea/inspectionProfiles/profiles_settings.xml create mode 100644 .idea/misc.xml create mode 100644 .idea/modules.xml create mode 100644 .idea/vcs.xml diff --git a/.idea/.gitignore b/.idea/.gitignore new file mode 100644 index 0000000..26d3352 --- /dev/null +++ b/.idea/.gitignore @@ -0,0 +1,3 @@ +# Default ignored files +/shelf/ +/workspace.xml diff --git a/.idea/hassio-bluetti-bt-KM1.iml b/.idea/hassio-bluetti-bt-KM1.iml new file mode 100644 index 0000000..8b8c395 --- /dev/null +++ b/.idea/hassio-bluetti-bt-KM1.iml @@ -0,0 +1,12 @@ + + + + + + + + + + \ No newline at end of file diff --git a/.idea/inspectionProfiles/profiles_settings.xml b/.idea/inspectionProfiles/profiles_settings.xml new file mode 100644 index 0000000..105ce2d --- /dev/null +++ b/.idea/inspectionProfiles/profiles_settings.xml @@ -0,0 +1,6 @@ + + + + \ No newline at end of file diff --git a/.idea/misc.xml b/.idea/misc.xml new file mode 100644 index 0000000..a6218fe --- /dev/null +++ b/.idea/misc.xml @@ -0,0 +1,7 @@ + + + + + + \ No newline at end of file diff --git a/.idea/modules.xml b/.idea/modules.xml new file mode 100644 index 0000000..a13d29a --- /dev/null +++ b/.idea/modules.xml @@ -0,0 +1,8 @@ + + + + + + + + \ No newline at end of file diff --git a/.idea/vcs.xml b/.idea/vcs.xml new file mode 100644 index 0000000..35eb1dd --- /dev/null +++ b/.idea/vcs.xml @@ -0,0 +1,6 @@ + + + + + + \ No newline at end of file diff --git a/custom_components/bluetti_bt/bluetti_bt_lib/devices/ep600.py b/custom_components/bluetti_bt/bluetti_bt_lib/devices/ep600.py index c59485b..282d1f4 100644 --- a/custom_components/bluetti_bt/bluetti_bt_lib/devices/ep600.py +++ b/custom_components/bluetti_bt/bluetti_bt_lib/devices/ep600.py @@ -62,6 +62,22 @@ class EP600(ProtocolV2Device): self.struct.add_decimal_field("ac_output_current_phase2", 1519, 1) self.struct.add_decimal_field("ac_output_current_phase3", 1526, 1) + # KM - Consumption + self.struct.add_int_field("consumption_power_phase1", 1430) + self.struct.add_int_field("consumption_power_phase2", 1436) + self.struct.add_int_field("consumption_power_phase3", 1442) + self.struct.add_decimal_field("consumption_voltage_phase1", 1431, 1) + self.struct.add_decimal_field("consumption_voltage_phase2", 1437, 1) + self.struct.add_decimal_field("consumption_voltage_phase3", 1443, 1) + self.struct.add_decimal_field("consumption_current_phase1", 1432, 1) + self.struct.add_decimal_field("consumption_current_phase2", 1438, 1) + self.struct.add_decimal_field("consumption_current_phase3", 1444, 1) + + # KM - Totals + self.struct.add_uint_field('pv_input_power_all', 144) # Total PV in + self.struct.add_uint_field('consumption_power_all', 142) # Total AC out + self.struct.add_uint_field('grid_power_all', 146) # Total Grid in - value only +/- unknown + # Statistics self.struct.add_decimal_field( "total_ac_consumption", 152, 1 @@ -100,4 +116,9 @@ class EP600(ProtocolV2Device): ReadHoldingRegisters(152, 1), ReadHoldingRegisters(156, 1), ReadHoldingRegisters(158, 1), + # KM - Consumption + ReadHoldingRegisters(1430, 15), + # KM - Totals + ReadHoldingRegisters(142, 5), + ] diff --git a/custom_components/bluetti_bt/bluetti_bt_lib/field_attributes.py b/custom_components/bluetti_bt/bluetti_bt_lib/field_attributes.py index cac844c..db9707e 100644 --- a/custom_components/bluetti_bt/bluetti_bt_lib/field_attributes.py +++ b/custom_components/bluetti_bt/bluetti_bt_lib/field_attributes.py @@ -217,6 +217,26 @@ FIELD_ATTRIBUTES: dict[str, FieldAttributes] = { "total_ac_consumption": EnergyFieldAttributes("Total Load Consumption"), "total_grid_consumption": EnergyFieldAttributes("Total Grid Consumption"), "total_grid_feed": EnergyFieldAttributes("Total Grid Feed"), + + # KM - Consumption + "consumption_power_phase1": PowerFieldAttributes("Consumption Power Phase 1"), + "consumption_power_phase2": PowerFieldAttributes("Consumption Power Phase 2"), + "consumption_power_phase3": PowerFieldAttributes("Consumption Power Phase 3"), + "consumption_voltage_phase1": VoltageFieldAttributes("Consumption Voltage Phase 1"), + "consumption_voltage_phase2": VoltageFieldAttributes("Consumption Voltage Phase 2"), + "consumption_voltage_phase3": VoltageFieldAttributes("Consumption Voltage Phase 3"), + "consumption_current_phase1": CurrentFieldAttributes("Consumption Current Phase 1"), + "consumption_current_phase2": CurrentFieldAttributes("Consumption Current Phase 2"), + "consumption_current_phase3": CurrentFieldAttributes("Consumption Current Phase 3"), + # KM - Consumption end + + # KM - Totals + "pv_input_power_all": PowerFieldAttributes("PV Input Power All"), + "consumption_power_all": PowerFieldAttributes("Consumption Power All"), + "grid_power_all": PowerFieldAttributes("Grid Power All"), + # KM - Totals end + + # Device specific controls "power_off": FieldAttributes( type=FieldType.BOOL,