Skip to content

Commit

Permalink
Update deye (#1691)
Browse files Browse the repository at this point in the history
* fix power factors and registers

* change ModbusDataType fo frequency
  • Loading branch information
ndrsnhs authored Jun 25, 2024
1 parent 5816075 commit 926bca8
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 4 deletions.
2 changes: 1 addition & 1 deletion packages/modules/devices/deye/bat.py
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ def update(self, client: ModbusTcpClient_, device_type: DeviceType) -> None:
unit = self.component_config.configuration.modbus_id

if device_type == DeviceType.THREE_PHASE:
power = client.read_holding_registers(590, ModbusDataType.INT_16, unit=unit) * -1
power = client.read_holding_registers(590, ModbusDataType.INT_16, unit=unit) * -10
soc = client.read_holding_registers(588, ModbusDataType.INT_16, unit=unit)
# 516: Geladen in kWh * 0,1
imported = client.read_holding_registers(516, ModbusDataType.UINT_16, unit=unit) * 100
Expand Down
4 changes: 2 additions & 2 deletions packages/modules/devices/deye/counter.py
Original file line number Diff line number Diff line change
Expand Up @@ -25,8 +25,8 @@ def update(self, client: ModbusTcpClient_, device_type: DeviceType):
currents = [c / 100 for c in client.read_holding_registers(613, [ModbusDataType.INT_16]*3, unit=unit)]
voltages = [v / 10 for v in client.read_holding_registers(644, [ModbusDataType.INT_16]*3, unit=unit)]
powers = client.read_holding_registers(616, [ModbusDataType.INT_16]*3, unit=unit)
power = sum(powers)
frequency = client.read_holding_registers(187, ModbusDataType.INT_32, unit=unit) * 100
power = client.read_holding_registers(625, ModbusDataType.INT_16, unit=unit)
frequency = client.read_holding_registers(609, ModbusDataType.INT_16, unit=unit) / 100

# Wenn der Import/export Netz in wh gerechnet wird => *100 !! kommt in kw/h *0.1
imported = client.read_holding_registers(522, ModbusDataType.INT_16, unit=unit) * 100
Expand Down
2 changes: 1 addition & 1 deletion packages/modules/devices/deye/inverter.py
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ def update(self, client: ModbusTcpClient_, device_type: DeviceType) -> None:

if device_type == DeviceType.THREE_PHASE:
# Wechselrichter hat 2 mppt Tracker
power = sum(client.read_holding_registers(672, [ModbusDataType.INT_16]*2, unit=unit)) * -1
power = sum(client.read_holding_registers(672, [ModbusDataType.INT_16]*2, unit=unit)) * -10
# 534: Gesamt Produktion Wechselrichter unsigned integer in kWh * 0,1
exported = client.read_holding_registers(534, ModbusDataType.UINT_16, unit=unit) * 100
elif device_type == DeviceType.SINGLE_PHASE_STRING or device_type == DeviceType.SINGLE_PHASE_HYBRID:
Expand Down

0 comments on commit 926bca8

Please sign in to comment.