Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

FIX: Sungrow SG Problem 1+3 (siehe Issu) #2640

Closed
wants to merge 2 commits into from
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 8 additions & 3 deletions packages/modules/devices/sungrow/counter.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,8 @@
from modules.common.store import get_counter_value_store
from modules.devices.sungrow.config import SungrowCounterSetup
from modules.devices.sungrow.version import Version
from modules.devices.sungrow.inverter import power



class SungrowCounter:
Expand Down Expand Up @@ -38,10 +40,13 @@ def update(self):
# powers = [power / 10 for power in powers]
# log.info("power: " + str(power) + " powers?: " + str(powers))
else:
power = self.__tcp_client.read_input_registers(5082, ModbusDataType.INT_32,
if power != 0:
power = self.__tcp_client.read_input_registers(5082, ModbusDataType.INT_32,
wordorder=Endian.Little, unit=unit)
else:
power = self.__tcp_client.read_input_registers(5090, ModbusDataType.INT_32,
wordorder=Endian.Little, unit=unit)
if self.component_config.configuration.version == Version.SG_winet_dongle:
power = power * -1

# no valid data for powers per phase
# powers = self.__tcp_client.read_input_registers(5084, [ModbusDataType.UINT_16] * 3,
# wordorder=Endian.Little, unit=unit)
Expand Down