Read a KACO blueplanet inverter over SunSpec Modbus TCP.
Project description
kaco-modbus
Read a KACO blueplanet inverter over SunSpec Modbus TCP. This library discovers the device's register layout at runtime using SunSpec, then provides typed access to identity and live data. Built on the modbus-connection library, it is the core device integration behind the kaco Home Assistant integration.
Installation
pip install kaco-modbus
For the dump CLI tool (below), install with the cli extra:
pip install "kaco-modbus[cli]"
Note: The package is not yet published to PyPI; for now, install from the GitHub repository or build locally with uv.
Usage
import asyncio
from modbus_connection.tmodbus import connect_tcp
from kaco_modbus import KacoInverter
async def main():
connection = await connect_tcp("192.168.1.50", port=502)
try:
unit = connection.for_unit(1)
probe = await KacoInverter.async_probe(unit)
device = KacoInverter(unit, probe)
await device.async_update()
print(f"AC Power: {device.inverter.ac_power} W")
print(f"Energy Total: {device.inverter.energy_total} kWh")
print(f"State: {device.inverter.state}")
finally:
await connection.close()
asyncio.run(main())
Dump CLI
The dump tool reads your inverter's complete SunSpec register image. This is useful for:
- Capturing on-device ground-truth data for test fixtures
- Verifying Modbus connectivity
- Debugging SunSpec layout issues
Run it directly on the inverter's LAN:
uv run --extra cli python -m kaco_modbus.dump 192.168.1.50 --json dump.json
The command prints live data (AC power, energy, state, temperatures) and optionally saves the raw register image as JSON for analysis.
Important: Modbus TCP must be enabled on the inverter. In the inverter's menu (local GUI or WebGUI), navigate to MODBUS / SunSpec protocol and enable it (default port 502). The inverter's Modbus server is single-threaded, so sharing a connection across multiple clients (via modbus-connection) is more reliable than opening separate TCP connections.
Supported Devices
| Device Series | Models | SunSpec IDs | Firmware |
|---|---|---|---|
| KACO blueplanet TL1 | TL1.5 – TL8.6 | 1, 101/102/103 | ≥ V2.02 |
| KACO blueplanet TL3 | TL3.0 – TL10.0 | 1, 101/102/103 | ≥ V2.02 |
| KACO Powador TL3 | TL3.0 – TL15.0 | 1, 101/102/103 | ≥ V2.02 |
Data based on KACO's "MODBUS Protocol Application Note, Tx1 and Tx3 Series" (v180730) and SunSpec specs. Other firmware versions and models may expose additional SunSpec models (e.g., 112, 113, 160); the library skips unknown models and will discover them in future versions.
Development
Clone and set up:
git clone https://github.com/g4bri3lDev/kaco-modbus
cd kaco-modbus
uv sync
Run tests, type checks, and lint:
uv run pytest -v
uv run mypy
uv run ruff check
uv run ruff format --check
See docs/ARCHITECTURE.md for a detailed explanation of the library's design, module responsibilities, and layering.
License
Apache License 2.0. See LICENSE for details.
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file kaco_modbus-0.1.0.tar.gz.
File metadata
- Download URL: kaco_modbus-0.1.0.tar.gz
- Upload date:
- Size: 8.6 MB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
2d387cdc27bac958d0af91545168302c928de17cfc3b58c37887fe0358bd145f
|
|
| MD5 |
2057d531109406b5f40133a58fbf791c
|
|
| BLAKE2b-256 |
bb1211f6aacf7c27bedd0942ef93b9ed6a1226105e0954dfb0af5a1455218728
|
Provenance
The following attestation bundles were made for kaco_modbus-0.1.0.tar.gz:
Publisher:
release.yml on g4bri3lDev/kaco-modbus
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
kaco_modbus-0.1.0.tar.gz -
Subject digest:
2d387cdc27bac958d0af91545168302c928de17cfc3b58c37887fe0358bd145f - Sigstore transparency entry: 2145770672
- Sigstore integration time:
-
Permalink:
g4bri3lDev/kaco-modbus@0af7a3498fba1967816bd191d7bbd7adb1010d64 -
Branch / Tag:
refs/heads/main - Owner: https://github.com/g4bri3lDev
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
release.yml@0af7a3498fba1967816bd191d7bbd7adb1010d64 -
Trigger Event:
push
-
Statement type:
File details
Details for the file kaco_modbus-0.1.0-py3-none-any.whl.
File metadata
- Download URL: kaco_modbus-0.1.0-py3-none-any.whl
- Upload date:
- Size: 17.4 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
d11b32d6d72537315585872ebe5af0a67b24058499f033bd571bbffd11c56b87
|
|
| MD5 |
2f4ef1d32d356d667a9227eeeb00142f
|
|
| BLAKE2b-256 |
d7939a0f2a41ecccb70244662a10dc483b99ec8c93778a5874fcedbc7abf4de7
|
Provenance
The following attestation bundles were made for kaco_modbus-0.1.0-py3-none-any.whl:
Publisher:
release.yml on g4bri3lDev/kaco-modbus
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
kaco_modbus-0.1.0-py3-none-any.whl -
Subject digest:
d11b32d6d72537315585872ebe5af0a67b24058499f033bd571bbffd11c56b87 - Sigstore transparency entry: 2145770680
- Sigstore integration time:
-
Permalink:
g4bri3lDev/kaco-modbus@0af7a3498fba1967816bd191d7bbd7adb1010d64 -
Branch / Tag:
refs/heads/main - Owner: https://github.com/g4bri3lDev
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
release.yml@0af7a3498fba1967816bd191d7bbd7adb1010d64 -
Trigger Event:
push
-
Statement type: