Coder Social home page Coder Social logo

ndejong / solaredge-interface Goto Github PK

View Code? Open in Web Editor NEW
14.0 5.0 5.0 43 KB

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

Home Page: https://solaredge-interface.readthedocs.io

License: BSD 2-Clause "Simplified" License

Python 100.00%
solaredge solar-system solaredge-api python pypi

solaredge-interface's Introduction

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 © 2021 Nicholas de Jong

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.