Page 1 of 1

Solaredge inverter plug-in Modbus TCP

Posted: Wednesday 18 October 2023 18:11
by pgas37
The discussion about the plugin is very extensive and sometimes impossible for the layman to follow and sometimes goes back years.
Recently received a solaredge inverter. I installed the plugin according to the instructions on the domoticz-wiki page. That didn't work at first. After some searching, I came across a temporary fix that I applied. That fix seems to be from 2021.
sudo pip3 uninstall pymodbus
sudo pip3 install pymodbus==2.4.0
After that, it works like a charm. With that, I say carefully, the plugin does not seem to work (yet) with python 3.x.x. in 2023.
Is that correct or is there now a solution that allows you to work with a higher python version?
I ask that because for the Zigbee protocol there is also a plugin for Domoticz and that works with a python version above 3.5. So I can't install that version because in version 2.4 use in my domoticz.

Thanks
Regards Paul

Re: Solaredge inverter plug-in Modbus TCP

Posted: Wednesday 18 October 2023 18:48
by Sjonnie2017
I have the SolarEdge inverter with the modbus TCP plugin.

I migrated from Domoticz installed directly on my host to a server with Docker containers. I had some issues to iron out but got it working with the help from this community. You might want to consider a Docker environment. I have found it much easier to maintain. Some info on my troubles (and the solution) can be read here: viewtopic.php?p=294777#p294777 (and the posts after that ;) )

Good luck!

Re: Solaredge inverter plug-in Modbus TCP

Posted: Wednesday 18 October 2023 20:40
by RonkA
Solaredge Modbus plugin runs like a charm on my setup running Version: 2023.2 (build 15559) and Python Version: 3.9.2 (default, Feb 28 2021, 17:03:44) [GCC 10.2.1 20210110]

Re: Solaredge inverter plug-in Modbus TCP

Posted: Thursday 15 February 2024 22:13
by Xenon
@RonkA,

Please, could you tell me what versions of pymodbus and/or solaredge modbustcp plugin you've installed?
First of all: I.m far from a Linux-hero! I know some basics, but that's already it...

Since around 2017 up to now, I was running Domoticz (finally 2024.4) on a dusty RPi3 and later a RPi4. A couple of month ago, we got a SolarEdge inverter installed. Therefore, I installed the "Domoticz-SolarEdge_Modbustcp"-plugin (the one prior to v2.0.4) as described in the WIKI. It was capable to read 22 readings out of my Solaredge SE8K-WS, except for the additional energy meter (kWh import/export) and battery status (which are also connected to modbus). So not all equipment was caught by Domoticz.

After upgrading to the Solaredge Modbustcp v2.0.4 plugin, it started to complain about the use of an old library (if I recall well: 0.7.0 where 0.7.2 is minimum). After upgrading to that version, it started to complain about an insufficient version of Python. So finally, I decided to start all over with the latest RPi4-Lite-OS (dec-2023, apt update/upgrade done). It's now running Python 3.11.2 and holds modbus library 3.6.4. After struggling with the apt/pip-issue (where it rejects me using pip) the 2.0.4-Plugin appears to require only a 2.4.0-library. Sufficient, since 3.6.4 was found already. Since then, I have the option to select "Inverter+meter+battery" in Domoticz Hardware setup.

Anyway, Domoticz appears no longer capable to read modbus data at all. My guess is that various versions of python, pymodbus and plugins dislike each other, but I have to admit that I'm getting confused by all those different version numbers, because it seems to me that there is no upward compatibility. Right? So I'm curious how to get this fixed. And to clarify which versions are mandatory to work with recent Pi-Lite-OS and where to get these versions. I'm not afraid to start all over again, but I need some help in understanding in what I'm doing (wrong).

Would appreciate any help to get (all of my) modbus-devices covered in Domoticz. Many thanks in advance for your help.

Re: Solaredge inverter plug-in Modbus TCP

Posted: Thursday 15 February 2024 23:50
by RonkA
Please, could you tell me what versions of pymodbus and/or solaredge modbustcp plugin you've installed?
I use an older version of the plugin 1.1.1 but it works in my setup like a charm.(only pannels, no battery)

Reading the Readme it states:
# Domoticz SolarEdge_ModbusTCP plugin

A Domoticz plugin to collect data from SolarEdge power inverters over ModbusTCP.

The plugin uses the `solaredge_modbus` library (<https://github.com/nmakel/solaredge_modbus>) to communicate with the inverter.

The 1.x.x. versions of the plugin only read the inverter data.

The upcoming 2.x.x version will support meters and batteries.

--
.. so i don't think this info is much help for your needs, sorry..

Re: Solaredge inverter plug-in Modbus TCP

Posted: Friday 16 February 2024 7:56
by waltervl
I see this open issue on the python plugin where a user is proposing to use a higher version of the SolarEdge_modbus module https://github.com/addiejanssen/domotic ... /issues/73

Re: Solaredge inverter plug-in Modbus TCP

Posted: Friday 16 February 2024 12:22
by Xenon
Hi @all,

Thank you both for your replies. I finally managed to get where I left by kicking off pymodbus-3.6.4 and installing pymodbus-2.4.0 again (and pymodbusTCP-0.2.1), kicking my 22 SolarEdge sensors alive again. I consider this as a lucky moment, because I have no clue about the logic behind version numbers. I expected that 3.6.4 at least would be capable of what 2.4.0 can do. So far my expectations...

However, I have still no battery nor meter readings available. But at least, I now have what I had before.

It appears that development of an updated plugin got stuck for some reason. I guess I have to be more patient for an updated plugin to become developed and available.

The given suggestion to move over to Docker containers might be a good one. I'll keep the topic in mind. Thnx.

Re: Solaredge inverter plug-in Modbus TCP

Posted: Friday 16 February 2024 17:17
by Xenon
waltervl wrote: Friday 16 February 2024 7:56 I see this open issue on the python plugin where a user is proposing to use a higher version of the SolarEdge_modbus module https://github.com/addiejanssen/domotic ... /issues/73
Well, I've found a SolarEdge Modbus 0.8.0, which expects al least pymodbus >=3.5 to be present. Upgrading my pymodbus from 2.4.0 to 3.6.4 (which is above 3.5 and the latest version imho) resulted in no more readings from the inverter. Log shows repeatedly "...reconnecting to SE8K-RWS...". So it appears incompatible too.

Would be nice if the latest plugin would become part of Domoticz 2024.x-build, since SolarEdge is quite a popular inverter brand. Beside SolarEdge, modbusTCP is also used in controlling many heatpump installations. This type of business will be booming for quite a while, so implementation in Domoticz would be justified imho.,

Re: Solaredge inverter plug-in Modbus TCP

Posted: Saturday 17 February 2024 11:45
by waltervl
It is open source. Using Python plugins usually offers quicker problem solving then using the integrated plugin.

Perhaps better discuss these details in the plugin repository then on this forum.

Re: Solaredge inverter plug-in Modbus TCP

Posted: Friday 10 May 2024 11:15
by McMelloW
After changing to a system with Bullseye, I had some trouble with the domoticz-solaredge-modbustcp-plugin also.

Changed in the requirements.txt the value solaredge_modbus==0.8.0 and did sudo pip3 install -r requirements.txt
Also a git pull for the latest plugin stuf.

It solved my problems after this actions.

Re: Solaredge inverter plug-in Modbus TCP

Posted: Sunday 11 August 2024 16:39
by jiemeb
Hi,
version of pymodbus-3.7.0 do not work with Ubuntu 24.04 you must downgrade pymodbus-3.6.9

Regards
JM

Re: Solaredge inverter plug-in Modbus TCP

Posted: Sunday 27 October 2024 16:34
by fjuppe
Hello,

Can someone with better knowledge than I (linux newbee), help me to understand and solve the problem with this SolarEdge Modbus Plugin. Obviously the module is not found but I dont know how to install it. I have followed all instructions on the github page... I am on latest Domoticz and Python.

Code: Select all

Error: SE Modbus: (SolarEdge_ModbusTCP) failed to load 'plugin.py', Python Path used was '/home/stig/domoticz/plugins/SolarEdge_Modubus/:/usr/lib/python311.zip:/usr/lib/python3.11:/usr/lib/python3.11/lib-dynload:/usr/local/lib/python3.11/dist-packages:/usr/lib/python3/dist-packages:/usr/lib/python3.11/dist-packages'.
2024-10-27 16:20:32.389 Error: SE Modbus: Traceback (most recent call last):
2024-10-27 16:20:32.389 Error: SE Modbus: File "/home/stig/domoticz/plugins/SolarEdge_Modubus/plugin.py", line 54, in <module>
2024-10-27 16:20:32.389 Error: SE Modbus: import solaredge_modbus
2024-10-27 16:20:32.389 Error: SE Modbus: ModuleNotFoundError: No module named 'solaredge_modbus'
Thanks in advance for your help!
/fjuppe

Re: Solaredge inverter plug-in Modbus TCP

Posted: Saturday 16 November 2024 12:41
by bramv
I had the same problem after upgrading the pymodbus library to 3.7.4

Only a simple fix will allow pymodbus 3.7.4 to be used tgether with solaredge 0.8.0
1) find location of pymodbus library
type "pip show pymodbus"
see where it is located and type cd plus that location something like cd xxxxxx\python3.9\site-packages\solaredge_modbus

2) edit the file __init__.py
change line 9 into
from pymodbus.pdu.register_read_message import ReadHoldingRegistersResponse

3) restart plugin or domoticz

Re: Solaredge inverter plug-in Modbus TCP

Posted: Monday 18 November 2024 14:27
by fjuppe
Hello bramv!

Thank you for your reply !

Sorry to say, your suggested fix did not work. From what I can see, the error is about the same....by looking at the below, do you have another suggestion??
Thanks in advance!

This is what I have installed;

Code: Select all

Requirement already satisfied: solaredge_modbus in /usr/local/lib/python3.11/dist-packages (0.8.0)
Requirement already satisfied: pymodbus>=3.5.0 in /home/fjuppe/.local/lib/python3.11/site-packages (from solaredge_modbus) (3.7.4)
Requirement already satisfied: pyserial-asyncio>=0.6.0 in /usr/local/lib/python3.11/dist-packages (from solaredge_modbus) (0.6)
Requirement already satisfied: pyserial in /usr/lib/python3/dist-packages (from pyserial-asyncio>=0.6.0->solaredge_modbus) (3.5)
And this is what is reported in the Domoticz error log:

Code: Select all

SE Modbus: (SolarEdge_ModbusTCP) failed to load 'plugin.py', Python Path used was '/home/fjuppe/domoticz/plugins/SE_Modbus/:/usr/lib/python311.zip:/usr/lib/python3.11:/usr/lib/python3.11/lib-dynload:/usr/local/lib/python3.11/dist-packages:/usr/lib/python3/dist-packages:/usr/lib/python3.11/dist-packages'.
2024-11-18 14:06:58.454 Error: SE Modbus: Traceback (most recent call last):
2024-11-18 14:06:58.454 Error: SE Modbus: File "/home/fjuppe/domoticz/plugins/SE_Modbus/plugin.py", line 68, in <module>
2024-11-18 14:06:58.454 Error: SE Modbus: import solaredge_modbus
2024-11-18 14:06:58.454 Error: SE Modbus: File "/usr/local/lib/python3.11/dist-packages/solaredge_modbus/__init__.py", line 9, in <module>
2024-11-18 14:06:58.454 Error: SE Modbus: from pymodbus.register_read_message import ReadHoldingRegistersResponse
2024-11-18 14:06:58.454 Error: SE Modbus: ModuleNotFoundError: No module named 'pymodbus.register_read_message'
and this is the __init__.py:

Code: Select all

"""Pymodbus: Modbus Protocol Implementation.

Released under the BSD license
"""

__all__ = [
    "ExceptionResponse",
    "FramerType",
    "ModbusException",
    "pymodbus_apply_logging_config",
    "__version__",
    "__version_full__",
]

from pymodbus.exceptions import ModbusException
from pymodbus.framer import FramerType
from pymodbus.logging import pymodbus_apply_logging_config
from pymodbus.pdu.register_read_message import ReadHoldingRegistersResponse



__version__ = "3.7.4"
__version_full__ = f"[pymodbus, version {__version__}]"

Re: Solaredge inverter plug-in Modbus TCP

Posted: Tuesday 19 November 2024 22:39
by bramv
Hellofjuppe,

I'm not sure but it looks like the domoticz or the plugin was not restarted or the file was not saved because the error still says the line 9 contains pymodbus.register_read_message in stead of pymodbus.pdu.register_read_message

kind regards,
Bram Vreugdenhil