From 60c51cce0d64cfbe6a7ec5da3e51bca4b314d15e Mon Sep 17 00:00:00 2001 From: ndrsnhs Date: Wed, 20 May 2026 14:55:17 +0200 Subject: [PATCH 1/2] adjust frequency --- packages/modules/devices/sungrow/sungrow_sh/counter.py | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/packages/modules/devices/sungrow/sungrow_sh/counter.py b/packages/modules/devices/sungrow/sungrow_sh/counter.py index f7b37254a3..818dc12021 100644 --- a/packages/modules/devices/sungrow/sungrow_sh/counter.py +++ b/packages/modules/devices/sungrow/sungrow_sh/counter.py @@ -47,8 +47,11 @@ def update(self): self.fault_state.no_error(self.fault_text) frequency = self.__tcp_client.read_input_registers(5035, ModbusDataType.UINT_16, unit=unit) / 10 - if self.device_config.configuration.version == Version.SH_winet_dongle: - # On WiNet-S, the frequency accuracy is higher by one place + if self.device_config.configuration.version == Version.SH_winet_dongle and frequency > 400: + # On WiNet-S, the frequency accuracy is sometimes higher by one place + # For some SDongle Firmware Versions it is not. Frequency should roughly + # range between 40 and 60. Therefore, if the value is above 400, we assume + # it is actually 10 times higher than it should be and adjust it accordingly. frequency /= 10 power_factor = self.__tcp_client.read_input_registers(5034, ModbusDataType.INT_16, unit=unit) / 1000 From d497870fd013541f3146598e4306369a96e74360 Mon Sep 17 00:00:00 2001 From: ndrsnhs Date: Wed, 20 May 2026 15:09:41 +0200 Subject: [PATCH 2/2] remove whitespace --- packages/modules/devices/sungrow/sungrow_sh/counter.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/packages/modules/devices/sungrow/sungrow_sh/counter.py b/packages/modules/devices/sungrow/sungrow_sh/counter.py index 818dc12021..68e8d3596c 100644 --- a/packages/modules/devices/sungrow/sungrow_sh/counter.py +++ b/packages/modules/devices/sungrow/sungrow_sh/counter.py @@ -47,11 +47,11 @@ def update(self): self.fault_state.no_error(self.fault_text) frequency = self.__tcp_client.read_input_registers(5035, ModbusDataType.UINT_16, unit=unit) / 10 - if self.device_config.configuration.version == Version.SH_winet_dongle and frequency > 400: + if self.device_config.configuration.version == Version.SH_winet_dongle and frequency >= 400: # On WiNet-S, the frequency accuracy is sometimes higher by one place # For some SDongle Firmware Versions it is not. Frequency should roughly # range between 40 and 60. Therefore, if the value is above 400, we assume - # it is actually 10 times higher than it should be and adjust it accordingly. + # it is actually 10 times higher than it should be and adjust it accordingly. frequency /= 10 power_factor = self.__tcp_client.read_input_registers(5034, ModbusDataType.INT_16, unit=unit) / 1000