ndejong / solaredge-interface

The SolarEdge Interface provides both a command-line interface and a Python module interface to interact with the SolarEdge API service.
https://solaredge-interface.readthedocs.io
BSD 2-Clause "Simplified" License
14 stars 5 forks source link
pypi python solar-system solaredge solaredge-api

SolarEdge Interface

PyPi Python Versions Build Status Read the Docs License

The SolarEdge Interface provides both a command-line interface, and a Python module interface to interact with the SolarEdge API service.

Features

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.

Project


Copyright © 2021 Nicholas de Jong