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

Uploaded Python 3

File details

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

File metadata

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

File hashes

Hashes for combined_energy_api-1.0.1.tar.gz
Algorithm Hash digest
SHA256 f265a053ed1b122e176845d6248e7d77c5021a175d3d4589046ba57a901f8abb
MD5 ae555861d77b15f7dabed11f7fdec4bc
BLAKE2b-256 b727cb7d27f834b57d8893c8f9c894764521c7a6ac16bbb6f4e59cb967f667c8

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for combined_energy_api-1.0.1-py3-none-any.whl
Algorithm Hash digest
SHA256 2f5bf22d8513d1d3dc80c4aba0ab20f393b77a139ead07ae0bb6c709aa759f49
MD5 13874e5d5bd6a94f5786721e4c9dc062
BLAKE2b-256 0d4b179c234931e3efb2028c2f900fde094debe12fa6dfa2b22f1ae5fad3966a

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