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
- Create an account at ecoflow.com
- Go to the Developer Portal: EU | US
- Apply for Developer Access
- Find your
accessKeyandsecretKeyin 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.typedmarker — 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
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
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
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
ccc9e37733c5a6474f130a8adfece02c93f85ab808224ed570f56944e14b3d45
|
|
| MD5 |
8d2961f35fb55b5fffd434cdc5a1ecce
|
|
| BLAKE2b-256 |
6595aaecd4b71994859b97dbd871fccabec9fd7cb28082f9da00553e1c0cf14b
|
Provenance
The following attestation bundles were made for ecoflow_python-0.1.0.tar.gz:
Publisher:
python-release.yml on colombod/ecoflow-sdk
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
ecoflow_python-0.1.0.tar.gz -
Subject digest:
ccc9e37733c5a6474f130a8adfece02c93f85ab808224ed570f56944e14b3d45 - Sigstore transparency entry: 1671448184
- Sigstore integration time:
-
Permalink:
colombod/ecoflow-sdk@d32805530e69e8855801d42412edd3cffd92e825 -
Branch / Tag:
refs/tags/python-v0.1.0 - Owner: https://github.com/colombod
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
python-release.yml@d32805530e69e8855801d42412edd3cffd92e825 -
Trigger Event:
push
-
Statement type:
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
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
ef997df297db52d18fc628b364a9f0da7455c875e32d09cf260ecfe0402fc80f
|
|
| MD5 |
c31472969703bfa88a530a1f59f8edbc
|
|
| BLAKE2b-256 |
86e8836635d15166aa4b0cef814ed4a6446b3be258db787d063a98095120d0b0
|
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
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
ecoflow_python-0.1.0-py3-none-any.whl -
Subject digest:
ef997df297db52d18fc628b364a9f0da7455c875e32d09cf260ecfe0402fc80f - Sigstore transparency entry: 1671448241
- Sigstore integration time:
-
Permalink:
colombod/ecoflow-sdk@d32805530e69e8855801d42412edd3cffd92e825 -
Branch / Tag:
refs/tags/python-v0.1.0 - Owner: https://github.com/colombod
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
python-release.yml@d32805530e69e8855801d42412edd3cffd92e825 -
Trigger Event:
push
-
Statement type: