Skip to main content

Ecoflow API library

Project description

Ecoflow_API

Python module to get and set parameters for Ecoflow Delta 2 Max and Ecoflow E2000

Supported Python Versions

This library supports the following Python implementations:

  • Python 3.10
  • Python 3.11

Lower versions did not checked.

Installation

Install from PyPi using pip, a package manager for Python.

  pip3 install ecoflow-api
  #or
  poetry add git+https://github.com/Ohudyma/Ecoflow_API

Usage

API Credentials

The Ecoflow client needs your Ecoflow API credentials. You can obtain access_key and secret_key on the page https://developer-eu.ecoflow.com/us/security and then pass these directly to the constructor. Serial number - you can get from Ecoflow device package.

Make a Call

#For Ecoflow E2000
from ecoflow_api.ecoflow_e2000 import EcoflowAPI

#For Ecoflow Delta2 Max
from ecoflow_api.ecoflow_delta2_max import EcoflowAPI

access_key = "*********"
secret_Key  = "*********"
DEVICE_SN = "*********"
#Disable/enable logs (0 - disable, 1 - enable)
log_lvl = "1"

request_data_get = {"sn": DEVICE_SN,
                    "params": {
                        "quotas": ["pd.soc",
                                   "inv.SlowChgWatts",
                                   "bms_bmsStatus.cycSoh",
                                   "bms_bmsInfo.soh",
                                   "inv.inputWatts",
                                   "pd.invOutWatts",
                                   "pd.chgDsgState",
                                   "bms_emsStatus.chgRemainTime", 
                                   "bms_emsStatus.dsgRemainTime"
                                   ]
                               }
                    }

request_data_set = {"id": 123,
                    "version": "1.0",
                    "sn": DEVICE_SN,
                    "moduleType": 3,
                    "operateType": "acChgCfg",
                    "params": {"fastChgWatts": 2400,
                               "slowChgWatts": 500,
                               "chgPauseFlag": 0}
                    }

api = EcoflowAPI(sn=DEVICE_SN, access_key=access_key, secret_key=secret_Key, log_lvl=log_lvl)

#Get all device parameters (request_data=None)
resp_get_all_device_quotas = api.get_all_device_quotas(request_data=None)
print(resp_get_all_device_quotas)

#Get some device device parameters from dict request_data_get
resp_get_device_quotas = api.get_device_quotas(request_data=request_data_get)
print(resp_get_device_quotas)

#Set parameters on the device (change input power in example)
resp_set_device_quota = api.set_device_quota(request_data=request_data_set)
print(resp_set_device_quota)

Donation

You can support the developer with a donation:

PayPal - oleksii.hudyma@gmail.com

Monobank - 4441 1144 1446 0376

Feedback

If you have any feedback, please reach out to us at oleksii.hudyma@gmail.com

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_api-0.2.3.tar.gz (5.3 kB view details)

Uploaded Source

Built Distribution

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

ecoflow_api-0.2.3-py3-none-any.whl (5.8 kB view details)

Uploaded Python 3

File details

Details for the file ecoflow_api-0.2.3.tar.gz.

File metadata

  • Download URL: ecoflow_api-0.2.3.tar.gz
  • Upload date:
  • Size: 5.3 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.13.9

File hashes

Hashes for ecoflow_api-0.2.3.tar.gz
Algorithm Hash digest
SHA256 6634ca9efd5ad706f85de7a2b63af0d2f48dfc03cf09ea13077801f1a1978150
MD5 3d5c3cb4761bc586f5bfab6005aacd33
BLAKE2b-256 dca6e4d9f8243b9c98f737351af615a4db08ae8ca37573cafc30db31cf148f73

See more details on using hashes here.

File details

Details for the file ecoflow_api-0.2.3-py3-none-any.whl.

File metadata

  • Download URL: ecoflow_api-0.2.3-py3-none-any.whl
  • Upload date:
  • Size: 5.8 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.13.9

File hashes

Hashes for ecoflow_api-0.2.3-py3-none-any.whl
Algorithm Hash digest
SHA256 32b71cf973ffbc5ac02f36ba5e0b68f0a22cc315d5334cfc49b890b31560a1f0
MD5 754d28b5021387a4ded1d1a9f266e8bb
BLAKE2b-256 100ce98194539d8b3a3e415b8dbec853ac3900abbd87c311769731ad59bcf8e3

See more details on using hashes here.

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