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.4.tar.gz (5.4 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.4-py3-none-any.whl (5.8 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: ecoflow_api-0.2.4.tar.gz
  • Upload date:
  • Size: 5.4 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.4.tar.gz
Algorithm Hash digest
SHA256 fa2510e89737d9a09d58cd3e5851e8c40653b7fb468c23a5d1f5ca6f6c807dd8
MD5 4732f41df78556e21e0e872b16836cf5
BLAKE2b-256 537119e6d8c5aa15ac2f6c5b02df01d02fbbbb374f4d2d1982a3199fe9dbcbc6

See more details on using hashes here.

File details

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

File metadata

  • Download URL: ecoflow_api-0.2.4-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.4-py3-none-any.whl
Algorithm Hash digest
SHA256 36c86900384d4b36a7311d671aa7bd22e594d4c1c580f1c3a5d458770f044d8b
MD5 44ca245a82260adb12750ffe0385d773
BLAKE2b-256 74d14b5f1b1bd37d5999272309ecff2650d5162f06bac09e3edd8f779f96e143

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