Skip to main content

ecowitt-ws90-modbus Python library

CI License

ecowitt-ws90-modbus is an asynchronous, transport-independent Python library for communicating with the Fine Offset / Ecowitt WS90 all-in-one weather sensor array over Modbus RTU (including RTU-over-TCP, the common way this sensor is bridged onto a network).

The library was developed as the backend for a corresponding Home Assistant integration. As it is kept independent of Home Assistant, it can also be used by other Python applications and projects.

Purpose and scope

ecowitt-ws90-modbus reads the WS90's live weather readings, its identity and RS-485 communication settings, and the 30-minute rolling history the sensor archives internally. It does not attempt to reproduce the sensor's "on-demand measurement" command registers (0x9C92-0x9C9A), which duplicate the live readings with tighter timing at the cost of a write-then-wait-then-read sequence -- not needed for a polling integration.

The library:

  • contains the WS90's Modbus register map, including data types, scaling, and invalid-value sentinels,

  • provides the identity registers (model, RS-485 baud rate, device address, device ID) alongside the live weather readings,

  • exposes the sensor's 30-minute rolling per-minute history, including battery and capacitance voltage, which are not available anywhere in the live register block,

  • does not create or own the Modbus transport. Applications using the library provide a modbus_connection.ModbusUnit and may use any backend supported by modbus-connection (pymodbus, tmodbus, ...).

An example script query.py in the code of the library shows how to build an application that can query a WS90 over Modbus/TCP (including RTU-over-TCP), or a direct serial connection.

Supported devices

Device Registers Comments
Fine Offset / Ecowitt WS90 Modbus RTU spec v1.0.6 All-in-one weather sensor array (light, UV, temperature, humidity, wind, rain, pressure)

Data provided by the library

The library provides:

  • device identity (model, RS-485 baud rate, device address, device ID),

  • live weather readings: light, UV index, temperature, humidity, wind speed, gust speed, wind direction, rainfall, absolute pressure, and a finer-resolution rain counter,

  • the last 30 minutes of archived per-minute readings for the same parameters, plus battery and capacitance voltage,

  • validated writes for the two writable identity registers (RS-485 baud rate and device address).

Testing and validation

The library's decode logic (scale, offset, and invalid-value handling) is cross-checked against the manufacturer's own worked examples in the WS90 Modbus RTU v1.0.6 specification, and against a live WS90 sensor.

Software-based tests run against an in-memory mock Modbus backend (via modbus-connection's pytest plugin) -- no real device or server is needed to run the test suite.

Documentation, development and contribution guidelines

Run script/run_checks.sh before opening a pull request -- it mirrors the CI workflow (formatting, lint, compile, tests, build) in one command. script/format_code.sh applies formatting and safe lint fixes only. script/query.py is a standalone CLI for querying a real WS90 over TCP or serial; run it with --help for usage.

Contributions target the develop branch; main only ever receives fast-forwards from develop (enforced in CI).

This library is one of three repositories for WS90 support in Home Assistant:

  • ha-ecowitt-ws90 -- a HACS-installable custom integration, vendoring this library.
  • ha-core-ws90 -- a home-assistant/core fork adding this as a built-in integration (branch ecowitt-ws90-integration).

Metadata

Release files for ecowitt-ws90-modbus 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 ecowitt-ws90-modbus 0.1.0
File Size Uploaded
ecowitt_ws90_modbus-0.1.0.tar.gz 14.5 kB Details

Built distribution (wheel)

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

Total release size: 27.5 kB

Release files / ecowitt_ws90_modbus-0.1.0.tar.gz

Download URL ecowitt_ws90_modbus-0.1.0.tar.gz
Size 14.5 kB
Tags Source
SHA-256 checksum
How to use checksums
be3e9c1d2bb611d02aa0a7b78b1a3776ab18b6bdd5f83a1044bb910249ad48f9
BLAKE2b-256 checksum
How to use checksums
890b02bbd1a922e2fe81bb0fb29604a1b7cf72307750733c1205ff4340cb712d
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 2, 2026.

Transparency log

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

Download URL ecowitt_ws90_modbus-0.1.0-py3-none-any.whl
Size 12.9 kB
Tags Python 3
SHA-256 checksum
How to use checksums
dbf13cbce90d5a4ab15a4b1dd8df5bb34298c2f1ab12a0f0ab3bfed41b9d8934
BLAKE2b-256 checksum
How to use checksums
380f06f5d79dfb7ee9504ec7de7a7c412154f9cad6ca14bb26ec47ec402988d2
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 2, 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