#Google Sheets SolarEdge A collection of Google Sheets scripts for interacting with the SolarEdge API
- SolarEdge Monitoring Portal Login: https://monitoring.solaredge.com/solaredge-web/p/login
- SolarEdge API Reference Doc: www.solaredge.com/files/pdfs/se_monitoring_api.pdf
- Example Google Sheets Spreadsheet
##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.
###Requirements You need to have the following to use this code
- SolarEdge private API Key
- Site ID
- 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();
- Open a spreadsheet in Google Sheets
- Create five sheets month_data, day_data, inverter_data, details, and Dashboard (if you want a dashboard page for charts and graphs)
- On the details sheet, enter your API Key into B7
- On the details sheet, enter your Site ID into B2
- On the details sheet, enter your Inverter Serial into B8
- Click Tools > Script Editor*
- Create three scripts overview.gs, inverter.gs, and details.gs
- Paste the code from this repository into the corresponding example.gs sheet script like monthly.gs
- 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 :)