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 30502.

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=30502))
    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

Metadata

Release files for pyiont 0.1.1

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.1
File Size Uploaded
pyiont-0.1.1.tar.gz 14.1 kB Details

Built distribution (wheel)

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

Total release size: 25.9 kB

Release files / pyiont-0.1.1.tar.gz

Download URL pyiont-0.1.1.tar.gz
Size 14.1 kB
Tags Source
SHA-256 checksum
How to use checksums
3262b6b4176b8c9557ee9c346496eab586668e04ac3d3ac9958aa9b2ad326a6d
BLAKE2b-256 checksum
How to use checksums
9f646b97accf8b80fc5ee737fd2d4a3c4457133551046aa9dcc48d06e079e0b1
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 28, 2026.

Transparency log

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

Download URL pyiont-0.1.1-py3-none-any.whl
Size 11.9 kB
Tags Python 3
SHA-256 checksum
How to use checksums
42e23ee8ef16427db72af1bcab5e0ea37cad7102f8e8aea0e45d9ee00c4b9ef0
BLAKE2b-256 checksum
How to use checksums
93f71b6e07b9d577fa86d9a17f2c465d65f20f64c85b45c00cdd3e2843e9e3ee
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 28, 2026.

Transparency log

Release history Release notifications | RSS feed

This release

0.1.1 This release

2 release files

0.1.0

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