Async Python client for the WattWächter smart meter API
Project description
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())
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.
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file aio_wattwaechter-1.1.0.tar.gz.
File metadata
- Download URL: aio_wattwaechter-1.1.0.tar.gz
- Upload date:
- Size: 23.1 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
062cf0a0caa472db71259ea38a9ccc80f3cf708fabde298203ad6ae47c2792f5
|
|
| MD5 |
ef528747fd8abe1f25061eeb9cd7fbd2
|
|
| BLAKE2b-256 |
b03d545c3b0aa8076ad28a4c2f6d94925bf543fc97655ea276ca468d305dabf8
|
Provenance
The following attestation bundles were made for aio_wattwaechter-1.1.0.tar.gz:
Publisher:
publish.yaml on SmartCircuits-GmbH/WattWaechter-PyPI
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
aio_wattwaechter-1.1.0.tar.gz -
Subject digest:
062cf0a0caa472db71259ea38a9ccc80f3cf708fabde298203ad6ae47c2792f5 - Sigstore transparency entry: 1363165596
- Sigstore integration time:
-
Permalink:
SmartCircuits-GmbH/WattWaechter-PyPI@f4afddef82644d8ef8a7733bb6be00470f4deb51 -
Branch / Tag:
refs/tags/v1.1.0 - Owner: https://github.com/SmartCircuits-GmbH
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish.yaml@f4afddef82644d8ef8a7733bb6be00470f4deb51 -
Trigger Event:
release
-
Statement type:
File details
Details for the file aio_wattwaechter-1.1.0-py3-none-any.whl.
File metadata
- Download URL: aio_wattwaechter-1.1.0-py3-none-any.whl
- Upload date:
- Size: 17.4 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
8255197899a39c33d8772fea22e02ebb860e17c07dae032a54c214be94bdf2dc
|
|
| MD5 |
ea0e65ec3c92ef6858a5c09c4198c6b8
|
|
| BLAKE2b-256 |
22bb94391ebeeac174048440ae0fa7edf76d8b30e8d437683e37d29caac64aee
|
Provenance
The following attestation bundles were made for aio_wattwaechter-1.1.0-py3-none-any.whl:
Publisher:
publish.yaml on SmartCircuits-GmbH/WattWaechter-PyPI
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
aio_wattwaechter-1.1.0-py3-none-any.whl -
Subject digest:
8255197899a39c33d8772fea22e02ebb860e17c07dae032a54c214be94bdf2dc - Sigstore transparency entry: 1363165675
- Sigstore integration time:
-
Permalink:
SmartCircuits-GmbH/WattWaechter-PyPI@f4afddef82644d8ef8a7733bb6be00470f4deb51 -
Branch / Tag:
refs/tags/v1.1.0 - Owner: https://github.com/SmartCircuits-GmbH
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish.yaml@f4afddef82644d8ef8a7733bb6be00470f4deb51 -
Trigger Event:
release
-
Statement type: