Skip to main content

Python library for controlling and monitoring EcoFlow energy devices

Project description

ecoflow-python

Python library for controlling and monitoring EcoFlow energy devices — batteries, smart plugs, smart meters, and more.

Supported Devices

Device Read Control
STREAM Ultra
STREAM AC Pro
Smart Plug
Smart Home Meter
Delta Pro / Pro 3 / 2 / 2 Max
River Pro / 2 / 2 Max / 2 Pro
PowerStream (600W / 800W)
Wave 3 AC
Smart Home Panel 2 ⚠️ partial

Installation

pip install ecoflow-python
# or with uv
uv add ecoflow-python

Quick Start

import asyncio
from ecoflow import EcoFlowClient

async def main():
    async with EcoFlowClient(
        access_key="your_access_key",
        secret_key="your_secret_key",
        region="EU",    # or "US"
    ) as client:
        # All devices auto-discovered on connect
        print(f"Batteries:    {client.batteries}")
        print(f"Plugs:        {client.plugs}")
        print(f"Stream units: {client.stream_units}")
        print(f"Meter:        {client.meters}")

        # Read live data
        for battery in client.batteries:
            status = await battery.refresh()
            print(f"{battery.product_name}: {status.batt_soc:.0f}% SOC")

        # Events stream (MQTT, real-time)
        async for event in client.stream_units[0].events():
            print(f"SOC: {event.batt_soc:.0f}%")

asyncio.run(main())

Getting API Keys

  1. Create an account at ecoflow.com
  2. Go to the Developer Portal: EU | US
  3. Apply for Developer Access
  4. Find your accessKey and secretKey in the developer console

See the EcoFlow Developer Portal (EU) or developer.ecoflow.com (US) for API key instructions.

Architecture

  • Transport: REST (/iot-open/sign/device/quota/all) + MQTT (/open/{account}/{sn}/quota)
  • Auth: HMAC-SHA256 signed headers on every REST call
  • Events: Real-time MQTT push with automatic reconnection and exponential backoff
  • Typing: Fully typed with py.typed marker — works with mypy and pyright

Development

git clone https://github.com/colombod/ecoflow-sdk
cd ecoflow-sdk/python
uv sync --all-extras
uv run pytest                              # unit tests
uv run pytest -m integration              # read-only E2E (needs tests/.env)
uv run ruff check . && uv run pyright     # lint + types

License

MIT — see LICENSE

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

ecoflow_python-0.1.0.tar.gz (44.2 kB view details)

Uploaded Source

Built Distribution

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

ecoflow_python-0.1.0-py3-none-any.whl (31.1 kB view details)

Uploaded Python 3

File details

Details for the file ecoflow_python-0.1.0.tar.gz.

File metadata

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

File hashes

Hashes for ecoflow_python-0.1.0.tar.gz
Algorithm Hash digest
SHA256 ccc9e37733c5a6474f130a8adfece02c93f85ab808224ed570f56944e14b3d45
MD5 8d2961f35fb55b5fffd434cdc5a1ecce
BLAKE2b-256 6595aaecd4b71994859b97dbd871fccabec9fd7cb28082f9da00553e1c0cf14b

See more details on using hashes here.

Provenance

The following attestation bundles were made for ecoflow_python-0.1.0.tar.gz:

Publisher: python-release.yml on colombod/ecoflow-sdk

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

File details

Details for the file ecoflow_python-0.1.0-py3-none-any.whl.

File metadata

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

File hashes

Hashes for ecoflow_python-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 ef997df297db52d18fc628b364a9f0da7455c875e32d09cf260ecfe0402fc80f
MD5 c31472969703bfa88a530a1f59f8edbc
BLAKE2b-256 86e8836635d15166aa4b0cef814ed4a6446b3be258db787d063a98095120d0b0

See more details on using hashes here.

Provenance

The following attestation bundles were made for ecoflow_python-0.1.0-py3-none-any.whl:

Publisher: python-release.yml on colombod/ecoflow-sdk

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