Skip to main content

Hypontech Cloud API Python Library

CI codecov PyPI version Python versions License: MIT

A Python library for interacting with the Hypontech Cloud API for solar inverter monitoring.

Features

  • Async/await support using aiohttp
  • Get plant overview data (power, energy production, device status)
  • Get plant list
  • Get plant monitor data (real-time energy, power, earnings, environmental impact)
  • Get inverter list for each plant
  • Get battery list for each plant
  • Get administrator information
  • Automatic token management and refresh
  • Built-in retry logic for rate limiting
  • Type hints for better IDE support
  • Known OEM metadata for UI dropdowns
  • Comprehensive error handling

Installation

pip install hyponcloud

Quick Start

Running the Example Script

example.py accepts credentials and an optional OEM ID as command-line arguments:

python example.py <username> <password> [oem]

OEM defaults to 0 (Hypon). For non-default OEM accounts, pass an OEM ID from the exported KNOWN_OEMS list, for example Nexen:

python example.py <username> <password> 4

It can also read credentials from environment variables:

HYPONCLOUD_USERNAME=your_username HYPONCLOUD_PASSWORD=your_password HYPONCLOUD_OEM=4 python example.py

Or from a .env file next to example.py:

HYPONCLOUD_USERNAME=your_username
HYPONCLOUD_PASSWORD=your_password
HYPONCLOUD_OEM=4

Basic Usage

import asyncio
from hyponcloud import HyponCloud, KNOWN_OEMS

async def main():
    # Build dropdown choices for selecting an OEM
    oem_choices = [(oem.id, oem.name) for oem in KNOWN_OEMS]

    # Create client with your credentials
    async with HyponCloud("your_username", "your_password") as client:
        # Connect and authenticate
        await client.connect()

        # Get overview data
        overview = await client.get_overview()
        print(f"Current power: {overview.power}W")
        print(f"Today's energy: {overview.e_today}kWh")
        print(f"Total energy: {overview.e_total}kWh")

        # Get plant list
        plants = await client.get_list()
        print(f"Number of plants: {len(plants)}")

        # Get inverters for a specific plant
        if plants:
            inverters = await client.get_inverters(plants[0].plant_id)
            print(f"Number of inverters: {len(inverters)}")
            for inverter in inverters:
                print(f"  {inverter.model}: {inverter.power}W")

        # Get batteries for a specific plant
        if plants:
            batteries = await client.get_batteries(plants[0].plant_id)
            print(f"Number of batteries: {len(batteries)}")
            for battery in batteries:
                print(f"  {battery.manufacturer}: {battery.soc:g}%")

        # Get real-time monitor data for a specific plant
        if plants:
            monitor = await client.get_monitor(plants[0].plant_id)
            print(f"Today's energy: {monitor.e_today}kWh")
            print(f"Performance: {monitor.percent:g}%")
            print(f"Total earnings: {monitor.total_earning} {monitor.monetary}")

        # Get administrator information
        admin = await client.get_admin_info()
        print(f"Admin user: {admin.username}")
        print(f"Email: {admin.email}")

asyncio.run(main())

For non-default OEM accounts, pass the OEM ID from KNOWN_OEMS:

nexen_oem = next(oem for oem in KNOWN_OEMS if oem.name == "Nexen")

async with HyponCloud("your_username", "your_password", oem=nexen_oem.id) as client:
    await client.connect()

Using with Custom aiohttp Session

import aiohttp
from hyponcloud import HyponCloud

async def main():
    async with aiohttp.ClientSession() as session:
        client = HyponCloud("your_username", "your_password", session=session)

        await client.connect()
        overview = await client.get_overview()
        print(f"Power: {overview.power}W")

asyncio.run(main())

Configuring Retries

You can configure retry behavior globally at the client level, or override it per method call. Authenticated GET request timeouts are retried the same way as transient request failures:

from hyponcloud import HyponCloud

async def main():
    # Set global retries to 5 for all API calls
    async with HyponCloud("username", "password", retries=5) as client:
        await client.connect()

        # Uses 5 retries (global setting)
        overview = await client.get_overview()

        # Override for specific call (uses 1 retry)
        plants = await client.get_list(retries=1)

        # Disable retries for this call
        admin = await client.get_admin_info(retries=0)

asyncio.run(main())

Error Handling

from hyponcloud import (
    HyponCloud,
    RequestError,
    AuthenticationError,
    RateLimitError,
)

async def main():
    try:
        async with HyponCloud("username", "password") as client:
            await client.connect()
            overview = await client.get_overview()
            print(f"Power: {overview.power}W")

    except AuthenticationError as e:
        print(f"Authentication failed: {e}")
    except RateLimitError as e:
        print(f"Rate limit exceeded: {e}")
    except RequestError as e:
        print(f"Connection error or timeout: {e}")

asyncio.run(main())

Logging

The library logs each API request and response status at the DEBUG level using the standard logging module, under the hyponcloud logger. Credentials and the authentication token are never logged. Enable it to see the requests being made:

import logging

logging.getLogger("hyponcloud").setLevel(logging.DEBUG)

This is independent of the debug constructor argument, which instead prints full HTTP responses (with the token redacted) to stdout.

API Reference

See API.md for the full API reference.

Development

Setup Development Environment

# Clone the repository
git clone https://github.com/jcisio/hyponcloud.git
cd hyponcloud

# Install development dependencies
pip install -e ".[dev]"

# Set up pre-commit hooks (optional but recommended)
pre-commit install

Running Tests

pytest

Code Formatting

ruff check .
ruff format .

Type Checking

mypy hyponcloud

Version Management

This project uses setuptools-scm for automatic version management:

  • Versions are automatically determined from git tags
  • Use semantic versioning (e.g., v0.1.2)
  • Create a git tag and push to trigger automated publishing via GitHub Actions
git tag v0.1.2
git push origin v0.1.2

Requirements

  • Python 3.11+
  • aiohttp 3.8.0+
  • mashumaro 3.11+

Build Requirements

  • setuptools-scm 8.0+ (automatically installed during build for version management)

License

This project is licensed under the MIT License - see the LICENSE file for details.

Contributing

Contributions are welcome! Please feel free to submit a Pull Request.

Disclaimer

This library is not officially associated with or endorsed by Hypontech. Use at your own risk.

Support

For issues, questions, or contributions, please visit the GitHub repository.

Metadata

Release files for hyponcloud 1.0.2

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for hyponcloud 1.0.2
File Size Uploaded
hyponcloud-1.0.2.tar.gz 30.5 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for hyponcloud 1.0.2
File Interpreter ABI Platform
hyponcloud-1.0.2-py3-none-any.whl Python 3 none any Details

Total release size: 42.7 kB

Release files / hyponcloud-1.0.2.tar.gz

Download URL hyponcloud-1.0.2.tar.gz
Size 30.5 kB
Tags Source
SHA-256 checksum
How to use checksums
556775ef52d5dbc92284d85b7f3447db47194b9d3d876653348694832bab0824
BLAKE2b-256 checksum
How to use checksums
e5558f71aa88c991595bb57f3789bd2cd6b6e950ff72071024bfde4c1018629a
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 Sep 9, 2026.

Transparency log

Release files / hyponcloud-1.0.2-py3-none-any.whl

Download URL hyponcloud-1.0.2-py3-none-any.whl
Size 12.2 kB
Tags Python 3
SHA-256 checksum
How to use checksums
50451446cb0d6976d5c5d75c3fe7f11c39ac2fd4473c3fd4e05ba9a1bbb56001
BLAKE2b-256 checksum
How to use checksums
256fd7affe90fdfbfb3856ee81014b327eff3fc7216b36344c9e5979f508446f
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 Sep 9, 2026.

Transparency log

Release history Release notifications | RSS feed

This release

1.0.2 This release

2 release files

1.0.1

2 release files

1.0.0

2 release files

0.9.4

2 release files

0.9.3

2 release files

0.9.2

2 release files

0.9.1

2 release files

0.9.0

2 release files

0.3.0

2 release files

0.2.3

2 release files

0.2.2

2 release files

0.2.1

2 release files

0.2.0

2 release files

0.1.2

2 release files

0.1.1

2 release files

0.1.0

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page