Skip to main content

goodwe-modbus

Python library to communicate with Goodwe inverters over Modbus.

Built on top of modbus-connection, a framework that maps Modbus register maps to typed Python objects.

Installation

pip install goodwe-modbus

Quick start

import asyncio
from modbus_connection import ModbusConnection, ModbusTcpParams
from goodwe_modbus import GoodweInverter

async def main():
    connection = ModbusConnection(
        ModbusTcpParams(host="10.0.0.234", port=502),
    )
    await connection.connect()
    try:
        unit = connection.for_unit(246)
        device = GoodweInverter(unit)
        await device.async_update()

        print(f"Serial: {device.identity.serial}")
        print(f"Model: {device.identity.type}")
        print(f"State: {device.state.system_state}")
        print(f"Grid power: {device.grid.power} W")
        print(f"Temperature: {device.state.inverter_temperature} C")
        print(f"Energy today: {device.energy.daily_energy} kWh")
        print(f"Energy total: {device.energy.lifetime_energy} kWh")
    finally:
        await connection.close()

asyncio.run(main())

API

GoodweInverter

The top-level object. Reach it through a ModbusUnit:

device = GoodweInverter(unit)
await device.async_update()

Sub-components

Attribute Type Description
identity Identity Serial number and model
state InverterState System state, faults, temperature
grid GridOutput AC voltages, currents, power
pv PvStrings PV string voltage/current/power
energy EnergyTotals Daily and lifetime energy
powercontrol ActivePowerControl Active power limit settings

Update methods

Method Polls
async_update() All sub-systems
async_update_readings() pv, state, grid, energy
async_update_settings() powercontrol

Writing settings

await device.powercontrol.async_set_active_power_export_limit(75)

Limits export to 75 % of rated output.

CLI tool

A command-line query tool is included:

# TCP connection
python -m goodwe_modbus.query --host 10.0.0.234 --port 502 --unit 246

# Serial over TCP (socket://)
python -m goodwe_modbus.query --device socket://10.0.0.234:502 --unit 246

Development

git clone https://github.com/theneweinstein/goodwe_modbus.git
cd goodwe_modbus
uv sync

Linting

ruff check .
ruff format --check .

Metadata

Release files for goodwe-modbus 0.2.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for goodwe-modbus 0.2.0
File Size Uploaded Provenance Actions
goodwe_modbus-0.2.0.tar.gz 5.3 kB With provenance Details for goodwe_modbus-0.2.0.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for goodwe-modbus 0.2.0
File Interpreter ABI Platform Actions
goodwe_modbus-0.2.0-py3-none-any.whl Python 3 none any Details for goodwe_modbus-0.2.0-py3-none-any.whl

Total release size: 13.2 kB

Release files / goodwe_modbus-0.2.0.tar.gz

Download URL goodwe_modbus-0.2.0.tar.gz
Size 5.3 kB
Tags Source
SHA-256 checksum
How to use checksums
1f5ae3ca6e652a6962e5ccb7dae64b57bf5a89e83a744e9407bb45e82bcb027a
BLAKE2b-256 checksum
How to use checksums
b41c1ac056653899f884b146c8902d2ec5b2968b58d66649f60dd89e6a17cfe9
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.16

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Oct 27, 2026.

Transparency log

Release files / goodwe_modbus-0.2.0-py3-none-any.whl

Download URL goodwe_modbus-0.2.0-py3-none-any.whl
Size 8.0 kB
Tags Python 3
SHA-256 checksum
How to use checksums
1b19b4dcdfb8c50abd7d61f774a38934404182c3b44962fb0d6213e1e0fa99a6
BLAKE2b-256 checksum
How to use checksums
b013f554b36456131d99e63296b86e9a091d81a4d148933b49f124bbb6a5efae
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.16

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Oct 27, 2026.

Transparency log

Security for goodwe-modbus 0.2.0

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

Full provenance

Both files in this release have been uploaded with provenance metadata.

Select from 2 files

Attestation for goodwe_modbus-0.2.0.tar.gz

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Oct 27, 2026.

Transparency log

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Release history Release notifications | RSS feed

This release

0.2.0 This release

2 release files Full provenance

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page