Skip to content

Commit

Permalink
fix SMA Inverter: energy is read via modbus twice, first requested va…
Browse files Browse the repository at this point in the history
…lue is ignored
  • Loading branch information
yankee42 committed Jul 25, 2022
1 parent 295784e commit 36cd5e8
Showing 1 changed file with 1 addition and 5 deletions.
6 changes: 1 addition & 5 deletions packages/modules/sma_sunny_boy/inverter.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
#!/usr/bin/env python3
from typing import Dict, Union
import logging
from typing import Dict, Union

from dataclass_utils import dataclass_from_dict
from modules.common import modbus
Expand All @@ -12,7 +12,6 @@
from modules.sma_sunny_boy.config import SmaSunnyBoyInverterSetup
from modules.sma_sunny_boy.inverter_version import SmaInverterVersion


log = logging.getLogger(__name__)


Expand Down Expand Up @@ -59,9 +58,6 @@ def read(self) -> InverterState:
else:
power_total = 0

# Gesamtertrag (Wh) [E-Total]
energy = self.__tcp_client.read_holding_registers(30529, ModbusDataType.UINT_32, unit=3)

return InverterState(
power=-max(power_total, 0),
exported=energy
Expand Down

0 comments on commit 36cd5e8

Please sign in to comment.