From 09cf4185b04677407abb58a1c219c707ecb80c18 Mon Sep 17 00:00:00 2001 From: ndrsnhs Date: Tue, 23 Jun 2026 08:53:48 +0200 Subject: [PATCH 1/2] read power direction --- packages/modules/devices/solis/solis/bat.py | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/packages/modules/devices/solis/solis/bat.py b/packages/modules/devices/solis/solis/bat.py index be88ab4059..ff38725634 100644 --- a/packages/modules/devices/solis/solis/bat.py +++ b/packages/modules/devices/solis/solis/bat.py @@ -41,7 +41,11 @@ def update(self) -> None: power = self.client.read_input_registers(33149, ModbusDataType.INT_32, unit=unit) soc = self.client.read_input_registers(33139, ModbusDataType.UINT_16, unit=unit) - bat_current = self.client.read_input_registers(33134, ModbusDataType.INT_16, unit=unit) * -0.1 + bat_current = self.client.read_input_registers(33134, ModbusDataType.INT_16, unit=unit) * 0.1 + current_direction = self.client.read_input_registers(33135, ModbusDataType.UINT_16, unit=unit) + if current_direction == 1: + bat_current = -bat_current + power = -power currents = [bat_current / 3] * 3 From 08c8a801d51ab8e25dfc54f0a24a8197803c245a Mon Sep 17 00:00:00 2001 From: ndrsnhs Date: Tue, 23 Jun 2026 09:05:19 +0200 Subject: [PATCH 2/2] remove whitespace --- packages/modules/devices/solis/solis/bat.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/modules/devices/solis/solis/bat.py b/packages/modules/devices/solis/solis/bat.py index ff38725634..499adb0223 100644 --- a/packages/modules/devices/solis/solis/bat.py +++ b/packages/modules/devices/solis/solis/bat.py @@ -42,7 +42,7 @@ def update(self) -> None: power = self.client.read_input_registers(33149, ModbusDataType.INT_32, unit=unit) soc = self.client.read_input_registers(33139, ModbusDataType.UINT_16, unit=unit) bat_current = self.client.read_input_registers(33134, ModbusDataType.INT_16, unit=unit) * 0.1 - current_direction = self.client.read_input_registers(33135, ModbusDataType.UINT_16, unit=unit) + current_direction = self.client.read_input_registers(33135, ModbusDataType.UINT_16, unit=unit) if current_direction == 1: bat_current = -bat_current power = -power