Skip to main content

pyiont

Asynchronous Python client for IONT EV chargers over Modbus TCP.

The library is built on modbus-connection: it takes a ModbusUnit, maps the charger's register blocks to typed attributes, and exposes the commands the charger accepts. It has no Home Assistant dependency and is the device layer of the Home Assistant iont integration.

Install

pip install "pyiont[tmodbus]"    # tmodbus backend
pip install "pyiont[pymodbus]"   # pymodbus backend

Prerequisites

Modbus TCP has to be enabled on the charger, in its administration interface under Protocols. Writing (authorization, power limit) is a separate switch there and is off by default. The charger listens on port 502.

Example

import asyncio

from modbus_connection import ModbusTcpParams
from modbus_connection.tmodbus import ModbusConnection

from pyiont import IontCharger


async def main() -> None:
    connection = ModbusConnection(ModbusTcpParams(host="192.168.1.60", port=502))
    try:
        charger = await IontCharger.async_probe(connection.for_unit(1))
        report = await charger.async_update()

        print("Status:", charger.device.status.name.lower())
        print("Available power:", charger.device.available_power, "W")
        for number, connector in enumerate(charger.connectors, 1):
            print(
                f"Connector {number}:",
                connector.charging_state.name.lower(),
                connector.power,
                "W",
                connector.session_energy,
                "Wh",
            )
        print("Failed sub-systems:", report.failed)

        await charger.async_authorize(1)  # start charging on connector 1
        await charger.async_set_external_power_limit(7_400)  # cap at 7.4 kW
    finally:
        await connection.close()


asyncio.run(main())

What it reads

  • Device: breaker limits, phase count, free-charging mode, user power ceiling, available power, charging strategy, status, uptime, connector count.
  • Settings: the external power limit (writable).
  • Connector (one block per connector): connection and vehicle state, charging state, authorization and its source, power, per-phase voltage, current and frequency, session, last-session and lifetime energy, battery state of charge (DC), inner and ambient temperature.

async_update() reads each sub-system on its own and returns an UpdateReport naming what refreshed and what failed, so one silent connector does not blank the rest. A link that answers nothing raises IontConnectionError.

Commands

  • async_authorize(number, boost=False) / async_deauthorize(number): start or stop charging on a connector by its 1-based number. boost=True charges at full available current even under the eco strategy.
  • async_authorize_by_id(connector_id) / async_deauthorize_by_id(connector_id): the same, addressing the connector by its OCPP connector ID.
  • async_set_external_power_limit(watts) / async_clear_external_power_limit(): cap the charging power from outside, for example from a home energy manager.

A command that the charger does not process in time, or reports a result other than success for, raises IontCommandError.

Develop

uv sync --extra tmodbus
uv run pytest
uv run mypy
uv run ruff check

License

MIT

Release files for pyiont 0.1.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 pyiont 0.1.0
File Size Uploaded
pyiont-0.1.0.tar.gz 14.1 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for pyiont 0.1.0
File Interpreter ABI Platform
pyiont-0.1.0-py3-none-any.whl Python 3 none any Details

Total release size: 25.9 kB

Release files / pyiont-0.1.0.tar.gz

Download URL pyiont-0.1.0.tar.gz
Size 14.1 kB
Tags Source
SHA-256 checksum
How to use checksums
04a563dfd1d59d3a4b5e10dec5d6a2de49fba6a4c16dea49f78b01439a08542e
BLAKE2b-256 checksum
How to use checksums
f79090edce08fa0755cb12d2766ee94c1272761ee95cb75388f6b39140d51bd4
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 Sep 17, 2026.

Transparency log

Release files / pyiont-0.1.0-py3-none-any.whl

Download URL pyiont-0.1.0-py3-none-any.whl
Size 11.9 kB
Tags Python 3
SHA-256 checksum
How to use checksums
6ca4b579fe0e2c44275b0a617ca8664b0fe51bdb48bd2090023ff83ce8c0432b
BLAKE2b-256 checksum
How to use checksums
635e7eaafd96ea1c95207e922caf2333637c3133121204dd3475375cced31b9d
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 Sep 17, 2026.

Transparency log

Release history Release notifications | RSS feed

This release

0.1.0 This release

2 release files

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