Async Python library for communicating with Zendure P1 Smart Meter
Project description
zendure-p1
Asynchronous Python library for communicating with Zendure P1 Smart Meter.
Installation
pip install zendure-p1
Usage
import asyncio
from zendure_p1 import ZendureP1Client
async def main():
async with ZendureP1Client("192.168.1.100") as client:
report = await client.get_report()
print(f"Total power: {report.total_power} W")
print(f"Phase A: {report.a_apparent_power} W")
print(f"Phase B: {report.b_apparent_power} W")
print(f"Phase C: {report.c_apparent_power} W")
asyncio.run(main())
Error handling
from zendure_p1 import ZendureP1Client
from zendure_p1.exceptions import (
ZendureP1ConnectionError,
ZendureP1TimeoutError,
ZendureP1ResponseError,
)
async with ZendureP1Client("192.168.1.100", timeout=5.0) as client:
try:
report = await client.get_report()
except ZendureP1ConnectionError:
print("Could not connect to the device")
except ZendureP1TimeoutError:
print("Request timed out")
except ZendureP1ResponseError as e:
print(f"Device returned an error: {e}")
Model
Report
Returned by client.get_report(). All power values are in watts.
| Field | Type | Description |
|---|---|---|
timestamp |
int |
Unix timestamp of the measurement |
a_apparent_power |
int |
Apparent power on phase A |
b_apparent_power |
int |
Apparent power on phase B |
c_apparent_power |
int |
Apparent power on phase C |
total_power |
int |
Total power across all phases |
License
MIT
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 zendure_p1-0.1.0.tar.gz.
File metadata
- Download URL: zendure_p1-0.1.0.tar.gz
- Upload date:
- Size: 58.2 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
049f84ab331a37359c59051a23fbb1cce85001026dde4139d6a9b278ec395ca6
|
|
| MD5 |
28daa9a4a5d8899839b22003909db629
|
|
| BLAKE2b-256 |
67ac9a8370bc8a620cc9a7a2f2119773df1c67e8565323a90de05c4fb2fd1d64
|
Provenance
The following attestation bundles were made for zendure_p1-0.1.0.tar.gz:
Publisher:
release.yml on NextNebula/zendure-p1
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
zendure_p1-0.1.0.tar.gz -
Subject digest:
049f84ab331a37359c59051a23fbb1cce85001026dde4139d6a9b278ec395ca6 - Sigstore transparency entry: 1511627898
- Sigstore integration time:
-
Permalink:
NextNebula/zendure-p1@d66bd31e588fd496db74db02a66a24932a24fc3d -
Branch / Tag:
refs/tags/v0.1.0 - Owner: https://github.com/NextNebula
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
release.yml@d66bd31e588fd496db74db02a66a24932a24fc3d -
Trigger Event:
push
-
Statement type:
File details
Details for the file zendure_p1-0.1.0-py3-none-any.whl.
File metadata
- Download URL: zendure_p1-0.1.0-py3-none-any.whl
- Upload date:
- Size: 4.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 |
24896dea2f38ac2eaa678c1e697cf4026ec32067db22f6293ed13cb11f246acb
|
|
| MD5 |
0ddbfcb4c47d08fd04d89821ce04d4e1
|
|
| BLAKE2b-256 |
5dba7120903c0a4259c6f325d6aa530f348a1748994614ef80487a51a17e6bf6
|
Provenance
The following attestation bundles were made for zendure_p1-0.1.0-py3-none-any.whl:
Publisher:
release.yml on NextNebula/zendure-p1
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
zendure_p1-0.1.0-py3-none-any.whl -
Subject digest:
24896dea2f38ac2eaa678c1e697cf4026ec32067db22f6293ed13cb11f246acb - Sigstore transparency entry: 1511628173
- Sigstore integration time:
-
Permalink:
NextNebula/zendure-p1@d66bd31e588fd496db74db02a66a24932a24fc3d -
Branch / Tag:
refs/tags/v0.1.0 - Owner: https://github.com/NextNebula
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
release.yml@d66bd31e588fd496db74db02a66a24932a24fc3d -
Trigger Event:
push
-
Statement type: