huawei-solar
A Python wrapper for the Huawei Inverter modbus TCP API
Decision gist · record as of 2026-08-14
Yes, if you own or manage Huawei SUN2000 inverters or LUNA2000 batteries and need local Modbus access. The package is actively maintained, has no known vulnerabilities, low install friction, and is marked Production/Stable. The AGPL v3 license is permissive for local use but requires source disclosure if you deploy modified versions as a network service. Not suitable if you need Python versions below 3.12.AI-flagged interpretation of the facts on this page — verify before relying
Before you install
- Requires Python 3.12 or later.
- Huawei devices support only one connection at a time; concurrent connections from other clients will interrupt your session.
- Low install friction with a single runtime dependency (tmodbus).
License · maintenance · safety
(agpl) — Licensed under GNU Affero General Public License v3, which requires that if you modify and deploy this library as a network service, you must provide source code access to users. For local use or as a library in your own application, the copyleft obligation applies only if you distribute modified versions.
last release 2026-08-11 (3 days) · last repo commit 2026-08-12 · 45 stars
0 known vulnerabilities (OSV.dev, 2026-08-14) · 135,982 downloads/mo, #11,410 on PyPI
Alternatives
Verify before relying
import asyncio
from huawei_solar import create_tcp_client, create_device_instance, SUN2000Device
from huawei_solar import register_names as rn
async def read_inverter():
client = create_tcp_client(host="192.168.1.1", port=503)
device = await create_device_instance(client)
result = await device.batch_update([rn.INPUT_POWER, rn.LINE_VOLTAGE_A_B])
print(result)
asyncio.run(read_inverter())- Whether tmodbus has known vulnerabilities or maintenance issues not reflected in this package's security record
- Performance characteristics when reading large batches of registers or handling network latency
- Compatibility with specific SUN2000 firmware versions beyond the Huawei Modbus Interface Definitions
What it is and what it does
huawei-solar is a Python library that abstracts the Modbus protocol to communicate with Huawei solar inverters (SUN2000), batteries (LUNA2000), and related devices. It provides both a low-level Modbus client for direct register access and a high-level device interface that handles register batching, unit conversion, and authentication. The library was originally developed to support Home Assistant integration but works as a standalone tool for any application needing to monitor or control Huawei solar equipment over local Modbus-TCP (via SDongle, EMMA, or WiFi) or Modbus-RTU (via RS485 serial connection).
The package depends only on tmodbus for Modbus protocol handling and supports modern Python versions (3.12, 3.13, 3.14). It includes features for reading optimizer data, writing battery parameters, and performing installer-level login sequences. The main constraint is that Huawei devices allow only one active connection at a time, so you must ensure no other client is attempting to connect while your session is active.
Use it for
- Monitor real-time power output and voltage from a SUN2000 inverter in a home solar installation
- Read battery state-of-charge and temperature from a LUNA2000 battery connected to an inverter
- Integrate Huawei solar data into a Home Assistant automation or custom monitoring dashboard
- Write battery charge/discharge parameters or other settings to a Huawei device via Modbus
- Build a local energy management system that queries multiple inverter registers in a single batch operation
Worth the install?
AI-flagged interpretation of the facts on this page. Verify before relying on it.
Yes, if you own or manage Huawei SUN2000 inverters or LUNA2000 batteries and need local Modbus access.
The package is actively maintained, has no known vulnerabilities, low install friction, and is marked Production/Stable. The AGPL v3 license is permissive for local use but requires source disclosure if you deploy modified versions as a network service. Not suitable if you need Python versions below 3.12.
Install
huawei-solar on PyPI
Before you install
Low install friction with a single runtime dependency (tmodbus). Actively maintained with a release 3 days old and recent commits; marked Production/Stable.
Requires Python 3.12 or later. Huawei devices support only one connection at a time; concurrent connections from other clients will interrupt your session.
License in practice
Licensed under GNU Affero General Public License v3, which requires that if you modify and deploy this library as a network service, you must provide source code access to users. For local use or as a library in your own application, the copyleft obligation applies only if you distribute modified versions.
Quickstart
import asyncio
from huawei_solar import create_tcp_client, create_device_instance, SUN2000Device
from huawei_solar import register_names as rn
async def read_inverter():
client = create_tcp_client(host="192.168.1.1", port=503)
device = await create_device_instance(client)
result = await device.batch_update([rn.INPUT_POWER, rn.LINE_VOLTAGE_A_B])
print(result)
asyncio.run(read_inverter())
Verify before relying
- Whether tmodbus has known vulnerabilities or maintenance issues not reflected in this package's security record
- Performance characteristics when reading large batches of registers or handling network latency
- Compatibility with specific SUN2000 firmware versions beyond the Huawei Modbus Interface Definitions
Package facts
| License | Not declared agpl |
| Python support | Supports the current Python release >=3.12 |
| Install friction | Low. Pure-Python wheel |
| Runtime dependencies | 1 packagetmodbus |
| Maintenance | Actively maintained 3 days since the last release |
| Last repo commit | |
| First released | |
| Downloads | 135,982 / month, #11,410 on PyPI 30-day window, as of 2026-08-14 |
| Known vulnerabilities | None known OSV.dev, checked 2026-08-14 |
| Classifiers | Development Status :: 5 - Production/StableLicense :: OSI Approved :: GNU Affero General Public License v3Operating System :: OS IndependentProgramming Language :: Python :: 3.12Programming Language :: Python :: 3.13Programming Language :: Python :: 3.14Topic :: Home AutomationTyping :: Typed |
Evidence: huawei_solar-3.0.7-py3-none-any.whl
Tags
Let your AI agent find packages like this
Example. Real query, live index.
You found this page by searching. An agent finds it by wishing: SkillFed indexes 14,416 PyPI packages by what they can do, searchable in plain language.
wish › “huawei inverter modbus”
- huawei-solarProvides a Python interface to read and write data from Huawei…
- goodweConnects to GoodWe solar inverters over local network to retrieve…
- pysmaConnects to SMA solar inverters via their WebConnect interface to…
Give your agent the search over MCP, or paste the wish link into any chat.
More Home Automation packages
Represents and manipulates IPv4, IPv6, MAC addresses and related network objects; supports CIDR notation, subnetting, set operations, IANA lookups, and DNS reverse generation.
Home Assistant is an open-source home automation platform that centralizes control of smart home devices and automations on a local server or Raspberry Pi, prioritizing local control and privacy over cloud dependency.
Defines finite state machines and statecharts with a declarative Python API, supporting flat states, compound hierarchies, parallel regions, history states, guards, and both sync and async callbacks.
Install it if you need to model workflows, control logic, or any system with discrete states and event-driven transitions — from simple state machines to complex…
A Python library for controlling BlueZ Bluetooth adapters on Linux via the Management API, supporting both synchronous and event-driven command patterns.
An async Python library for controlling and monitoring Homematic and HomematicIP devices through multiple backend systems (CCU3, OpenCCU, Homegear, CUxD, CCU-Jack) using XML-RPC and JSON-RPC protocols.
Install it if you need to control Homematic devices from Python; the only constraint is a requirement for Python 3.14 or later and network access to a compatible…
Provides base classes and utilities for Home Assistant integrations to proxy HTTP and WebSocket traffic through Home Assistant's web server.
Install only if you are building a custom Home Assistant integration; it is not useful as a standalone package.
See also goodwe · pysma · pymodbus · minimalmodbus · pyenphase · pystiebeleltron · uModbus · pyModbusTCP · growattServer · esdk-obs-python