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.2.0
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | |
|---|---|---|---|
| aio_wattwaechter-1.2.0.tar.gz | 29.2 kB | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| aio_wattwaechter-1.2.0-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 49.7 kB
Release files / aio_wattwaechter-1.2.0.tar.gz
| Download URL | aio_wattwaechter-1.2.0.tar.gz |
|---|---|
| Size | 29.2 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
824f8afd7b387ec1b036a2c12cdf65e91374a72034689db6610e7c939ab05e78
|
|
BLAKE2b-256 checksum How to use checksums |
2e56cc7d25f98639657ae168ba17a57899ca5c2b7d23ea0bb226d33f1db15b69
|
| 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 Oct 2, 2026.
Transparency logRelease files / aio_wattwaechter-1.2.0-py3-none-any.whl
| Download URL | aio_wattwaechter-1.2.0-py3-none-any.whl |
|---|---|
| Size | 20.6 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
8ebd841fc8eaad896f05bb02f83c4fcd849e15599a5e4372a6e2cc50da86d3bb
|
|
BLAKE2b-256 checksum How to use checksums |
387cdfb0d57755e1105b3acee287f4595a28478e8d0c9b116ccade5fd8927f36
|
| 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 Oct 2, 2026.
Transparency log