Coder Social home page Coder Social logo

huynguyenau / growattrs232 Goto Github PK

View Code? Open in Web Editor NEW

This project forked from ardescoconsulting/growattrs232

0.0 1.0 0.0 73 KB

Python wrapper for getting data asynchonously from Growatt inverters via serial usb RS232 connection and modbus RTU protocol.

License: MIT License

Python 93.29% Dockerfile 6.71%

growattrs232's Introduction

growattRS232

PyPI GitHub issues

Python wrapper for getting data asynchronously from Growatt inverters via serial usb RS232 connection and modbus RTU protocol.

The Growatt inverted must support the modbus protocol (some older inverters only support proprietary serial communication) Connect the RS232 DB9 usb adapter to the RS232 port on the underside of the inverter (you might have to remove a cover plate).

Attributes

Depending on the firmware version of your inverter, not all attributes might be available

Inverter properties

  • serial_number
  • model_number
  • firmware

DC input PV

  • input_power
  • input_energy_today

DC input string 1 PV

  • input_1_amperage
  • input_1_voltage
  • input_1_power
  • input_1_energy_today
  • input_1_energy_total

DC input string 2 PV

  • input_2_amperage
  • input_2_voltage"
  • input_2_power"
  • input_2_energy_today"
  • input_2_energy_total"

AC output grid

  • output_power
  • output_energy_today
  • output_energy_total
  • power_factor
  • output_reactive_power
  • output_reactive_energy_today
  • output_reactive_energy_total

AC output phase 1 grid

  • output_1_voltage
  • output_1_amperage
  • output_1_power

AC output phase 2 grid

  • output_2_voltage
  • output_2_amperage
  • output_2_power

AC output phase 3 grid

  • output_3_voltage
  • output_3_amperage
  • output_3_power

Miscellaneous information

  • operation_hours
  • frequency
  • temperature
  • ipm_temperature
  • p_bus_voltage
  • n_bus_voltage
  • derating_mode
  • derating

Status, faults & warnings

  • status
  • status_code
  • fault_code
  • fault
  • warning_code
  • warning_value
  • warning

How to use the package

import asyncio
import logging
from sys import argv

from growattRS232 import GrowattRS232

# defaults
# USB port of RS232 converter
DEFAULT_PORT = "/dev/ttyUSB0"
# Growatt modbus address
DEFAULT_ADDRESS = 0x1

logging.basicConfig(level=logging.DEBUG)


async def main():
    port = str(argv[1]) if len(argv) > 1 else DEFAULT_PORT
    address = int(argv[2]) if len(argv) > 2 else DEFAULT_ADDRESS
    growattRS232 = GrowattRS232(port, address)
    try:
        data = await growattRS232.async_update()
        print(f"Sensors data: {data}")
    except Exception as error:
        print("Error: " + repr(error))


loop = asyncio.get_event_loop()
loop.run_until_complete(main())
loop.close()

growattrs232's People

Contributors

ardescoconsulting avatar

Watchers

James Cloos 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.