I recently embarked on a project to integrate my SolarEdge photovoltaic system with my Homematic CCU2, and I must say, the journey has been both challenging and rewarding. After spending countless hours researching and piecing together snippets of code from various forums and websites, I’m thrilled to share my solution with the community.
What Does This Integration Achieve?
This setup imports the power data from my SolarEdge inverter into the Homematic CCU2. The data is stored in system variables, which can then be used as triggers for actions or programs. For instance, if enough solar power is generated, I can automate the activation of specific devices or systems. This integration has allowed me to significantly increase my self-consumption of solar energy.
What Do I Need?
- CCU2 with CUXD and SSH access (assuming basic knowledge of these tools)
- SolarEdge Inverter with API access
A Few Notes Before You Start
- Ensure your solar installer has enabled automatic data transmission from the inverter to the SolarEdge monitoring system and has provided you with the API key and system ID. If you don’t have these, contact your installer or SolarEdge support.
- The data refresh interval from SolarEdge is fixed at approximately 15 minutes, which aligns with how frequently I update the variables in the CCU2. To keep track of data freshness, I’ve included a variable (
SolarEdge-LastUpdateTime) that can be visualized in platforms like ccu.io or ioBroker.
Setting It Up
-
Create System Variables: On your CCU2, create the following system variables. You can customize the logging settings as needed.
-
SSH Access: Use PuTTY to connect to your CCU2 via SSH and create the necessary directory:
bash
/usr/local/addons/solaredge/ -
Script Development: Create a file named
solaredge.tclin the directory and insert the provided script. This script fetches data from the SolarEdge API and updates the variables in the CCU2. -
Permissions: Ensure the script has the correct permissions:
bash
chmod 755 solaredge.tcl -
CCU2 Configuration: In the Homematic GUI, create a CUXD device and assign the script to a button. Set up a program to execute the script at regular intervals, ideally matching the 15-minute data refresh cycle.
My Experience
This integration has been running smoothly for over a month now. It provides me with real-time insights into my solar energy production and consumption, allowing me to optimize my energy usage effectively. I’d love to hear if others have tried similar integrations or have additional tips to share!
Happy tinkering! ![]()