Coder Social home page Coder Social logo

sweh / sunnyportal-py Goto Github PK

View Code? Open in Web Editor NEW

This project forked from erijo/sunnyportal-py

0.0 1.0 0.0 89 KB

Python module to access PV systems in Sunny Portal

License: GNU General Public License v3.0

Python 99.42% Makefile 0.28% Shell 0.30%

sunnyportal-py's Introduction

sunnyportal-py

Python module to access PV systems in Sunny Portal.

sunnyportal2pvoutput

The script sunnyportal2pvoutput can be used to send data to PVOutput. It uses a config file to store the credentials for Sunny Portal and the API Key and System Id for PVOutput.

How to run

  1. Clone or download the repository.
  2. Enter the directory and run: PYTHONPATH=. ./bin/sunnyportal2pvoutput --dry-run sunnyportal.config
  3. Enter the requested information and verify that the script is able to connect to Sunny Portal.
  4. The information is saved in sunnyportal.config and can be edited/deleted if you misstype anything.
  5. Once it works, replace --dry-run with e.g. --output to upload the last seven days output data to pvoutput or --status to upload data for the current day.
  6. Add --quiet to silence the output.
$ PYTHONPATH=. ./bin/sunnyportal2pvoutput sunnyportal.config --help
usage: sunnyportal2pvoutput [-h] [-s] [-o] [-c] [-p DAYS_PAST] [-q] [-n] config

Connect Sunny Portal to PVoutput.org

positional arguments:
  config                Configuration file to use

optional arguments:
  -h, --help            show this help message and exit
  -s, --status          Report status(es)
  -o, --output          Report output(s)
  -c, --consumption     Report consumption
  -p DAYS_PAST, --days-past DAYS_PAST
                        number of DAYS in the past to go back -- default: 0 (today only)
  -q, --quiet           Silence output
  -n, --dry-run         Don't send any data

sunnyportal2file

The script sunnyportal2file can be used to save data from Sunny Portal to file/database. It uses the same config file as in sunnyportal2pvoutput to store the credentials for Sunny Portal. It will extract the fields (min, mean and max production) which are available in unit watt as numpy.uint32 along with corresponding timestamps and aggregate them into a pandas DataFrame from which it will save to file with the format specified. One file will be created for each plant your Sunny Portal account has access to.

How to run

  1. Clone or download the repository.
  2. Enter the directory and run: PYTHONPATH=. ./bin/sunnyportal2file sunnyportal.config --format csv (change --format if you prefer a different format)
  3. Enter the requested information and verify that a file was created with the format you specified with the expected content
  4. Once it works, you can specify a different start date with --start-date, and end date with --end-date (both defaults to yesterday)
  5. If a data file already exists, it will only download new data and append to previously created data file (can override --start-date)
  6. Use --include-filter if you only want to download data for a specific plant
  7. Add --quiet to silence the output.
$ PYTHONPATH=. ./bin/sunnyportal2file -h
usage: sunnyportal2file [-h] -f {json,csv,pickle,feather,parquet,excel,sqlite} [-s START_DATE] [-e END_DATE] [-i INCLUDE_FILTER] [-q] config

Save information from Sunny Portal to file

positional arguments:
  config                Configuration file to use

optional arguments:
  -h, --help            show this help message and exit
  -f {json,csv,pickle,feather,parquet,excel,sqlite}, --format {json,csv,pickle,feather,parquet,excel,sqlite}
                        Format for which the data is to be saved
  -s START_DATE, --start-date START_DATE
                        The start date of data to be saved in the format YYYY-MM-DD (default yesterday)
  -e END_DATE, --end-date END_DATE
                        The end date of data to be saved in the format YYYY-MM-DD (default yesterday)
  -i INCLUDE_FILTER, --include-filter INCLUDE_FILTER
                        A string used to filter which plants to include (default includes all plants)
  -q, --quiet           Silence output

sunnyportal-py's People

Contributors

danieltwagner avatar dvandonkelaar avatar erijo avatar joebe975 avatar michaelpeeters avatar sweh avatar

Watchers

 avatar

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.