Skip to main content

Python interface to the Combined Energy API

Project description

Python: Asynchronous client for Combined Energy API

Provides an async Python 3.11+ interface for the http://combined.energy/ monitoring platform API.

Testing Coverage Maintainability Rating PyPI PyPI - License Code style: black

Note this API client is reverse engineered from observing requests being made in the web-application. Please report any failures to read data, this is likely to occur for readings as I am only able to create entries for devices that I have.

Installation

Install from PyPI

python3 -m pip install combined-energy-api

Usage

import asyncio

from combined_energy import CombinedEnergy
from combined_energy.helpers import ReadingsIterator

async def main():
    """
    Example using Combined Energy API client.
    """

    async with CombinedEnergy(
        mobile_or_email="user@example.com",
        password="YOUR_COMBINED_ENERGY_PASSWORD",
        installation_id=9999,
    ) as combined_energy:

        status = await combined_energy.communication_status()
        print(status)

        # To generate a stream of readings use the iterator, this example fetches
        # data in 5 minute increments
        async for readings in ReadingsIterator(combined_energy, increment=300):
            print(readings)
            await asyncio.sleep(300)

asyncio.run(main())

Development Environment

You will need:

  • Python 3.11+
  • poetry
  • pre-commit

Ensure pre-commit is installed into your git repository with pre-commit install.

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

combined_energy_api-1.0.tar.gz (18.2 kB view details)

Uploaded Source

Built Distribution

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

combined_energy_api-1.0-py3-none-any.whl (12.0 kB view details)

Uploaded Python 3

File details

Details for the file combined_energy_api-1.0.tar.gz.

File metadata

  • Download URL: combined_energy_api-1.0.tar.gz
  • Upload date:
  • Size: 18.2 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.0.1 CPython/3.9.21

File hashes

Hashes for combined_energy_api-1.0.tar.gz
Algorithm Hash digest
SHA256 f83d5456e95262d11152bc78a791127fe92e1a620149e0ae90919bfb34f46fec
MD5 a4793e22a8fa70104b22519a74a72c19
BLAKE2b-256 5bd6e108fc9509a0ce650757d76e21361478517cf67bfe94dce0dbe4cb7ea72b

See more details on using hashes here.

File details

Details for the file combined_energy_api-1.0-py3-none-any.whl.

File metadata

File hashes

Hashes for combined_energy_api-1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 67d21a2a11fa8e25fc3dddc28b2e7422b6fca2012956e4485b89c0e16e3d5675
MD5 5a047f0eb284d9178e4f3e8097a2ed3d
BLAKE2b-256 6f2d9c2117b0081c1bf3ad25209e1bed165d007b6c76a5660940c9f045bcf5d9

See more details on using hashes here.

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