Metadata-Version: 2.4
Name: tek603
Version: 0.1.0
Summary: Async Python library for Proteus Ecometer (TEK603) ultrasonic level sensors
Author-email: marcschmiedchen <marc.schmiedchen@protonmail.com>
License: MIT License
Project-URL: Homepage, https://github.com/marcschmiedchen/tek603
Project-URL: Issues, https://github.com/marcschmiedchen/tek603/issues
Keywords: home-automation,serial,asyncio,ecometer,proteus,ultrasonic
Classifier: License :: OSI Approved :: MIT License
Classifier: Programming Language :: Python
Classifier: Programming Language :: Python :: 3
Classifier: Development Status :: 3 - Alpha
Classifier: Intended Audience :: Developers
Classifier: Topic :: Home Automation
Requires-Python: >=3.13
Description-Content-Type: text/markdown
License-File: LICENSE
Requires-Dist: pyserial>=3.5
Requires-Dist: pyserial-asyncio-fast>=0.13
Provides-Extra: dev
Requires-Dist: pre-commit; extra == "dev"
Requires-Dist: ruff; extra == "dev"
Requires-Dist: codespell; extra == "dev"
Requires-Dist: pytest; extra == "dev"
Requires-Dist: pytest-asyncio; extra == "dev"
Dynamic: license-file

# tek603

Async Python library for **Proteus Ecometer** ultrasonic liquid level sensors (TEK603 protocol) over USB serial.

Measures distance to liquid via ultrasound and reports level, temperature, and tank capacity.

## Installation

```bash
pip install tek603
```

## Usage

```python
import asyncio
import serial_asyncio_fast
from tek603 import TEK603

async def main():
    transport, protocol = await serial_asyncio_fast.create_serial_connection(
        asyncio.get_event_loop(), TEK603, "/dev/ttyUSB0", baudrate=115200
    )

    def on_data():
        print("Level:", protocol.read_sensor(2), "cm")
        print("Temp:", protocol.read_sensor(1), "°C")

    protocol.register_callback(on_data, dp_nbr=2)
    await asyncio.sleep(60)

asyncio.run(main())
```

## Sensors

| ID | Name               | Unit |
|----|--------------------|------|
| 1  | Temperature        | °C   |
| 2  | Liquid level       | cm   |
| 3  | Available capacity | l    |
| 4  | Total capacity     | l    |

## Hardware

- Proteus Ecometer USB (CP2102 / Silicon Labs USB-to-serial adapter)
- Protocol fully reverse-engineered; reference: [sarnau.info](https://sarnau.info)

## License

MIT
