Skip to main content

Async Python library for communicating with Zendure P1 Smart Meter

Project description

zendure-p1

Async 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
device_id str Unique device identifier
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


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

zendure_p1-0.1.2.tar.gz (58.2 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

zendure_p1-0.1.2-py3-none-any.whl (4.4 kB view details)

Uploaded Python 3

File details

Details for the file zendure_p1-0.1.2.tar.gz.

File metadata

  • Download URL: zendure_p1-0.1.2.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

Hashes for zendure_p1-0.1.2.tar.gz
Algorithm Hash digest
SHA256 3271da60e4b6d9b0b370b1a86ecdcb56adfec59051a25a663a6ef5dc79ad2093
MD5 a1a573e52f5fc5abed583f129e8d1ad5
BLAKE2b-256 93148f8c99dcade1d483f78c16c5976735d41d6e7572645150fdbe73d2036c8f

See more details on using hashes here.

Provenance

The following attestation bundles were made for zendure_p1-0.1.2.tar.gz:

Publisher: release.yml on NextNebula/zendure-p1

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file zendure_p1-0.1.2-py3-none-any.whl.

File metadata

  • Download URL: zendure_p1-0.1.2-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

Hashes for zendure_p1-0.1.2-py3-none-any.whl
Algorithm Hash digest
SHA256 df1a6ae411baff4946fb6f4bc68f63e20ccb672b5d10dbac1107aa7726fd7dd6
MD5 c9f14f0f8bab767b4524ad6db740f93a
BLAKE2b-256 ea4111f9173a12dae1d56d3400d9a3861f3fbb2041a4edef46559277745208fa

See more details on using hashes here.

Provenance

The following attestation bundles were made for zendure_p1-0.1.2-py3-none-any.whl:

Publisher: release.yml on NextNebula/zendure-p1

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page