Skip to main content
Pre-release

This release is a pre-release and may not be stable for production use.

franklinwh-modbus-async

An async Python library for the FranklinWH aGate. It talks Modbus TCP and covers the SunSpec models and the vendor extension registers. It is built on modbus-connection.

This is the asyncio successor to franklinwh-modbus, which is synchronous. It aims to match that library's features and to fix its known connection and threading defects. To find out why it exists and how it compares, read docs/why.md.

Status: pre-alpha (Phase 1 of 7). Connection, SunSpec discovery and a read-only CLI work. Typed status reads come next. See PLAN.md for the roadmap.

⚠️ Unofficial software

About this software

  • Not affiliated with, endorsed or supported by FranklinWH. FranklinWH and aGate are trademarks of their owners.
  • Provided as is, without warranty, for educational and informational use.

Write commands carry real risk

  • This library can send write commands to grid-connected battery hardware.
  • Used incorrectly, it can discharge your battery when you need it, import power you did not intend to, or leave the system in an unexpected state.
  • You use it at your own risk.

Getting help

  • Do not contact FranklinWH support about this library. Report problems here.

Requirements

  • An aGate with Modbus TCP enabled (ask your installer), reachable on TCP port 502. A fixed IP and a wired LAN are recommended.
  • Python 3.12 or later.

Try it

pip install --pre franklinwh-modbus-async   # Python 3.12+; --pre while in alpha
fwh-async scan demo                      # built-in simulated aGate, no hardware needed
fwh-async scan 192.0.2.10                # your aGate: SunSpec base address and models (read-only)
fwh-async info 192.0.2.10                # nameplate: model, firmware (serial hidden)
import asyncio
from franklinwh_modbus_async import FranklinWH

async def main() -> None:
    async with FranklinWH.tcp("192.0.2.10") as agate:   # discovers the SunSpec map; never writes
        plate = await agate.read_nameplate()
        print(plate.model, plate.version)               # aGate X V10R01B04D00

asyncio.run(main())

Develop

To work on the library from source:

git clone git@github.com:david2069/franklinwh-modbus-async.git
cd franklinwh-modbus-async
python3.12 -m venv .venv && source .venv/bin/activate
pip install -e ".[dev]"
pre-commit install
pytest

Roadmap

Phase Scope State
0 Scaffold, CI, PII guard, rationale docs ✅
1 Connection, SunSpec discovery, generated models, FakeAGate, read-only CLI ✅
2 Typed reads and snapshot —
3 Control: M704 dispatch, watchdog, verify, native modes, safety —
4 Virtual modes, TOU schedules, sequencer, discovery —
5 CLI: control commands —
6 Emulator and hardware verification —
7 1.0 release, migration guide —

Documentation

Page
Getting started Prerequisites, install, first CLI and Python steps, testing with FakeAGate
CLI fwh-async commands and options
Architecture Connection ownership, discovery, locking, retries, errors
Why this library Purpose, basis, why async, why modbus-connection, and how it compares with the alternatives
modbus-connection findings Notes from reviewing the transport library
Plan Design decisions and phases
Changelog

Contributing

PRs are welcome. CI runs ruff, mypy --strict, pytest and a PII guard (tools/pii_check.py).

  • Placeholders only. In code, docs, examples and captured output, use:
    • 192.0.2.10 for hosts
    • FWH-SN-REDACTED for serials
    • 00:00:5E:00:53:00 for MAC addresses
  • Private terms. Put anything you want blocked in a local .pii-denylist. git ignores this file.

License

MIT. See LICENSE.

Metadata

Release files for franklinwh-modbus-async 0.1.0a1

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

Source distribution (sdist)

Source distribution for franklinwh-modbus-async 0.1.0a1
File Size Uploaded
franklinwh_modbus_async-0.1.0a1.tar.gz 34.7 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for franklinwh-modbus-async 0.1.0a1
File Interpreter ABI Platform
franklinwh_modbus_async-0.1.0a1-py3-none-any.whl Python 3 none any Details

Total release size: 64.8 kB

Release files / franklinwh_modbus_async-0.1.0a1.tar.gz

Download URL franklinwh_modbus_async-0.1.0a1.tar.gz
Size 34.7 kB
Tags Source
SHA-256 checksum
How to use checksums
72d67f7d869df720b849a23037a17830279d3636b435a7d52bbd36838db41c83
BLAKE2b-256 checksum
How to use checksums
3722807e331a170c2d075b5ae972ca9edd97c56e115630e718b7a7c4a393f19e
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.14

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 13, 2026.

Transparency log

Release files / franklinwh_modbus_async-0.1.0a1-py3-none-any.whl

Download URL franklinwh_modbus_async-0.1.0a1-py3-none-any.whl
Size 30.1 kB
Tags Python 3
SHA-256 checksum
How to use checksums
eca7585ced3843d3aa46947f22d2a5774dd4e55b63be9af7281c7e8eca05acb9
BLAKE2b-256 checksum
How to use checksums
9db7388ff7320bfb7948ddcc33506e28b0da70b0a2e27b45b2e4bc5a40314b18
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.14

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 13, 2026.

Transparency log
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