Skip to main content

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

PyPi Python Versions Build Status Read the Docs PyPI license

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 - https://solaredge-interface.readthedocs.io

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 © 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

solaredge-interface-0.2.1.tar.gz (17.9 kB view details)

Uploaded Source

Built Distribution

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

solaredge_interface-0.2.1-py3-none-any.whl (26.7 kB view details)

Uploaded Python 3

File details

Details for the file solaredge-interface-0.2.1.tar.gz.

File metadata

  • Download URL: solaredge-interface-0.2.1.tar.gz
  • Upload date:
  • Size: 17.9 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

Hashes for solaredge-interface-0.2.1.tar.gz
Algorithm Hash digest
SHA256 206f0421fc82e263086bf5c348ed91e91e68e22ea873bd6bfd9e7ecbdf033015
MD5 564f5a942ac4213b02f63986699973eb
BLAKE2b-256 cb3a4c2fac9afe4dbeb52f345bae141f36b4e46c2f263701c4d43de4f93cee21

See more details on using hashes here.

File details

Details for the file solaredge_interface-0.2.1-py3-none-any.whl.

File metadata

  • Download URL: solaredge_interface-0.2.1-py3-none-any.whl
  • Upload date:
  • Size: 26.7 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

Hashes for solaredge_interface-0.2.1-py3-none-any.whl
Algorithm Hash digest
SHA256 1bb49df1216ab562c365d8bd45c2a3d96947e12ac1ecd7a5b0e56f4e7c89b2c5
MD5 fda8db687e1608e254c2059da06b1443
BLAKE2b-256 443bbd11443c745f09a694a1736a871947ed41389e41358e97ec53706455974e

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