Skip to content

Deye LSW-Dongle (pysolarman)#3307

Merged
LKuemmel merged 5 commits into
openWB:masterfrom
ndrsnhs:deye-pysolarman
Jun 3, 2026
Merged

Deye LSW-Dongle (pysolarman)#3307
LKuemmel merged 5 commits into
openWB:masterfrom
ndrsnhs:deye-pysolarman

Conversation

@ndrsnhs

@ndrsnhs ndrsnhs commented Apr 20, 2026

Copy link
Copy Markdown
Contributor

UI: openWB/openwb-ui-settings#963

Ticket #66002706
Deye bietet 2 unterschiedliche Dongles für die Modbus Kommunikation an: LSW (Wifi) und LSE (Lan).
Der LSW nutzt das proprietäre Pysolarman Protokoll - ist ansonsten aber identisch.

Zur Kommunikation wird folgendes Modul genutzt:
https://github.com/jmccrohan/pysolarmanv5

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Adds support for the Deye LSW (WiFi) dongle variant that communicates via the proprietary “pysolarman” protocol (via pysolarmanv5), by introducing a new deye_solarman device implementation alongside the existing deye Modbus device.

Changes:

  • Add pysolarmanv5 as a pinned dependency.
  • Introduce a new deye_solarman device module (device + inverter/counter/battery components).
  • Add a DeviceType enum used to branch register mappings by inverter model type.

Reviewed changes

Copilot reviewed 6 out of 7 changed files in this pull request and generated 3 comments.

Show a summary per file
File Description
requirements.txt Adds pysolarmanv5 dependency needed for LSW dongle communications.
packages/modules/devices/deye/deye_solarman/device.py Wires up PySolarmanV5 client creation and component update loop for the new device type.
packages/modules/devices/deye/deye_solarman/config.py Adds configuration objects for the new device type (IP/serial/port/modbus_id) and component setup shells.
packages/modules/devices/deye/deye_solarman/device_type.py Defines supported device type IDs used by component logic.
packages/modules/devices/deye/deye_solarman/inverter.py Implements inverter power reading via Solarman client registers.
packages/modules/devices/deye/deye_solarman/counter.py Implements counter readings (currents/voltages/power/frequency) via Solarman registers.
packages/modules/devices/deye/deye_solarman/bat.py Implements battery power/SOC readings via Solarman registers.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

from modules.common.component_state import CounterState
from modules.common.component_type import ComponentDescriptor
from modules.common.fault_state import ComponentInfo, FaultState
# from modules.common.modbus import ModbusDataType

Copilot AI Apr 20, 2026

Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

There is a commented-out import (# from modules.common.modbus import ModbusDataType) left in the file. Please remove it to avoid dead code and keep the module clean.

Suggested change
# from modules.common.modbus import ModbusDataType

Copilot uses AI. Check for mistakes.
class DeyeSolarmanConfiguration:
def __init__(self,
ip_address: Optional[str] = None,
serial: int = None,

Copilot AI Apr 20, 2026

Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

serial is annotated as int but defaults to None. This is inconsistent with the type hint and makes static analysis / IDE assistance inaccurate. Consider changing it to Optional[int] (and/or validating that a serial is provided before creating the client).

Suggested change
serial: int = None,
serial: Optional[int] = None,

Copilot uses AI. Check for mistakes.
Comment thread packages/modules/devices/deye/deye_solarman/counter.py Outdated
@LKuemmel LKuemmel added this to the 2.2.1 milestone May 19, 2026
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
@LKuemmel LKuemmel merged commit 9e89de8 into openWB:master Jun 3, 2026
1 check passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants