From cac64b40bdc7765e40b807aa4a3b193dd49d5755 Mon Sep 17 00:00:00 2001 From: Patrick762 Date: Sat, 17 Feb 2024 17:25:57 +0100 Subject: [PATCH] added power_generation to base devices --- .../bluetti_bt/bluetti_bt_lib/base_devices/ProtocolV1Device.py | 3 +++ .../bluetti_bt/bluetti_bt_lib/base_devices/ProtocolV2Device.py | 3 +++ 2 files changed, 6 insertions(+) diff --git a/custom_components/bluetti_bt/bluetti_bt_lib/base_devices/ProtocolV1Device.py b/custom_components/bluetti_bt/bluetti_bt_lib/base_devices/ProtocolV1Device.py index d70d667..d7e3670 100644 --- a/custom_components/bluetti_bt/bluetti_bt_lib/base_devices/ProtocolV1Device.py +++ b/custom_components/bluetti_bt/bluetti_bt_lib/base_devices/ProtocolV1Device.py @@ -21,6 +21,9 @@ class ProtocolV1Device(BluettiDevice): self.struct.add_uint_field('ac_output_power', 38) self.struct.add_uint_field('dc_output_power', 39) + # Power IO statistics + self.struct.add_decimal_field('power_generation', 41, 1) # Total power generated since last reset (kwh) + # Battery self.struct.add_uint_field('total_battery_percent', 43) diff --git a/custom_components/bluetti_bt/bluetti_bt_lib/base_devices/ProtocolV2Device.py b/custom_components/bluetti_bt/bluetti_bt_lib/base_devices/ProtocolV2Device.py index a3670ae..a6a87ca 100644 --- a/custom_components/bluetti_bt/bluetti_bt_lib/base_devices/ProtocolV2Device.py +++ b/custom_components/bluetti_bt/bluetti_bt_lib/base_devices/ProtocolV2Device.py @@ -21,6 +21,9 @@ class ProtocolV2Device(BluettiDevice): #self.struct.add_uint_field('ac_output_power', ?) #self.struct.add_uint_field('dc_output_power', ?) + # Power IO statistics + self.struct.add_decimal_field('power_generation', 154, 1) # Total power generated since last reset (kwh) + # Battery self.struct.add_uint_field('total_battery_percent', 102)