Skip to content

Releases

mtdx62-modbus-library 0.5.1

Choose a tag to compare

@sergeyastakhov sergeyastakhov released this 28 Nov 16:51

The dependency floor is back where it belongs: modbus-connection>=4.12.3.

The 4.12.8 floor came from a wrong diagnosis. We saw a serial port that refused to open and blamed
the race fixed in 4.12.8, where an earlier version closes and reopens the connection when a unit asks
for a longer timeout. The port was held by a modbus: entry in configuration.yaml, which opens it
with its own client and shares it with nobody. The library never needed the newer release: everything
it uses — Component, Device, Raw, UpdateReport, gauge, integer, WriteValidator — is
already in 4.12.3.

That matters beyond tidiness. Home Assistant 2026.10 ships 4.12.3, 2026.10.4 ships 4.12.4, 2026.11
ships 4.12.7, and only 2026.11.3 moves to 4.12.8. With the old floor, installing on anything below
2026.11.3 replaced the dependency Home Assistant's own modbus integration runs on.

  • the floor is now >=4.12.3,<5 — the version Home Assistant 2026.10 ships
  • the README explains the floor, still recommends 4.12.8 and newer for the timeout race, and records
    what the actual port conflict was
  • CI runs the tests twice, on the floor and on the newest release, so the claim is checked rather
    than stated

Nothing in the API changed; 0.5.1 is a packaging fix on top of 0.5.0.

mtdx62-modbus-library 0.5.0

Choose a tag to compare

@sergeyastakhov sergeyastakhov released this 27 Nov 14:46

The MAC register is readable, and the bus settings are written the way the sensor needs.

  • settings.mac_code reads 0x000D. It is one register the vendor calls a MAC code, not a full MAC
    address, and it cannot be written
  • writing unit_id, baudrate or parity no longer tries to confirm by reading: the sensor answers
    on the new settings the moment it accepts them, so the old link is silent. The cached value stays
    as it was instead of being replaced by a guess
  • async_write_link_settings(unit_id=…, baudrate=…, parity=…) writes all three registers in one
    0x10 request, taking the values you do not pass from the last read and checking every value before
    anything reaches the bus

No API breakage: existing calls keep working, the confirmation read simply does not apply to the three
link parameters anymore.

Requires modbus-connection 4.12.8 or newer.

mtdx62-modbus-library 0.4.2

Choose a tag to compare

@sergeyastakhov sergeyastakhov released this 26 Nov 20:05

Writing a parameter now waits for the sensor and refuses what it would silently change.

  • the confirmation read is repeated for up to a second: the sensor shows the previous value for about
    half a second after a write, which made correct writes look like WriteVerificationError
  • the ranges are the ones measured on a real unit, not only the vendor table: detection distance from
    1.0 m (the sensor stores 0.6 as 1.0 without an error), the shielding zone from 0.3 m, the light
    threshold up to 420 lx (register 4200, the ceiling in the vendor table)
  • __version__ says 0.4.2. Version 0.4.1 was published with __version__ still reporting 0.4.0;
    a test now compares the two so it cannot drift again
  • the README explains what the sensor does with a value: clamping below its floors, the sum rule
    shielding + entry_indent < detection that answers with exception 0x02, and that unit_id,
    baudrate and parity take effect at once rather than after a power cycle

No API changes. docs/DEVICE-FACTS.md records the measurements: ten-step scan of the detection
distance, the threshold ceiling, the clamping floors, and the fact that the light gate's effect on
the presence register is still unverified — presence depends on a person being in the room.

Requires modbus-connection 4.12.8 or newer.

mtdx62-modbus-library 0.4.1

Choose a tag to compare

@sergeyastakhov sergeyastakhov released this 26 Nov 18:05

The description on PyPI shows its pictures again.

  • every link in the README is absolute now: images point at
    raw.githubusercontent.com/.../main/docs/images/..., documents at github.com/.../blob/main/....
    PyPI resolves a relative path against pypi.org and passes images to a proxy, which answered
    404 Bad url scheme
  • scripts/check_readme_links.py fails the build when a relative link comes back, so the next
    release cannot ship a broken description
  • nothing in the library changed: same API, same registers, same tests

No code changes: this is a documentation and packaging fix, and PyPI takes the description from the
uploaded package, so it needed a release to appear.

mtdx62-modbus-library 0.4.0

Choose a tag to compare

@sergeyastakhov sergeyastakhov released this 26 Nov 17:15

Parameters can be written now, not only read, and illuminance is reported in real lux.

  • every parameter the vendor register map describes is writable, 0x0000…0x000C; the one register
    nobody can explain (0x000D) stays read-only
  • settings.writable_fields() returns name, limits, step, unit and the raw register bounds, so a UI
    builds its controls from the library instead of copying the register map
  • settings.async_write(name, value) checks the value against the map before a byte reaches the
    bus, writes it, reads the parameter block back and compares
  • a device that stores something else raises WriteVerificationError with the requested and the
    stored value, instead of reporting success
  • a rejected or unanswered write raises the modbus-connection error unchanged, and the cached
    values stay as they were
  • illuminance is decoded with its documented resolution of 0.1 lx: the register 0x0001 held
    1506 for 150.6 lx, and the library reported 1506 lx. The light threshold uses the same tenth of a
    lux, as the vendor's write example shows (0x0064 = 100 × 0.1 = 10 lx)

What the library deliberately does not do, and why: it does not read the health code before writing
(a script changing ten parameters would pay ten extra reads, and whether a faulty device should be
configured is the caller's decision), it does not touch the unit's own address, baud rate or parity
when those registers are written, and it does not care that active_report makes the device talk on
its own. Those belong to the integration, which is built on polling.

Written against register map v1.6. Which of 0x000B/0x000C is the light threshold and which is
the report interval is still not verified on hardware; the library writes the documented address and
never guesses.

Requires modbus-connection 4.12.8 or newer.

mtdx62-modbus-library 0.3.1

Choose a tag to compare

@sergeyastakhov sergeyastakhov released this 25 Nov 14:26

Requires modbus-connection 4.12.8 or newer.

Earlier releases closed a connection and reopened it when a unit asked for a longer response
timeout, which races with the next request
(issue 269). On a serial bus
that race leaves the port busy, so a second consumer cannot open it until the stale connection is
gone. 4.12.8 keeps the link open instead; Home Assistant 2026.11 already ships it.

No API changes: the version is a dependency floor, not a new contract.

mtdx62-modbus-library 0.3.0

Choose a tag to compare

@sergeyastakhov sergeyastakhov released this 24 Nov 20:47

Device library for the MTD062-MB and MTD262-MB human presence sensors, spoken to over Modbus
RTU or Modbus TCP.

  • typed readings and settings components over modbus-connection, so the caller owns the
    connection and hands over a ModbusUnit; the library opens no socket or serial port
  • one block read per poll; the configuration registers are read only on request
  • the health code is decoded with an explicit is_fault marker: 1 means running, 0 is the
    self-check at power-up, 2 and above is a fault
  • read-only: no field accepts a write, so the sensor's configuration is untouched
  • 30 tests on the in-memory backend, 100% coverage

Install: pip install mtdx62-modbus-library