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.2.0.tar.gz (48.6 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.2.0-py3-none-any.whl (33.1 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: ecoflow_python-0.2.0.tar.gz
  • Upload date:
  • Size: 48.6 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.2.0.tar.gz
Algorithm Hash digest
SHA256 2adc788702ad9e01616db715f95dda088977f426d01154d4cf923e028d605648
MD5 24199704f4b012ac11e16829ae957969
BLAKE2b-256 924829b188bbe6d3e836530c278421e16bfd554829ff0325f91ad207b92d6f70

See more details on using hashes here.

Provenance

The following attestation bundles were made for ecoflow_python-0.2.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.2.0-py3-none-any.whl.

File metadata

  • Download URL: ecoflow_python-0.2.0-py3-none-any.whl
  • Upload date:
  • Size: 33.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.2.0-py3-none-any.whl
Algorithm Hash digest
SHA256 7496ae2118e4701db402fba18e92266ebc96148491c0d4c1b691c57898778053
MD5 99165873266bf5136b7466c604437c43
BLAKE2b-256 b494354ce262c0c7239df4994e36260d82c6f0c3fefeb743d293b0408354914a

See more details on using hashes here.

Provenance

The following attestation bundles were made for ecoflow_python-0.2.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