/greenbutton-influxdb

Parse SCE Green Button download files and creates import file or sends to influxdb. Grafana dashboard is included.

Primary LanguagePythonGNU General Public License v3.0GPL-3.0

Grafana Dashboard Sample

Sample Grafana Dashboard

Green button import to Influxdb

Parse SCE Green Button download files only for now.
Green button data from utilities is not always the same format , two utilities rae now inlcuded. If someone provides sample data for other green button formats (including SCE non Net Metering) I will incorporate.

Looking for contributors for other utility formats, code enhancements, bugs, documentation .... If you would like to contribute anything including just identifying enhancements or bugs, please see the contributor guide

Still in progress - here is what is completed and works

Features

  • Parse SCE NetMetering version of Green Button CSV file - Solar File is grouped by day by Received (Sent to Utility) or Delivered (from Utiliy)
  • Provide feature to load different utility formats
  •   SCE (Southern Cal.) Time of use / Net Metering , Pepco (Maryland)
    
  • Parse SCE non-Netmetering version of Green Button CSV file - Normal Residential Customers without solar File is group by day and has Consumed header tag
  • Send data to influxdb (v1, non-ssl) - should be on private network and not public accessible due to no SSL
  • Grafana dashboard to analyze Energy Delivery and Generation
  • Simple parsed CSV file for use in excel, manual influxdb or other database
  • JSON file output format. One closed xml line for each measuremnt
  • SSL support
  • Support for influxdb2
  • JSON config file to retain settings for repeat runs
  • Convert to PEP 8 style guide

Requirements

  • python3 needs to be installed along with PIP
  • make sure required libraries are installed using pip3 or homebrew, see the requirements file or run the command

pip install -r requirements.txt

or

pip3 install -r requirements.txt


  • Must have access to influxdb v1

  • Update energyimport.json parameter file

  • Run the program, to test you can use the SCE-NEMFILE.sample file

Usage

greenbutton_import.py [-h] [--version] -f FILE [-v] [-q] [-c] [-j] [--createdb] [--nodb]


Loads Green Button csv file and send formated results to influxdb. Used for Net Metering format only (solar)

optional arguments:
-h, --help show this help message and exit
--version display version number
-f FILE, --file FILE REQUIRED filename of the utility provided csv kwh file
-v, --verbose verbose output - send copy of each line to stdout
-q, --quiet do not print totals output
-c, --csv sends parsed data to a csv delimited file
-j, --json sends parsed data to a json file
--createdb Drop database and create a new one
--nodb Will NOT import to influxdb. Use with -o for local file only

Output of program

The following four values are the output:

measurement -- Either delivered (power from the utility) or generated (solar power sent to the utility)
month -- Name value of Month for influxql grouping
time -- Converted based on the time zone parameter, format is YYYY-MM-DD HH:MM:SS
value -- Kilo Watt Hours - decimal precision is based on what the raw utility file is

References