The SolarEdge Interface provides both a command-line interface and a Python module interface to interact with the SolarEdge API service.
Project description
SolarEdge Interface
The SolarEdge Interface provides both a command-line interface and a Python module interface to interact with the SolarEdge API service.
Features
- All (documented) SolarEdge API endpoints are implemented with multisite support for endpoints that provide multisite queries.
- Response data for all endpoints are available as a Python-dict structure; a Pandas-DataFrame or; as raw-JSON.
- The command-line interface output can be formatted as a CSV; as a Pandas style JSON structure or; as plain-JSON.
- Timestamps can be returned as
datetime
values with their respective site timezones applied. Doing so is the default behaviour, however this can be disabled if required. - Configuration via environment variables or config file is possible, thus making it safer to manage your API key value(s).
- Decent debug logging to help detect and discover problems should they arise.
- Easy installation using PyPI
pip
- Plenty of documentation and examples to get you going.
Installation
user@computer:~$ pip3 install solaredge-interface
Command Line Usage
For example, obtain the current power flow at site 1234567. This assumes the API_KEY has been set using the
SOLAREDGE_API_KEY
environment variable; alternatively use the --config
command parameter to load a
configuration file. Response data in CSV format for all sub-commands can be achieved by adding --format csv
user@computer:~$ solaredge-interface site_current_power_flow 1234567
{
"siteCurrentPowerFlow": {
"updateRefreshRate": 3,
"unit": "kW",
"connections": [
{
"from": "GRID",
"to": "Load"
}
],
"GRID": {
"status": "Active",
"currentPower": 0.7
},
"LOAD": {
"status": "Active",
"currentPower": 0.7
},
"PV": {
"status": "Idle",
"currentPower": 0.0
}
}
}
Plenty more command-line examples available here.
Python Module Usage
Python 3.8.5 (default, Jul 28 2020, 12:59:40)
[GCC 9.3.0] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>>
>>> from solaredge_interface.api.SolarEdgeAPI import SolarEdgeAPI
>>> api = SolarEdgeAPI(api_key='XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX', datetime_response=True, pandas_response=True)
>>> response = api.get_site_current_power_flow(1234567)
>>> response.data
{'siteCurrentPowerFlow': {'updateRefreshRate': 3, 'unit': 'kW', 'connections': [{'from': 'GRID', 'to': 'Load'}], 'GRID': {'status': 'Active', 'currentPower': 0.7}, 'LOAD': {'status': 'Active', 'currentPower': 0.7}, 'PV': {'status': 'Idle', 'currentPower': 0.0}}}
>>>
Additional Python-module examples are available in the python-modules pages.
History
This project started as a fork from EnergieID which was renamed to solaredge-interface because it was heavily re-worked and extended in a way that is not compatible with previous forks.
- 2020-10-11 - forked to ndejong/solaredge-interface
- 2018-01-26 - forked to EnergieID/solaredge
- 2017-11-28 - original bertouttier/solaredge
Project
- Github - github.com/ndejong/solaredge-interface
- PyPI - pypi.python.org/pypi/solaredge-interface
- TravisCI - travis-ci.org/github/ndejong/solaredge-interface
- ReadTheDocs - solaredge-interface.readthedocs.io
Copyright © 2020 Nicholas de Jong
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
Built Distribution
File details
Details for the file solaredge-interface-0.1.1.tar.gz
.
File metadata
- Download URL: solaredge-interface-0.1.1.tar.gz
- Upload date:
- Size: 17.5 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/3.1.1 pkginfo/1.4.2 requests/2.24.0 setuptools/49.2.0 requests-toolbelt/0.8.0 tqdm/4.30.0 CPython/3.8.5
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 5c2da8e3dafb634dcf12830fee9d7526cf39826c820531f8ad26b8a71cf631cb |
|
MD5 | 3cf65e1b6d69ccb3df3e4a2dacc6ac14 |
|
BLAKE2b-256 | 92568e62230650781ce463663ebc4c421ab1fc7e74e25594e9351310580a7ab7 |
File details
Details for the file solaredge_interface-0.1.1-py3-none-any.whl
.
File metadata
- Download URL: solaredge_interface-0.1.1-py3-none-any.whl
- Upload date:
- Size: 26.5 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/3.1.1 pkginfo/1.4.2 requests/2.24.0 setuptools/49.2.0 requests-toolbelt/0.8.0 tqdm/4.30.0 CPython/3.8.5
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | fcff5e4b29271e964c85e32d6ae3f5afe31d91117ad1a016d64da8dfb1e55687 |
|
MD5 | 4a0b686d679895955909cb532aa40767 |
|
BLAKE2b-256 | 7ef031562d1868d9e7e91134287bd453cb0c45f09ed7981151669da2cdb96d07 |