Skip to main content

aio-wattwaechter

Async Python client for the WattWächter smart meter API.

Installation

pip install aio-wattwaechter

Usage

import asyncio
from aio_wattwaechter import Wattwaechter

async def main():
    # No token needed if authentication is disabled (factory default)
    async with Wattwaechter("192.168.1.100") as client:
        # Check device connectivity
        alive = await client.alive()
        print(f"Device online: {alive.alive}, firmware: {alive.version}")

        # Get current meter readings
        data = await client.meter_data()
        if data:
            print(f"Power: {data.power} W")
            print(f"Total consumption: {data.total_consumption} kWh")

            # Access any OBIS code (short format, e.g. "1.8.0")
            for code, value in data.values.items():
                print(f"  {value.name} ({code}): {value.value} {value.unit}")

        # Get system diagnostics
        info = await client.system_info()
        print(f"WiFi RSSI: {info.get_value('wifi', 'RSSI')} dBm")

        # Check for firmware updates
        ota = await client.ota_check()
        if ota.data.update_available:
            print(f"Update available: {ota.data.version}")

        # Get 15-minute resolution history
        history = await client.history_high_res("2024-03-08")
        for entry in history.items:
            print(f"  {entry.date}: {entry.power_w} W")
        print(f"  Total import: {history.import_total_kwh} kWh")

        # Get device logs
        ram_log = await client.logs_ram()
        print(f"RAM log: {len(ram_log)} bytes")

asyncio.run(main())

Gas and water (WattWächter Gas / Wasser)

Gas/water devices (model IDs ww_gw_mf, ww_gw_id) report full OBIS codes (7-0:3.0.0 gas volume in m³, 7-0:43.0.0 gas flow in m³/h, 8-0:1.0.0 water volume, 8-0:2.0.0 water flow). The medium can be switched on the device at runtime, which also switches the OBIS codes.

info = await client.system_info()
print(info.product_name, info.model_id)  # "WattWächter Gas", "ww_gw_mf"

data = await client.meter_data()
if data and data.is_volume_meter:
    print(f"{data.medium}: {data.volume} m³, {data.flow} m³/h")
    print(f"Sensor ok: {data.gw.ok if data.gw else None}")

history = await client.history_low_res("2024-03-01", 7)
print(history.unit)  # "m³" on gas/water, "kWh" on electricity
for day in history.items:
    print(day.date, day.import_total, day.consumption)
print(history.consumption)

Authentication

By default, the WattWächter device ships with authentication disabled. You can connect without a token:

client = Wattwaechter("192.168.1.100")

When authentication is enabled on the device, it uses two tokens:

  • READ token — for reading data (meter values, settings, diagnostics)
  • WRITE token — for modifying settings, starting OTA updates, rebooting
# Read-only access
client = Wattwaechter("192.168.1.100", token="your-read-token")

# Full access (read + write)
client = Wattwaechter("192.168.1.100", token="your-write-token")

Automatic Retry

The client automatically retries requests when the device returns 429 (rate limit) or 503 (busy). By default, up to 3 attempts are made, respecting the Retry-After header:

# Default: 3 retries
client = Wattwaechter("192.168.1.100")

# Customize retry behavior
client = Wattwaechter("192.168.1.100", max_retries=5)

# Disable retries
client = Wattwaechter("192.168.1.100", max_retries=1)

API Coverage

Category Endpoints
System alive, system_info, led, selftest, wifi_scan, timezones, reboot
Meter Data meter_data, history_high_res, history_low_res
Logs logs_rawdump, logs_persistent, logs_ram
OTA ota_check, ota_start
Settings settings, update_settings
Auth generate_tokens, confirm_tokens, setup_token
MQTT mqtt_ca_status, mqtt_ca_upload, mqtt_ca_delete, mqtt_status
Modbus TCP modbus_status
Cloud cloud_pair, cloud_unpair

Using with Home Assistant

This library is the foundation for the WattWächter Home Assistant integration. You can pass an existing aiohttp.ClientSession:

from aio_wattwaechter import Wattwaechter

client = Wattwaechter(
    "192.168.1.100",
    token="your-token",
    session=existing_session,  # reuse HA's session
)

License

Apache License 2.0 — see LICENSE for details.

Metadata

Release files for aio-wattwaechter 1.4.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 aio-wattwaechter 1.4.0
File Size Uploaded Provenance Actions
aio_wattwaechter-1.4.0.tar.gz 30.5 kB With provenance Details for aio_wattwaechter-1.4.0.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for aio-wattwaechter 1.4.0
File Interpreter ABI Platform Actions
aio_wattwaechter-1.4.0-py3-none-any.whl Python 3 none any Details for aio_wattwaechter-1.4.0-py3-none-any.whl

Total release size: 51.7 kB

Release files / aio_wattwaechter-1.4.0.tar.gz

Download URL aio_wattwaechter-1.4.0.tar.gz
Size 30.5 kB
Tags Source
SHA-256 checksum
How to use checksums
e8c148807ec3e8dacae07842ef075a14982736424c8f9503ada808959fc27dda
BLAKE2b-256 checksum
How to use checksums
b24329a6458dfcf6eda8658f2372b72f970f56a5cc1228e9c4801826a74aada2
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 19, 2026.

Transparency log

Release files / aio_wattwaechter-1.4.0-py3-none-any.whl

Download URL aio_wattwaechter-1.4.0-py3-none-any.whl
Size 21.2 kB
Tags Python 3
SHA-256 checksum
How to use checksums
b3faec023844daa4652882420e9c062f4f1d93ec630bfa310a78fc390b90a0fb
BLAKE2b-256 checksum
How to use checksums
d5c8104205b522384df07d035bdb6d4fe04c1efd4d43568fcbb59afb839d8dd5
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 19, 2026.

Transparency log

Security for aio-wattwaechter 1.4.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.

Select from 2 files

Attestation for aio_wattwaechter-1.4.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 19, 2026.

Transparency log

A 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.

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