Skip to main content

MODBUS Controller for DEYE inverters

Project description

DEYE-controller

  • A library and simple tools for interaction with DEYE hybrid inverters

  • The communication with the inverter requires a SOLARMAN datalogger

  • pysloarmanv5 based library

  • Command line tools (exposed after install):
    • deye-read - read everything from the inverter (use –help for filters/options)

    • deye-regcheck - for quick check on specific register(s)

    • deye-scan is a scanner for dataloggers in the local network (not DEYE related)

    • deye-regwrite - for writing to individual registers

  • Monkey patching:
    • direct value assignment on read for the Register and RegistersGroup types (see the examples dir)

  • Tested with:
    • SUN-12K-SG04LP3 / LSW-3

INSTALL

pip install deye-controller

TODO List

  • Support single phase inverters, eventually with auto detection.

Examples

  • After version 0.2.0 PySolarmanV5 can be patched for even easier reading see here

  • Basic usage:

    • read a register from the inverter

    >>> from deye_controller import HoldingRegisters, WritableRegisters
    >>> from pysolarmanv5 import PySolarmanV5
    >>> inv = PySolarmanV5('192.168.1.100', 2712345678)
    >>> register = HoldingRegisters.BMSBatteryCapacity
    >>> res = inv.read_holding_registers(register.address, register.len)
    >>> register.value = res[0] if register.len == 1 else res
    >>> print(register.description, register.format(), register.suffix)
    bms_battery_SOC 24 %
    >>> inv.disconnect()
    • write

    >>> from deye_controller import HoldingRegisters, WritableRegisters
    >>> from pysolarmanv5 import PySolarmanV5
    >>> inv = PySolarmanV5('192.168.1.100', 2712345678)
    >>> register = WritableRegisters.SellModeSOC3
    >>> register.set(23)
    
    >>> inv.write_multiple_holding_registers(register.address, [register.modbus_value])
    1
    >>> inv.disconnect()
  • SellMode programming:

    >>> from deye_controller import SellProgrammer
    >>> prog = SellProgrammer('192.168.1.108', 2799999999)
    >>> prog.show_as_screen()
    ____________________________________________________
    | Grid  |  Gen  |      Time     |   Pwr    |  SOC % |
    |       |       | 00:00 | 03:00 |     3500 |   100% |
    |       |       | 03:00 | 04:00 |     3500 |    30% |
    |       |       | 04:00 | 05:00 |     3500 |    30% |
    |       |       | 05:00 | 10:00 |     3500 |    30% |
    |       |       | 10:00 | 23:00 |     3500 |   100% |
    |       |       | 23:00 | 00:00 |     3500 |    30% |
    ----------------------------------------------------
    >>> prog.update_program(3, start_t='6:30', power=2500, soc=35, grid_ch=True)
    Program updated
     >>> prog.show_as_screen()  # For visual confirmation of the settings
    ____________________________________________________
    | Grid  |  Gen  |      Time     |   Pwr    |  SOC % |
    |       |       | 00:00 | 03:00 |     3500 |   100% |
    |       |       | 03:00 | 04:00 |     3500 |    30% |
    |       |       | 04:00 | 06:30 |     3500 |    30% |
    |      |       | 06:30 | 10:00 |     2500 |    35% |
    |       |       | 10:00 | 23:00 |     3500 |   100% |
    |       |       | 23:00 | 00:00 |     3500 |    30% |
    ----------------------------------------------------
    >>> prog.upload_settings()  # In order to upload the settings to the inverter
    >>> prog.disconnect()  # Needed if PySolarmanV5 >= 3.0.0

Notes

  • It is possible the inverter to be completely deactivated by writing 0 to register 80 WritableRegisters.SwitchOnOff.set(False) but it will raise an alarm and will show error F19. The normal state is restored as soon as the register is set to its default value 1.

  • The WritableRegisters.GridExportLimit register can be used if the grid export is not desired when the battery is charged and the PV generation exceeds the load.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

deye_controller-0.2.3.tar.gz (20.2 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

deye_controller-0.2.3-py3-none-any.whl (23.8 kB view details)

Uploaded Python 3

File details

Details for the file deye_controller-0.2.3.tar.gz.

File metadata

  • Download URL: deye_controller-0.2.3.tar.gz
  • Upload date:
  • Size: 20.2 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/2.1.4 CPython/3.13.7 Linux/6.15.9-lqx1-1-liquorix

File hashes

Hashes for deye_controller-0.2.3.tar.gz
Algorithm Hash digest
SHA256 1c97e4cacf13d2558d42e8a6f8f489a8a58f643e3fef62f3962e9271ab240af0
MD5 d79790103f421ddef498be6414de29d0
BLAKE2b-256 61c4e6fd2d058c6d6a36d2a07dadd8fe61699c92e09b6716cdf476af5c9413d9

See more details on using hashes here.

File details

Details for the file deye_controller-0.2.3-py3-none-any.whl.

File metadata

  • Download URL: deye_controller-0.2.3-py3-none-any.whl
  • Upload date:
  • Size: 23.8 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/2.1.4 CPython/3.13.7 Linux/6.15.9-lqx1-1-liquorix

File hashes

Hashes for deye_controller-0.2.3-py3-none-any.whl
Algorithm Hash digest
SHA256 ef45a1ae7bdeec1a752f800dc93cb343e48de697fdff73b00a3a20cf0e9b27e0
MD5 1dd41db96eb9f92076bbcc59036e2b1c
BLAKE2b-256 bbc33fd3f57d40d33bf7a73ac7fbda88d99b15fe9addbc9280daa1c4e452f186

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page