Skip to main content

eletechsup-modbus-library

Async Modbus RTU protocol library for Eletechsup modules. It owns the register map, the value decoding and the write rules; it does not own the transport and does not depend on Home Assistant.

The first supported family is 10IOAXX — industrial IO modules with N opto-isolated inputs and N relays on RS485. Profiles for the models are the only place that describes the hardware, so a new family is added by registering profiles and components rather than by editing existing ones.

Installation

pip install eletechsup-modbus-library

Python 3.14 or newer is required. The library builds on modbus-connection and passes its tests on the in-memory backend shipped with it.

Usage

The caller owns the Modbus unit — a serial port, a TCP gateway, or the Home Assistant modbus integration. The library never opens or closes a connection.

from eletechsup_modbus_library import EletechsupDevice, RelationMode, require_profile

device = EletechsupDevice(unit, require_profile("10IOA04"))

await device.async_update_state()
first_relay = device.digital_output(0)

await device.async_set_digital_output(0, on=True)
await device.async_set_relation(RelationMode.INTERLOCKING_PAIR)

Reading is split on purpose: async_update_state() is two single-register reads of the output and input masks, async_update_settings() is one request for the settings block. A slow or unreachable device therefore never hides the state that was read successfully.

Writing is verified. Every settings write is followed by a read-back, and a device that acknowledges a write but keeps another value raises ValueNotStoredError instead of pretending success. The only exception is the factory reset: after it the device changes speed, parity and address, so a read-back would fail for reasons that are not an error.

Supported devices

Model Inputs Relays Product ID
10IOA01 1 1 1001
10IOA02 2 2 1002
10IOA04 4 4 1004
10IOA08 8 8 1008
10IOA12 12 12 1012

Catalogue articles such as 10IOA0112VR differ in power supply and enclosure only; the protocol is the same, so profiles use the base model name.

Dependencies

The lower bound is modbus-connection>=4.12.4. That is the version the modbus integration of Home Assistant 2026.10 requires in its own manifest, so the library never asks for a newer transport than the Home Assistant it is installed into already ships. CI runs the suite twice: against that lower bound and against the latest release.

Protocol notes

  • Defaults: 9600 baud, 8 data bits, no parity, 1 stop bit. Address 1–63 is set by DIP switches on these models, so the address register is read-only.
  • Outputs are read from the holding register 0x0080 and written as single coils; inputs are read from 0x0090. A short input pulse can fall between two polls — the device does not latch it.
  • Changing baud rate or parity is stored immediately but takes effect only after a power cycle.
  • The factory reset (0x00FB) is available as a method but is not exposed by the integration.

Device facts, the register map and the differences between firmware versions are documented in the library documentation. The cross-family picture is in the family overview.

Development

python -m pytest --cov=eletechsup_modbus_library
ruff format --check .
ruff check .
mypy src

The transport is mocked on its boundary with the in-memory backend, so the tests need neither hardware nor a serial port. Every OpenSpec scenario of the change has a test; the requirement is named in the test module.

License

MIT — see LICENSE.

Metadata

Release files for eletechsup-modbus-library 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 eletechsup-modbus-library 0.1.0
File Size Uploaded Provenance Actions
eletechsup_modbus_library-0.1.0.tar.gz 25.6 kB With provenance Details for eletechsup_modbus_library-0.1.0.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for eletechsup-modbus-library 0.1.0
File Interpreter ABI Platform Actions
eletechsup_modbus_library-0.1.0-py3-none-any.whl Python 3 none any Details for eletechsup_modbus_library-0.1.0-py3-none-any.whl

Total release size: 42.4 kB

Release files / eletechsup_modbus_library-0.1.0.tar.gz

Download URL eletechsup_modbus_library-0.1.0.tar.gz
Size 25.6 kB
Tags Source
SHA-256 checksum
How to use checksums
52703900aea5fa62905850546ff936f7b2130ab5b420b8c51a73b88cc4361c70
BLAKE2b-256 checksum
How to use checksums
d31bf5dbb0ae407630ff3727f4f95aa4f7f207456b83a6b18f793c385c278916
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.16

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 Nov 29, 2026.

Transparency log

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

Download URL eletechsup_modbus_library-0.1.0-py3-none-any.whl
Size 16.9 kB
Tags Python 3
SHA-256 checksum
How to use checksums
c889c55591032aad8916c2ff004275b615de7e50ea9547f4c422514310632521
BLAKE2b-256 checksum
How to use checksums
7615a1e48c58e5cba9035c76a4d75f51bdec1b67f5aafcb9bed9156ecc383448
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.16

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 Nov 29, 2026.

Transparency log

Security for eletechsup-modbus-library 0.1.0

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.

Full provenance

Both files in this release have been uploaded with provenance metadata.

Select from 2 files

Attestation for eletechsup_modbus_library-0.1.0.tar.gz

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 Nov 29, 2026.

Transparency log

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

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