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.1.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.1-py3-none-any.whl (4.4 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: zendure_p1-0.1.1.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.1.tar.gz
Algorithm Hash digest
SHA256 93a0a5419e06c967e33d3713fae5ba7264207aabc9a56333fd3059e8ec3fc6fa
MD5 76ab5145d21f911ec03983cd075842ed
BLAKE2b-256 517853456b424819ed8bb43cb5976ee447c00b9b2908051aa4277dcfb01a320d

See more details on using hashes here.

Provenance

The following attestation bundles were made for zendure_p1-0.1.1.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.1-py3-none-any.whl.

File metadata

  • Download URL: zendure_p1-0.1.1-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.1-py3-none-any.whl
Algorithm Hash digest
SHA256 6c357ec565fec4e778db8f1734f79eab5874ea7738919f7266af4c9d7a57fd30
MD5 d5931865bbb8df3b1cd9778986f12628
BLAKE2b-256 c42a2bb0912cd3217f0ad3b7ea1343bfecf4e92fa4ddbb02ac5416419f48cc58

See more details on using hashes here.

Provenance

The following attestation bundles were made for zendure_p1-0.1.1-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