Addie's place on the web...

Just some stuff I want to share with you

Domoticz, solarpanels and inverters

Sunday 13 September 2020
Domoticz

Back in August 2018 we got 20 solarpanels installed on our carport. The vendor (SolarEdge) of the inverter provides an app and a monitoring website where we can see how the installation is performing.

We were already using Domoticz to monitor our power and gas usage. Domoticz comes with an option to extract data from the SolarEdge monitoring platform and present it. All the energy data available in one dashboard; a great way to see what is going on.

Great right? Well, yeah. It’s working perfectly, so no complaints. But there’s this nagging thingie… To get to the performance data of our panels, we are required to use the monitoring platform of the vendor. And it’s also clear that SolarEdge receives more information from the inverter than they share back to us via their API.

So, why not collect this data directly from the inverter?

Well, I am for sure not the first one that came up with this question. There’s a long history and may items in different forums talking about getting Domoticz to interact with SolarEdge inverters. It is also clear that currently there is no “out of the box” solution in place. Which means that it is tinker time.

Talk to the inverter

The SolarEdge inverter is connected to our network, so you would expect that it should be possible to interact with it. Unfortunately, SolarEdge has not published any information if and how you could do so. Older firmware versions had options, but over time SolarEdge has removed these options.

When searching for options, I got to this list:

  1. Intercept the data that is uploaded to the SolarEdge monitoring platform. Some people have found a way to decode the information that the inverter shares with the SolarEdge monitoring platform. This is a complex approach and although people report good results, it is all based on reverse engineering and there is no guarantee that it would work with our inverter.
  2. Connect to the serial port on the inside of the inverter and use the SolarEdge protocol. This is also based on lots of reverse engineering by the community. It has some benefits over the previous option, but it also includes additional complexity: we now need to get physical to connect to the box.
  3. Go for SunSpec Modbus approach: the benefit of this route is that everything is documented. The downside is that not all information that is available by the inverter is available via this approach. For example, it is not possible to get information about the power optimizers.

There is an active community regarding this topic, so the list is probably outdated by the time you read it.

I decided to go for the SunSpec Modbus approach. It will certainly work, and it does provide the information that I already have, but now directly from the inverter instead of the monitoring platform.

SunSpec Modbus

So what are SunSpec and Modbus? The short answer: these are standards.

SunSpec is a standard that defines how an inverter should present its information and Modbus is a communication protocol; it describes how to talk to the inverter. Combined, this allows us to use a standard approach to get to the information from the inverter and it is clear how to interpret that information.

Let’s get going

There are 2 options to connect to the inverter: using the build-in RS485 serial port or via the network. The network approach was way more convenient for me; the inverter is already connected to the network and I only had to enable Modbus in the menu of the inverter. Job done!

Next step is to get the data into Domoticz. During my search for options here, I found a few. All of them used a script to “inject” the data into Domoticz. I tried a few of them and they all had issues. Either I needed to allow communication over http instead of https or I had to install some obscure and outdated libraries.

Eventually, I came across solaredge_modbus Python library. The author of the library included an example that allowed me to test the communication with our inverter and to see what the inverter wants to share. The result was something along the line of:

Model:              SE7K
Type:               Three Phase Inverter
Version:            0003.2251
Status:             Producing
Temperature:        44.08 °C
Current:            1.95 A
Phase 1 Current:    0.65 A
Phase 2 Current:    0.64 A
Phase 3 Current:    0.65 A
Phase 1 voltage:    398.40 V
Phase 2 voltage:    398.50 V
Phase 3 voltage:    399.40 V
Phase 1-N voltage:  228.90 V
Phase 2-N voltage:  230.30 V
Phase 3-N voltage:  230.10 V
Frequency:          50.00 Hz
Power:              145.00 W
Power (Apparent):   447.10 VA
Power (Reactive):   -423.00 VAr
Power Factor:       -32.31 %
Total Energy:       11029026 Wh
DC Current:         0.20 A
DC Voltage:         746.90 V
DC Power:           147.20 W

By now it is clear that we can get the information from the inverter. So, how do we get it into Domoticz? The answer is documented on the Integrations and Protocols page in the Domoticz wiki: build a plugin.

Well, I did… And I will share my experience with that track in another post soon. For now, let’s jump to the result. I succeeded to get that plugin going and I published it on GitHub: Domoticz SolarEdge_ModbusTCP plugin.

And this all results in:

Goal reached! All the data now nicely flows directly from the inverter into Domoticz. No more dependencies on a third-party platform!


Want to respond to this post?
Look me up on twitter Twitter, facebook Facebook or linkedin LinkedIn.