Code Monkey home page Code Monkey logo

deye-controller's Introduction

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
  • Tested with:
    • SUN-12K-SG04LP3 / LSW-3

TODO List

  • Support for writing to all registers

Examples

  • 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 %
    • 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
  • 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

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.

deye-controller's People

Contributors

githubdante avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.