Skip to main content

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

Metadata

Release files for ecoflow-python 0.2.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for ecoflow-python 0.2.0
File Size Uploaded Provenance Actions
ecoflow_python-0.2.0.tar.gz 48.6 kB With provenance Details for ecoflow_python-0.2.0.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for ecoflow-python 0.2.0
File Interpreter ABI Platform Actions
ecoflow_python-0.2.0-py3-none-any.whl Python 3 none any Details for ecoflow_python-0.2.0-py3-none-any.whl

Total release size: 81.7 kB

Release files / ecoflow_python-0.2.0.tar.gz

Download URL ecoflow_python-0.2.0.tar.gz
Size 48.6 kB
Tags Source
SHA-256 checksum
How to use checksums
2adc788702ad9e01616db715f95dda088977f426d01154d4cf923e028d605648
BLAKE2b-256 checksum
How to use checksums
924829b188bbe6d3e836530c278421e16bfd554829ff0325f91ad207b92d6f70
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/6.1.0 CPython/3.13.12

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on May 29, 2026.

Transparency log

Release files / ecoflow_python-0.2.0-py3-none-any.whl

Download URL ecoflow_python-0.2.0-py3-none-any.whl
Size 33.1 kB
Tags Python 3
SHA-256 checksum
How to use checksums
7496ae2118e4701db402fba18e92266ebc96148491c0d4c1b691c57898778053
BLAKE2b-256 checksum
How to use checksums
b494354ce262c0c7239df4994e36260d82c6f0c3fefeb743d293b0408354914a
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/6.1.0 CPython/3.13.12

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on May 29, 2026.

Transparency log

Security for ecoflow-python 0.2.0

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

Full provenance

Both files in this release have been uploaded with provenance metadata.

Select from 2 files

Attestation for ecoflow_python-0.2.0.tar.gz

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on May 29, 2026.

Transparency log

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Release history Release notifications | RSS feed

This release

0.2.0 This release

2 release files Full provenance

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page