Metadata-Version: 2.5
Name: smartmeter-austria
Version: 1.0.2
Summary: Read Austrian smart meters (Burgenland, Niederösterreich, Wien, Steiermark, Salzburg, Tirol) from their customer interface
Project-URL: Homepage, https://github.com/r00tat/smartmeter_homeassistant_burgenland
Project-URL: Source, https://github.com/r00tat/smartmeter_homeassistant_burgenland/tree/main/smartmeter/smartmeter-austria
Project-URL: Issues, https://github.com/r00tat/smartmeter_homeassistant_burgenland/issues
Project-URL: Changelog, https://github.com/r00tat/smartmeter_homeassistant_burgenland/releases
Author: Paul Wölfel
License-Expression: GPL-3.0-only
License-File: LICENSE
Keywords: austria,dlms,home assistant,m-bus,obis,smart meter
Classifier: Development Status :: 4 - Beta
Classifier: Framework :: AsyncIO
Classifier: Intended Audience :: Developers
Classifier: Operating System :: OS Independent
Classifier: Programming Language :: Python :: 3
Classifier: Programming Language :: Python :: 3.13
Classifier: Programming Language :: Python :: 3.14
Classifier: Topic :: Home Automation
Classifier: Typing :: Typed
Requires-Python: >=3.13
Requires-Dist: beautifulsoup4>=4.12
Requires-Dist: gurux-common==1.0.13
Requires-Dist: gurux-dlms==1.0.200
Requires-Dist: lxml>=5.0
Requires-Dist: pycryptodomex>=3.24
Requires-Dist: pyserial-asyncio-fast>=0.16
Requires-Dist: pyserial>=3.5
Description-Content-Type: text/markdown

# smartmeter-austria

Python library that reads Austrian smart meters from their customer
interface (optical head or M-Bus/P1 port), decrypts the telegrams and
returns the readings. It contains no Home Assistant or MQTT code.

It is the core of two projects in the same repository,
[r00tat/smartmeter_homeassistant_burgenland](https://github.com/r00tat/smartmeter_homeassistant_burgenland):

- the Home Assistant integration **Smartmeter Austria** (`smartmeter_at`, via HACS),
- the Home Assistant add-on / standalone container that publishes the
  readings via MQTT.

## Supported meters

| Profile | Grid operator / meter | Interface |
| --- | --- | --- |
| `burgenland` | Netz Burgenland (Landis+Gyr E450) | IR or wired, DLMS/HDLC |
| `noe_evn` | Netz NÖ / EVN (Sagemcom T210-D) | M-Bus |
| `wien` | Wiener Netze | IR, DLMS/HDLC |
| `steiermark` | Energienetze Steiermark (Landis+Gyr) | M-Bus |
| `steiermark_sagemcom` | Energienetze Steiermark (Sagemcom) | DSMR P1 |
| `salzburg` | Salzburg Netz | M-Bus |
| `tirol` | TINETZ | M-Bus |
| `h1` | Smart Meter 2.0, customer interface H1 | DSMR P1 |

Details per meter: [docs/en/meters.md](https://github.com/r00tat/smartmeter_homeassistant_burgenland/blob/main/docs/en/meters.md).

## Installation

```bash
pip install smartmeter-austria
```

## Usage

```python
import asyncio

from smartmeter_austria.profile import get_profile


def on_reading(data) -> None:
    print(data.meter_id, data.to_dict())


async def main() -> None:
    profile = get_profile("burgenland")
    config = {
        "interface_type": "OPTICAL",
        "dlms": {"port": "/dev/ttyUSB0", "key": "<32 hex characters from your grid operator>"},
    }
    reader = profile.create_reader(config, on_reading)
    await reader.run()  # reads until cancelled


asyncio.run(main())
```

`smartmeter_austria.supervisor.ReaderSupervisor` restarts a failed reader,
throttles the callback and reopens a port that stopped delivering data.

## Versioning

The library is released together with the integration and the add-on: one
GitHub release publishes all three with the same version number.

## License

GPL-3.0-only
