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 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.3.2.tar.gz (18.0 kB view details)

Uploaded Source

Built Distribution

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

Uploaded Python 3

File details

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

File metadata

  • Download URL: solaredge-interface-0.3.2.tar.gz
  • Upload date:
  • Size: 18.0 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.3.2.tar.gz
Algorithm Hash digest
SHA256 671e17618a56b3c5a16c36371d7d99949164fb20eac17a5156b0805bda9ed213
MD5 cecb416a98769da071103400031b05dd
BLAKE2b-256 d2faab852d91db2136e694f343bb165dd80872ae7114f70dd76bfcd6f71c2fc8

See more details on using hashes here.

File details

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

File metadata

  • Download URL: solaredge_interface-0.3.2-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.3.2-py3-none-any.whl
Algorithm Hash digest
SHA256 bd38387815f1057ceab8fb2ffa17b0bc3a9cb1bfad9df45aa49221a73c78984e
MD5 c6f866a1c268c2c40c7e5bbbb41c0a97
BLAKE2b-256 702855038c8f51fb486af890ab925285979779f0b563e0674b15960094c69a3d

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page