GithubHelp home page GithubHelp logo

dbus-solaredge's Introduction

dbus-solaredge Service

Victron Venus integration for SolarEdge Inverters

Purpose

This service is meant to be run on a raspberry Pi with Venus OS from Victron or a for example a Cerbo GX device.

The Python script cyclically reads data from the SolarEdge Inverter via Sunspec Modbus and publishes information on the dbus, using the services com.victronenergy.grid, com.victronenergy.pvinverter.pv0, com.victronenergy.temperature, com.victronenergy.digitalinput. This makes the Venus OS work as if you had a physical Victron Grid Meter installed and gives all information about PV Intervter load, temperature and if the inverter is in limit mode.

Dashboard shows Energy flow Menu shows Entries of the Inverter

Before Configuration

Caution: There must be no other Modbus connection to the SolarEdge inverter. If the inverter is already connected in Venus OS with the Modbus functionality provided by Victron, this must be terminated beforehand! The SolarEdge supports only one TCP connection for Modbus and the data would also be redundant as the Python script also passes the data for the inverter to the Venus OS. But now you also get the gridmeter, which is not supported by Victron.

Configuration

You need to modify the settings in the dbus-solaredge.py as needed:

SERVER_HOST = "192.168.178.80"

SERVER_PORT = 502

UNIT = 2 # From SolarEdge Setapp in Communication -> RS481 -> Protocol -> SunSpec (Non-SE Logger) -> Device ID

Installation

  1. You need root access to your GX Device (https://www.victronenergy.com/live/ccgx:root_access)

  2. Copy the files to the /data folder on your venus:

    • /data/dbus-solaredge/dbus-solaredge.py
    • /data/dbus-solaredge/kill_me.sh
    • /data/dbus-solaredge/service/run
    • /data/dbus-solaredge/service/log/run
  3. Set permissions for files:

chmod 755 /data/dbus-solaredge/service/run

chmod 755 /data/dbus-solaredge/service/log/run

chmod 744 /data/dbus-solaredge/kill_me.sh

  1. Add a symlink to for auto starting:

    ln -s /data/dbus-solaredge/service/ /opt/victronenergy/service/dbus-solaredge

    The supervisor should automatically start this service within seconds, if not simply reboot your system.

  2. If the gridmeter does not show up in the console, please ensure you have configured AC-In as "Grid" see (https://community.victronenergy.com/questions/82440/multiplus-vrm-system-overview-ac-input-not-availab.html)

Upgrading Venus OS

If you are upgrading your Venus OS you will have to re-add the symlink for autostarting the python script (Repeat step 4 from the above installation instructions).

Debugging

You can check the status of the service with svstat:

svstat /service/dbus-solaredge

It will show something like this:

/service/dbus-solaredge: up (pid 8179) 746 seconds

If the number of seconds is always 0 or 1 or any other small number, it means that the service crashes and gets restarted all the time.

You could also take a look at the log-file:

tail -f /var/log/dbus-solaredge/current

and see if there are any error messages.

When you think that the script crashes, start it directly from the command line:

python /data/dbus-solaredge/dbus-solaredge.py

and see if it throws any error messages.

If the script stops with the message

dbus.exceptions.NameExistsException: Bus name already exists: com.victronenergy.grid"

it means that the service is still running or another service is using that bus name.

If you see something like:

2022-06-05 10:39:04,238 - DbusSolarEdge - INFO - Startup, trying connection to Modbus-Server: ModbusTCP 192.168.178.80:502, UNIT 2

2022-06-05 10:39:04,247 - pymodbus.client.sync - ERROR - Connection to (192.168.178.80, 502) failed: [Errno 111] Connection refused

2022-06-05 10:39:04,249 - DbusSolarEdge - ERROR - unable to connect to 192.168.178.80:502

Then you are not able to connect to your Inverter via Modbus. This can be a misconfiguration or another client is already connected. The inverter will accept only one concurrent client connected, if you need more than one client connection you may use a modbus proxy like https://pypi.org/project/modbus-proxy/

Restart the script

If you want to restart the script, for example after changing it, just run the following command:

/data/dbus-solaredge/kill_me.sh

The supervisor will restart the scriptwithin a few seconds.

Hardware

In my installation at home, I am using the following Hardware:

  • SolarEdge SE16K
  • SolarEdge Modbus Meter
  • 3x Victron MultiPlus-II - Battery Inverter (three phase)
  • Cerbo GX (tested Firmware version: v2.87 and v2.92)
  • DIY Battery 32x 280AH Lifepo EVE Cells with BMS from Batrium

Credits

I have shamelessly copied and adapted the code from https://github.com/RalfZim/venus.dbus-fronius-smartmeter and the readme as well as the code from Paul1974 https://www.photovoltaikforum.com/thread/161496-solaredge-smartmeter-mit-victron/?pageNo=1

dbus-solaredge's People

Contributors

h4ckst0ck avatar

Stargazers

Rudi avatar  avatar  avatar Oliver Kurz avatar  avatar  avatar

Watchers

 avatar  avatar  avatar Chris avatar

dbus-solaredge's Issues

Device information not shown in Venus menu

Hi,

I just noted that some of the information written by this driver are visible in MQTT but not in the VenusOS menu, for example the type of "Connection". Is this only a local problem and should work, or is this a missing feature? Any idea what is missing?

Change the name of the inverter in Venus OS settings

Hello everyone. First I want to thank h4ckst0ck for a very good job. I managed to set everything up myself without any extra effort. And I also want to ask, is it possible to receive data from several inverters with this driver? And another question, can I edit the name of the inverter? I didn't find it in the settings menu. I will be very grateful for your help.
Venus os

Feature Request: Support Power Limitation

Support DBUS/MQTT commands for active power limitation of SE inverters.

I already implemented it locally. This issue is only a placeholder to create a corresponding branch and pull request.

Netzfrequenz

Hallo,
lässt sich per dbus auch die Netzfrequenz des Solaredge Meters auslesen?
LG, Tim

Different AC load values between Raspberry and CerboGX

I have now tried the script for 6 months on the Raspberry with Venus OS.
The display looks like this

image

Today I received my CerboGX and installed the script.

image

Both systems are running the same VenusOS version 3.41 and I use a ModbusTCP proxy - so simultaneous access is not a problem.

Why is the AC load on the CerboGX not correct?

DbusSolarEdge - ERROR - regs.isError: {regs}

Hi,

I get the following error. What can I do

root@raspberrypi2:~# python /data/dbus-solaredge/dbus-solaredge.py
2022-10-26 10:39:51,928 - DbusSolarEdge - INFO - Startup, trying connection to Modbus-Server: ModbusTCP 192.168.1.221:502, UNIT 2
2022-10-26 10:39:51,931 - DbusSolarEdge - INFO - Connected to Modbus Server.
2022-10-26 10:39:51,950 - root - INFO - registered ourselves on D-Bus as com.victronenergy.grid.grid_id00
2022-10-26 10:39:54,957 - DbusSolarEdge - ERROR - regs.isError: {regs}

Thanks and best regards
Marcel

Problem with CerboGX

Cant start the adapter on CerboGX with connected Multiplus ll .
Solarsystem is SE12K with no other modbus connection open.

$/data/dbus-solaredge# python /data/dbus-solaredge/dbus-solaredge.py
2022-06-27 21:27:30,750 - DbusSolarEdge - INFO - Startup, trying connection to Modbus-Server: ModbusTCP 192.168.178.11:1502, UNIT 126
2022-06-27 21:27:30,770 - DbusSolarEdge - INFO - Connected to Modbus Server.
2022-06-27 21:27:30,799 - root - INFO - registered ourselves on D-Bus as com.victronenergy.grid.grid_id00
Traceback (most recent call last):
File "/data/dbus-solaredge/dbus-solaredge.py", line 326, in
dbusservice['grid'] = new_service(base, 'grid', 'grid', 0, 0)
File "/data/dbus-solaredge/dbus-solaredge.py", line 208, in new_service
log.error('regs.isError: '+regs)
TypeError: can only concatenate str (not "ModbusIOException") to str

Solaredge with Battery

I have a Solaredge SE8K-RWS48BNN4 with a BYD B-Box LV 7Battery.
Is it possible to include the Battery Parameters in Venus?

Solaredge to Victron and Victron to Solaredge

Hi,

Are you also sending battery data to the Solaredge?

Im now using solaredge_meterproxy from nmakels github which is working like a charm to send data from my non-Solaredge grid meter to the Solaredge.
Im in the process of building my 100 kWh powerwall and want the two units to talk to each other.
So in the Victron i want to show the PV values connected to AC-in and in the Solaredge i want to see the battery details.

Grid meter not showing up in GX console

The grid meter is correctly showing up in the device list on the GX device menu (Raspberry Pi 3B+ with Venus OS) and constantly updating its data. But on the console view with all the system parts displayed as tiles and also in the VRM dashboard, the grid meter is not displayed.
Although in the VRM "Consumption" and "Solar" chart view, the grid part is calculated correctly.

System Setup:

  • Solaredge pv inverter with Solaredge modbus grid meter
  • Multiplus II
  • Raspberry Pi 3B+ with Venus OS

sometimes modbus grid values are incorrect

Hallo ich stehe vor einem sehr seltsamen Problem. Zu 80% der Zeit stimmen alle Werte und das Skript funktioniert nur teilweise stimmen die Gridzählerdaten überhaupt nicht, dadurch stimmen dann natürlich auch die AC Lasten nicht.
Ich versuche den Bug schon eine Weile lang zu finden. Es kommen tatsächlich über die Modbusanfrage falsche Daten und dadurch wird die Rechnung falsch. Siehe die folgenden zwei Bilder. Bild 1 sind die falschen Werte (7:45), Bild2 mit den richtigen Werten beim Gridzähler, den AC-Lasten (7:48). Strom und Spannungswerte dürften passen, rechnet man Strom x Spannung sieht man ob die Leistung völlig falsch angezeigt wird oder richtig.
Bei den unteren Bildern konnte ich den Fehler durch Ein- und Ausschalten der Ladung des Multiplus rekonstruieren, aber diese geht auch nicht immer.

Ich habe mir die eingelesenen Werte vom Modbus direkt ausgeben lassen und es kommen tatsächlich manches mal in einer Schlange richtige Werte und dann plötzlich völlig falsche.
Siehe Grid L1: 232,6V, 4,5A, -282W
---> Der Multiplus lädt mit 2046W der PV Wechselrichter produziert 1075W, Last real war ca. 60W, Real war die Einspeisung bei etwas 1000W. Rechnet man 232,6V*4,5A=1046W. Also ist der Wert von -282W aus dem Modbus falsch. Schaltet man die Ladung des Multiplus aus, korrigiert sich der Netzwert. Die falschen Werte kommen und gehen aber eher sporadisch ohne dass sich etwas an den Einspeisemengen, Lasten, Multiplus ändert.

Habe versucht die Update Rate von 200 auf 2000 zu ändern ohne Erfolg. Ich kann das Problem nicht reproduzieren.
bild2
bild1

FIX: Empty messages from modbus

To get rid of the empty modbus reply messages you can add some parameters to the definition of the modbusClient.

@40000000644bed7f317235f4 2023-04-28 15:59:49,828 - DbusSolarEdge - INFO - Connected to dbus, and switching over to GLib.MainLoop() (= event based) @40000000644bed87321b08b4 2023-04-28 15:59:57,839 - DbusSolarEdge - ERROR - regs.isError: Modbus Error: [Input/Output] Modbus Error: [Invalid Message] Incomplete message received, expected at least 8 bytes (0 received) @40000000644bed8732277464 2023-04-28 15:59:57,840 - DbusSolarEdge - ERROR - exception in _update. @40000000644bed8a3ac5305c 2023-04-28 16:00:00,985 - DbusSolarEdge - INFO - Startup, trying connection to Modbus-Server: ModbusTCP 192.168.178.137:502, UNIT 1 @40000000644bed8a3b19f77c 2023-04-28 16:00:00,990 - DbusSolarEdge - INFO - Connected to Modbus Server. @40000000644bed8b003f415c 2023-04-28 16:00:01,002 - root - INFO - registered ourselves on D-Bus as com.victronenergy.grid.grid_id00 @40000000644bed8b0327a3dc 2023-04-28 16:00:01,051 - root - INFO - registered ourselves on D-Bus as com.victronenergy.pvinverter.pv0.pvinverter_id00 @40000000644bed8b07577a7c 2023-04-28 16:00:01,121 - root - INFO - registered ourselves on D-Bus as com.victronenergy.temperature.temp_pvinverter_id00 @40000000644bed8b0a0423ec 2023-04-28 16:00:01,167 - root - INFO - registered ourselves on D-Bus as com.victronenergy.digitalinput.limit_pvinverter_id00 @40000000644bed8b0c77084c 2023-04-28 16:00:01,208 - DbusSolarEdge - INFO - Connected to dbus, and switching over to GLib.MainLoop() (= event based)

Add "retry_on_empty=True" for the modbusClient definition to get rid of the above errors.

modbusClient = ModbusClient(SERVER_HOST, port=SERVER_PORT, retry_on_empty=True)

Falsche AC Werte

Hallo,
danke für das tolle Python Skript. Die Installation hat geklappt. Allerdings wird der AC Load nicht korrekt errechnet.
Ich habe folgenden Aufbau:
2 PV Inverter (Fronius und Solaredge), ein Energymeter (Solaredge), ein Pi 4 mit Venus OS.
Der Pi ist mit der Beta 2.90 versehen und hat den Fronius auch brav erkannt.
Für Solaredge habe ich dieses Skript installiert. Es kommen die richtigen Grid Werte rein, die Produktion des Solaredge Wechselrichters wird auf 3 Phasen gleichmäßig aufgeteilt, jedoch ist der HD Wave 3680H nur einphasig. Die Summe des PV Inverters passt aber.
Bin über jede Hilfestellung dankbar.
Danke für den Support.
venus os

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.