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, Parity, 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)
await device.async_set_auto_report(0) # 0 disables the unsolicited reports
await device.async_set_return_time(20) # answer delay, in the family's steps
await device.async_write_bus_address(4) # verified; raises on DIP-addressed models
await device.async_write_link_settings(baudrate=19200, parity=Parity.EVEN)
await device.async_write_digital_outputs_mask(0b1001) # whole mask, verified by a read
await device.async_read_raw() # raw registers for diagnostics, cache untouched
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, which is exactly what the modbus integration of
Home Assistant 2026.10.4 pins (modbus-connection[tmodbus]==4.12.4). That is also the target Home
Assistant: it is the newest release pytest-homeassistant-custom-component supports today, and
raising the target would break the integration's test stack until the plugin catches up. Newer
releases stay compatible — 2026.11.0 pins 4.12.7, 2026.11.3 pins 4.12.8, both inside the range —
while 2026.10.0 pins 4.12.3 and is not supported: installing there would force an upgrade of a
dependency Home Assistant pins exactly (2026.10.1–2026.10.4 pin 4.12.4, so they are fine). CI runs the suite twice: against the floor, read from
pyproject.toml, 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
0x0080and written as single coils; inputs are read from0x0090. 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
Pytest plugins come from their entry points. If PYTEST_DISABLE_PLUGIN_AUTOLOAD is set in the
environment, pass them explicitly: python -m pytest -p pytest_asyncio.plugin -p pytest_cov.plugin -p modbus_connection.pytest_plugin.
The transport is mocked on its boundary with the in-memory backend, so the tests need neither
hardware nor a serial port. The change's tasks.md names the requirement behind each test group;
scenarios that only a real device can show — reset behaviour, baud rate taking effect after a power
cycle, the input-to-output link — are marked there as live checks.
License
MIT — see LICENSE.
Metadata
Release files for eletechsup-modbus-library 0.2.0
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| eletechsup_modbus_library-0.2.0.tar.gz | 30.7 kB | With provenance | Details for eletechsup_modbus_library-0.2.0.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| eletechsup_modbus_library-0.2.0-py3-none-any.whl | Python 3 | none | any | Details for eletechsup_modbus_library-0.2.0-py3-none-any.whl |
Total release size: 49.5 kB
Release files / eletechsup_modbus_library-0.2.0.tar.gz
| Download URL | eletechsup_modbus_library-0.2.0.tar.gz |
|---|---|
| Size | 30.7 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
ada4892ea193fbb3a4f23af761e3d0b28dd442a24ebda966459885ad7789d8b4
|
|
BLAKE2b-256 checksum How to use checksums |
0120fbd0ae5b65fadd49aace5654976bd59f8e95b55e5ee06e292cf3fdca5255
|
| 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 30, 2026.
Transparency logRelease files / eletechsup_modbus_library-0.2.0-py3-none-any.whl
| Download URL | eletechsup_modbus_library-0.2.0-py3-none-any.whl |
|---|---|
| Size | 18.9 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
21f573b52f543c7150be04a4de6c9beba1e11df426f839924402949d9dad6802
|
|
BLAKE2b-256 checksum How to use checksums |
94037d8b6cdda430790dc0bb0472533bd9295f6a6a5cd050dd589892847a03c1
|
| 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 30, 2026.
Transparency logSecurity for eletechsup-modbus-library 0.2.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.
Attestation for eletechsup_modbus_library-0.2.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 30, 2026.
Transparency logA 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.