Python API for managing Ecoflow power stations
Project description
Ecoflow Python API
Python library for communicating with Ecoflow power stations over BLE, based on bleak.
Supported features
Delta 2 device is the only supported for now. Extending support is planned
| Feature \ Device | Delta 2 | River 2 |
|---|---|---|
| Output circuit control - AC | + | pending |
| Output circuit control - DC | + | pending |
| Output circuit control - USB | + | pending |
| Reading output circuits state | + | pending |
| Reading charge level | + | pending |
| Reading configured charging speed | + | pending |
| Reading configured min/max charging speed thresholds | + | pending |
| Reading realtime charging speed - AC input | + | pending |
| Reading realtime charging speed - Solar input | - | pending |
Usage
import asyncio
import bleak
from ecoflow import Delta2, OutputCircuit
async def main():
mac = "00:00:00:00:00:01"
ble_client = bleak.BleakClient(mac, timeout=15)
async with Delta2(ble_client) as dev:
await dev.turn_on_circuit(OutputCircuit.USB)
await dev.turn_off_circuit(OutputCircuit.AC)
await dev.start_state_stream(print_state)
await asyncio.sleep(40)
await dev.stop_state_stream()
async def print_state(data):
print("state update...")
for k, v in data.items():
print(f"{k} = {v}")
print("-"*20)
asyncio.run(main())
Note to understand the example completely one may need to refer to:
- bleak https://github.com/hbldh/bleak
- Python asyncio https://realpython.com/async-io-python/
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
ecoflow-0.2.tar.gz
(5.7 kB
view details)
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
ecoflow-0.2-py3-none-any.whl
(5.0 kB
view details)
File details
Details for the file ecoflow-0.2.tar.gz.
File metadata
- Download URL: ecoflow-0.2.tar.gz
- Upload date:
- Size: 5.7 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: python-requests/2.31.0
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
e227e653195b21855322f5d1717ef879cfe0c52c5a936e24d7846d2d897365a4
|
|
| MD5 |
10b50294e45c997a2638262946b54fc5
|
|
| BLAKE2b-256 |
e91e415c81bcc11949c59d9816557a7b25d36a2a05802b16d6e27813acd6bc77
|
File details
Details for the file ecoflow-0.2-py3-none-any.whl.
File metadata
- Download URL: ecoflow-0.2-py3-none-any.whl
- Upload date:
- Size: 5.0 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: python-requests/2.31.0
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
24fe56ece9d50402e9ceb9aee230d471407eb7eedfd826c9385ca79c022e7f75
|
|
| MD5 |
8962d73eb6ee59a24995e56a2a5bfc91
|
|
| BLAKE2b-256 |
0a53ff5ec403fe877e49fbe533381396abe9c7a47df5b79d50b33c18931b241e
|