Skip to main content

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

Project description

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()

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

growattRS232-1.0.0.tar.gz (8.2 kB view details)

Uploaded Source

Built Distribution

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

growattRS232-1.0.0-py3-none-any.whl (7.3 kB view details)

Uploaded Python 3

File details

Details for the file growattRS232-1.0.0.tar.gz.

File metadata

  • Download URL: growattRS232-1.0.0.tar.gz
  • Upload date:
  • Size: 8.2 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.2.0 pkginfo/1.5.0.1 requests/2.24.0 setuptools/41.2.0 requests-toolbelt/0.9.1 tqdm/4.47.0 CPython/3.8.3

File hashes

Hashes for growattRS232-1.0.0.tar.gz
Algorithm Hash digest
SHA256 8715d84a3a3f3195b248cec60d4edc71939c7f9eccfdbba8a364fad5472c56a3
MD5 9781f89a51e089e04dd82f16cbc6fa70
BLAKE2b-256 b8b8f9542a0cb075dfb8542038f068e7fd1948921780ca5f34ddd20438e608f9

See more details on using hashes here.

File details

Details for the file growattRS232-1.0.0-py3-none-any.whl.

File metadata

  • Download URL: growattRS232-1.0.0-py3-none-any.whl
  • Upload date:
  • Size: 7.3 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.2.0 pkginfo/1.5.0.1 requests/2.24.0 setuptools/41.2.0 requests-toolbelt/0.9.1 tqdm/4.47.0 CPython/3.8.3

File hashes

Hashes for growattRS232-1.0.0-py3-none-any.whl
Algorithm Hash digest
SHA256 810673e0a248167c8b40aed0ed6893563181ed82e3c659b718571c18084d016c
MD5 eebe99ed5e47d67f8758d96964b4dd47
BLAKE2b-256 17690adea288b5b54dd4bb092296059711f223f2a048a0ab70458bff2e2e5490

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