The SolarEdge Interface provides both a command-line interface, and a Python module interface to interact with the SolarEdge API service.
datetime
values with their respective site timezones applied. Doing so is the
default behaviour, however this can be disabled if required.pip
user@computer:~$ pip3 install solaredge-interface
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 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.
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.
Copyright © 2021 Nicholas de Jong