This is a simple python tool to export SolarEdge inverter data to multiple monitoring platforms; InfluxDB as well as Promethus. It works by reading the inverter data from a SolarEdge inverter that has its ModBusTCP interface activated. It then connects via TCP, reads the SunSpec modbus registers via ModBusTCP, pushes the data to InfluxDB and exposes the values via an exporter for Prometheus consumption.
See https://www.solaredge.com/sites/default/files/sunspec-implementation-technical-note.pdf for details of the SunSpec implementation from solarEdge.
docker run -d \
-e INFLUX_SERVER=<hostname/IP of InfluxDB server - default=192.168.1.1> \
-e INFLUX_PORT=<port InfluxDB is running on - default=8086> \
-e INFLUX_DATABASE=<name of the InfluxDB database - default=solaredge> \
-e INVERTER_IP=<hostname/IP of SolarEdge Inverter - default=192.168.1.2> \
-e INVERTER_PORT=<ModbusTCP port on Inverter - default=502> \
-e METERS=<number of Modbus meters attached to Inverter - default=0 range=0-3> \
-e UNITID=<Modbus ID of Inverter - default=1> \
-e PROMETHEUS_EXPORTER_PORT=<Port to have the prometheus exporter listen on - default=2112> \
-e LEGACY_SUPPORT=<set to True to have Meter 1 prometheus metrics start with M_ vs M1_ default=False> \
Please replace user variables in the above command defined by <> with the correct values. Environment variables can be excluded if the defaults are suitable.
docker run -d \
-e INFLUX_SERVER=192.168.1.50 \
-e INVERTER_IP=192.168.1.200 \
-e METERS=1 \
./solaredge.py [inverter IP]
In addition, you can specify additional flags to customize the tool:
--influx_serverspecifies the IP or hostname of the InfluxDb (default localhost)--influx_portspecifies the port InfluxDb is running on (default 8086)--influx_databasespecifies the InfluxDb database to use (default solaredge)--unitidspecifies the ModBus ID used by the inverter (default 1)--inverter_portspecifies the ModBus TCP port to connect to (default 1502)--metersspecifies the number of ModBus meters connected to the inverter (default 0) (range 0-3)--prometheus_exporter_portspecifies the port for Prometheus scraping (default 2112)-dor--debugactivates debug logging