Skip to main content

Async Python client for the Ecobulles cloud API

Project description

pyecobulles

CI codecov PyPI

pyecobulles is an unofficial async Python client for the Ecobulles cloud API.

Ecobulles is a French CO2-based water treatment system used as an alternative to salt water softeners. Connected Ecobulles boxes expose water consumption, CO2 injection counters, device metadata, and alert information through the same cloud API used by the mobile/application ecosystem.

This library provides a small, reusable Python interface to that cloud API. It is intentionally focused on transport and raw API access so higher-level projects, such as Home Assistant integrations, can decide how to model sensors, statistics, diagnostics, and user-facing behavior.

Features

  • Async API client built for aiohttp.
  • Login with Ecobulles account credentials.
  • Fetch Ecobulles device metadata.
  • Fetch cumulative water usage and raw CO2/gas counter data.
  • Fetch the full login payload for integrations that need alert details.
  • No credential storage: callers own secrets, sessions, persistence, and scheduling.
  • Typed package (py.typed) for downstream users.

Installation

pip install pyecobulles

Quick start

import asyncio

from aiohttp import ClientSession
from pyecobulles import EcobullesClient


async def main() -> None:
    async with ClientSession() as session:
        client = EcobullesClient(session=session)

        authenticated, user_id, eco_ref, box_name = await client.authenticate(
            "user@example.com",
            "password",
        )
        if not authenticated or eco_ref is None:
            raise RuntimeError("Ecobulles authentication failed")

        usage = await client.get_total_water_and_co2_usage(eco_ref)
        device = await client.get_device_info(eco_ref)

        print(f"Box: {box_name}")
        print(f"User id: {user_id}")
        print(f"Eco ref: {eco_ref}")
        print(f"Usage: {usage}")
        print(f"Device: {device}")


asyncio.run(main())

API overview

EcobullesClient(session, now_fn=None)

Create a client using an injected aiohttp.ClientSession.

The caller owns the session lifecycle. This keeps the library suitable for applications that already manage connection pooling, such as Home Assistant.

now_fn is optional and mainly useful for tests. It controls the stop date used by get_total_water_and_co2_usage().

authenticate(email, password)

Authenticate against the Ecobulles cloud API.

Returns:

(authenticated, user_id, eco_ref, box_name)

where:

  • authenticated is a boolean;
  • user_id is the Ecobulles account/user identifier when available;
  • eco_ref is the Ecobulles box reference used by other endpoints;
  • box_name is the box name returned by the API when available.

get_login_payload(email, password)

Return the raw login payload.

This is useful for integrations that need fields exposed only in the login response, such as current alert information.

get_device_info(eco_ref)

Return raw device metadata for an Ecobulles box.

The payload may include fields such as:

  • box name;
  • serial number;
  • firmware version;
  • installation date;
  • last cloud receive date;
  • activation / lock / suspension status;
  • alerts, depending on the endpoint response.

get_total_water_and_co2_usage(eco_ref)

Return normalized cumulative usage data:

{
    "total_gas": 72996000,
    "total_eau": 193651,
    "last_updated": "2026-05-21T21:17:58",
}

Current understanding of the fields:

  • total_eau is the water usage reported by the Ecobulles API, in liters.
  • total_gas appears to be the cumulative CO2 electrovalve open time, in milliseconds, not a direct mass of CO2.
  • last_updated is derived from the latest graph entry when available.

The library does not convert CO2 valve-open time into kilograms. That requires product-specific assumptions or calibration and should be handled by the application using the library.

Design philosophy

pyecobulles deliberately keeps the API representation close to what the Ecobulles cloud returns. It does not try to turn raw payloads into Home Assistant entities, dashboards, statistics, or long-term water accounting.

That separation keeps the package useful outside Home Assistant and avoids hiding API behavior behind assumptions that may not hold for every installation.

Known limitations

  • This is an unofficial client and is not affiliated with Ecobulles.
  • The Ecobulles cloud API is not publicly documented.
  • Endpoint behavior may change without notice.
  • Model/gamme information is not currently exposed clearly by the observed API payloads.
  • CO2 mass usage is not directly exposed by the API; only the raw gas counter is available.

Home Assistant

This package is used by the custom Home Assistant integration ha_ecobulles.

Home Assistant-specific behavior, such as sensors, diagnostics, translations, water-cycle accounting, and estimated CO2 bottle usage, belongs in that integration rather than in this library.

Development

For contributors:

python -m pip install -r requirements_dev.txt
pytest -q --cov
mypy pyecobulles
python -m build

License

Apache-2.0

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

pyecobulles-0.1.1.tar.gz (9.6 kB view details)

Uploaded Source

Built Distribution

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

pyecobulles-0.1.1-py3-none-any.whl (10.4 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: pyecobulles-0.1.1.tar.gz
  • Upload date:
  • Size: 9.6 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.12

File hashes

Hashes for pyecobulles-0.1.1.tar.gz
Algorithm Hash digest
SHA256 1e67dd5dd07b1d969bdb24cf999639cc7ab1b2112d09e1fdb5f15b0a85377663
MD5 3c51107601ed36c5f53f51a2e1b9b193
BLAKE2b-256 1a6877f40925fd9f895d3329c5d28ff04e9f33ee1e8324f0f581c51dc948f4ba

See more details on using hashes here.

Provenance

The following attestation bundles were made for pyecobulles-0.1.1.tar.gz:

Publisher: publish.yml on jul-fls/pyecobulles

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

File details

Details for the file pyecobulles-0.1.1-py3-none-any.whl.

File metadata

  • Download URL: pyecobulles-0.1.1-py3-none-any.whl
  • Upload date:
  • Size: 10.4 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.12

File hashes

Hashes for pyecobulles-0.1.1-py3-none-any.whl
Algorithm Hash digest
SHA256 89a1535c3627781a1eb5474635c98505e6b390eee271e2ad9c0ab855da944e18
MD5 ee91ec1d11f8c5b47aef759f9ff63049
BLAKE2b-256 3f720abe70e527dacb38ce8c5185f902b06c40b1cbb34a311286e906fe549d65

See more details on using hashes here.

Provenance

The following attestation bundles were made for pyecobulles-0.1.1-py3-none-any.whl:

Publisher: publish.yml on jul-fls/pyecobulles

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