A Python toolkit for analyzing and visualizing SolarEdge solar panel data, with a focus on optimizing electricity consumption and costs.
This project provides an enhanced wrapper around the SolarEdge Monitoring API to extract, analyze, and visualize solar panel performance data. While it supports various metrics available through the API, it has been primarily tailored to analyze Purchased Power consumption patterns.
API Credentials To use this tool, you'll need:
- A SolarEdge API key
- Your Site ID
These can be obtained through your SolarEdge monitoring platform. Store your credentials in a credentials.json file:
{
"api_key": "YOUR_API_KEY",
"site_id": YOUR_SITE_ID
}For more information on obtaining these credentials:
The core functionality is implemented in the SolarEdgeAPIEnricher class, which provides:
- Monthly data aggregation
- Power consumption analysis
- Advanced visualization using Plotly
- Data transformation utilities
- Spaghetti plots for daily power profiles
A Jupyter notebook demonstrating the usage of the API enricher, including:
- Setting up the API connection
- Fetching power consumption data
- Creating visualizations
- Sample analysis workflows
git clone https://github.com/yourusername/solar-edge-api-enricher.git
cd solar-edge-api-enricher
pip install -r requirements.txt
from api_enricher import SolarEdgeAPIEnricher
import json
# Load credentials
with open('credentials.json') as f:
credentials = json.load(f)
# Initialize the enricher
enricher = SolarEdgeAPIEnricher(
api_key=credentials['api_key'],
site_id=credentials['site_id']
)Feel free to fork this repository and submit pull requests to extend the functionality. Some interesting areas for expansion include:
- Additional metric analysis
- More visualization options
- Cost optimization algorithms
- Real-time monitoring features
For more ideas, you might find the SolarEdge Monitoring Server API guide very useful.
