Skip to content
Collection of Google Sheets scripts for interacting with SolarEdge API
Branch: master
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
LICENSE
README.md
day.gs
details.gs
inverter.gs
month.gs
overview.gs

README.md

#Google Sheets SolarEdge A collection of Google Sheets scripts for interacting with the SolarEdge API

##About This project's goal is to leverage the SolarEdge API using Google Scripts to pull data into a Google Sheets spreadsheet. Once in the spreadsheet, you can choose to do whatever you'd like with the data. Using Google Sheets Triggers, you can trigger a series of scripts to execute at an interval you define. For example, during a particular time of day, once a day, once a week, on load, etc.

If your utility provider also provides an API, you can combine the information from your SolarEdge inverter with that from your utility provider.

Dashboard

###Requirements You need to have the following to use this code

  1. SolarEdge private API Key
  2. Site ID
  3. Inverter Serial Number (only if you want to pull inverter data)

You can request a private API key from SolarEdge or your Solar installer on behalf of SolarEdge. You should have your Site ID as well, but you can get that and your inverter's serial number from the SolarEdge monitoring site.

###Script Files There are four script files that you can use. You can choose to combine them as they are separate for each function but redundant in code in many places between them.

  • month.gs - Fetches the total kWh for the current month (no longer used, but available if you want to use it)
  • day.gs - Fetches the total kWh for each day of the current month (no longer used, but available if you want to use it)
  • details.gs - Fetches site specific information like panel type and peak power information
  • inverter.gs - Fetches the kW and temperature from the inverter for the given day
  • overview.gs - Fetches total kWh for lifetime, year, month, and day (replaces month.gs and day.gs)

###Script File References Each script has some hard-coding in it that you can change at will

  • Names of sheets are hardcoded in lines similar to var sheetSiteInfo = ss.getSheetByName("details");
  • Location lookups for API Key, Site ID, and Inverter Serial var apiKey = sheetSiteInfo.getRange("B7").getValue();

##Usage

  1. Open a spreadsheet in Google Sheets
  2. Create five sheets month_data, day_data, inverter_data, details, and Dashboard (if you want a dashboard page for charts and graphs)
  3. On the details sheet, enter your API Key into B7
  4. On the details sheet, enter your Site ID into B2
  5. On the details sheet, enter your Inverter Serial into B8

  1. Click Tools > Script Editor*
  2. Create three scripts overview.gs, inverter.gs, and details.gs
  3. Paste the code from this repository into the corresponding example.gs sheet script like monthly.gs
  4. Click Resources > ....Triggers in the Script Editor and set the frequency you'd like each to be triggered

Note that there is a limit on the number of calls you can make in a day as a best practice. Please be a mindful consumer :)

You can’t perform that action at this time.