New Python plugin: Domoticz SolarEdge_ModbusTCP
Moderator: leecollings
- imautohuttraeger
- Posts: 384
- Joined: Saturday 14 March 2020 13:40
- Target OS: Raspberry Pi / ODroid
- Domoticz version: latest
- Location: Germany
- Contact:
Re: New Python plugin: Domoticz SolarEdge_ModbusTCP
Updated to 2.0.6.
Restructured repository seems to work.
Restructured repository seems to work.
Stop, look and listen.
- imautohuttraeger
- Posts: 384
- Joined: Saturday 14 March 2020 13:40
- Target OS: Raspberry Pi / ODroid
- Domoticz version: latest
- Location: Germany
- Contact:
Re: New Python plugin: Domoticz SolarEdge_ModbusTCP
EDIT: Seems that my .backup_zip directory must not stay in the plugins folder. Sorry. Will move it. Seems that a non coding guy like me is more disruptive than helpful 
SE errors at 21:36 with new version. Just at that point of time. No errors before and after.
Log data beyond errors at that point of time not available in log of web UI retroactive.
Would love to provide more data but I need to know how I can get it without sitting in front the computer at the exact time.
SE errors at 21:36 with new version. Just at that point of time. No errors before and after.
Log data beyond errors at that point of time not available in log of web UI retroactive.
Would love to provide more data but I need to know how I can get it without sitting in front the computer at the exact time.
Code: Select all
2026-09-20 21:36:42.275 Error: SE_Modbus_Neu: Call to function 'onHeartbeat' failed, exception details:
2026-09-20 21:36:42.293 Error: SE_Modbus_Neu: Traceback (most recent call last):
2026-09-20 21:36:42.293 Error: SE_Modbus_Neu: File "/home/pi/domoticz/plugins/solaredge_modbus_tcp_v2.backup_zip/plugin.py", line 709, in onHeartbeat
2026-09-20 21:36:42.293 Error: SE_Modbus_Neu: _plugin.onHeartbeat()
2026-09-20 21:36:42.294 Error: SE_Modbus_Neu: ~~~~~~~~~~~~~~~~~~~^^
2026-09-20 21:36:42.294 Error: SE_Modbus_Neu: File "/home/pi/domoticz/plugins/solaredge_modbus_tcp_v2.backup_zip/plugin.py", line 251, in onHeartbeat
2026-09-20 21:36:42.294 Error: SE_Modbus_Neu: meter = self.inverter.meters()[device_name]
2026-09-20 21:36:42.294 Error: SE_Modbus_Neu: ~~~~~~~~~~~~~~~~~~~~~~^^^^^^^^^^^^^
2026-09-20 21:36:42.294 Error: SE_Modbus_Neu: KeyError: 'Meter1'
Stop, look and listen.
-
AddieJanssen
- Posts: 31
- Joined: Sunday 27 September 2020 16:17
- Target OS: -
- Domoticz version:
- Contact:
Re: New Python plugin: Domoticz SolarEdge_ModbusTCP
These errors can't come from v2.0.6. The line numbers mentioned don't match.imautohuttraeger wrote: Sunday 20 September 2026 22:55 EDIT: Seems that my .backup_zip directory must not stay in the plugins folder. Sorry. Will move it. Seems that a non coding guy like me is more disruptive than helpful
SE errors at 21:36 with new version. Just at that point of time. No errors before and after.
Log data beyond errors at that point of time not available in log of web UI retroactive.
Would love to provide more data but I need to know how I can get it without sitting in front the computer at the exact time.
Code: Select all
2026-09-20 21:36:42.275 Error: SE_Modbus_Neu: Call to function 'onHeartbeat' failed, exception details: 2026-09-20 21:36:42.293 Error: SE_Modbus_Neu: Traceback (most recent call last): 2026-09-20 21:36:42.293 Error: SE_Modbus_Neu: File "/home/pi/domoticz/plugins/solaredge_modbus_tcp_v2.backup_zip/plugin.py", line 709, in onHeartbeat 2026-09-20 21:36:42.293 Error: SE_Modbus_Neu: _plugin.onHeartbeat() 2026-09-20 21:36:42.294 Error: SE_Modbus_Neu: ~~~~~~~~~~~~~~~~~~~^^ 2026-09-20 21:36:42.294 Error: SE_Modbus_Neu: File "/home/pi/domoticz/plugins/solaredge_modbus_tcp_v2.backup_zip/plugin.py", line 251, in onHeartbeat 2026-09-20 21:36:42.294 Error: SE_Modbus_Neu: meter = self.inverter.meters()[device_name] 2026-09-20 21:36:42.294 Error: SE_Modbus_Neu: ~~~~~~~~~~~~~~~~~~~~~~^^^^^^^^^^^^^ 2026-09-20 21:36:42.294 Error: SE_Modbus_Neu: KeyError: 'Meter1'
You can reduce the log level in the hardware settings of the plugin to "Verbose".
That will reduce the amount of log info, but does include the json output of the inverter.
- JayDotR
- Posts: 24
- Joined: Thursday 02 January 2025 21:15
- Target OS: Raspberry Pi / ODroid
- Domoticz version: beta
- Location: Lux
- Contact:
Re: New Python plugin: Domoticz SolarEdge_ModbusTCP
Hi Addie,
Seems that the move to "src/" is not seen so transparently
I doubt that the plugin.py must remain in the root folder, and eventually the imports could undergo a path modif (I will test) and keep you informed
Seems that the move to "src/" is not seen so transparently
Code: Select all
2026-09-21 09:03:49.347 Status: SolarEdge ModBus Roof: Started.
2026-09-21 09:03:49.347 Status: SolarEdge ModBus Roof: Entering work loop.
2026-09-21 09:03:49.348 Status: SolarEdge ModBus Batt: Started.
2026-09-21 09:03:49.348 Status: SolarEdge ModBus Batt: Entering work loop.
2026-09-21 09:03:50.116 Error: SolarEdge ModBus Batt: (SolarEdge_ModbusTCP) failed to load 'plugin.py'.
2026-09-21 09:03:50.193 Error: SolarEdge ModBus Roof: (SolarEdge_ModbusTCP) failed to load 'plugin.py'.
2026-09-21 09:03:50.479 Error: SolarEdge ModBus Batt: Exception: 'ModuleNotFoundError: No module named 'plugin''. No traceback available.
2026-09-21 09:03:50.556 Error: SolarEdge ModBus Roof: Exception: 'ModuleNotFoundError: No module named 'plugin''. No traceback available.--
Domoticz Beta on raspberry3b, and raspberry4(b) on Rasbian Trixie / Python 3.13 / 64 bit
Using: PiHole, SolarEdge Modbus, Sainlogic / Weather Underground, MQTT, Fritzbox, P1 Meter(s), dzvents Scripting
https://www.github.com/janreimen/
Domoticz Beta on raspberry3b, and raspberry4(b) on Rasbian Trixie / Python 3.13 / 64 bit
Using: PiHole, SolarEdge Modbus, Sainlogic / Weather Underground, MQTT, Fritzbox, P1 Meter(s), dzvents Scripting
https://www.github.com/janreimen/
- JayDotR
- Posts: 24
- Joined: Thursday 02 January 2025 21:15
- Target OS: Raspberry Pi / ODroid
- Domoticz version: beta
- Location: Lux
- Contact:
Re: New Python plugin: Domoticz SolarEdge_ModbusTCP
Your structure:
At the top of plugin.py, before importing inverters:
Code: Select all
Domoticz-SolarEdge-ModbusTCP/
├── plugin.py
└── src/
├── inverters.py
└── ...
Code: Select all
import sys
from pathlib import Path
# Add src/ directory to Python module search path
SRC_DIR = Path(__file__).resolve().parent / "src"
if str(SRC_DIR) not in sys.path:
sys.path.insert(0, str(SRC_DIR))
import inverters
--
Domoticz Beta on raspberry3b, and raspberry4(b) on Rasbian Trixie / Python 3.13 / 64 bit
Using: PiHole, SolarEdge Modbus, Sainlogic / Weather Underground, MQTT, Fritzbox, P1 Meter(s), dzvents Scripting
https://www.github.com/janreimen/
Domoticz Beta on raspberry3b, and raspberry4(b) on Rasbian Trixie / Python 3.13 / 64 bit
Using: PiHole, SolarEdge Modbus, Sainlogic / Weather Underground, MQTT, Fritzbox, P1 Meter(s), dzvents Scripting
https://www.github.com/janreimen/
- JayDotR
- Posts: 24
- Joined: Thursday 02 January 2025 21:15
- Target OS: Raspberry Pi / ODroid
- Domoticz version: beta
- Location: Lux
- Contact:
Re: New Python plugin: Domoticz SolarEdge_ModbusTCP
And solved the Issue I ran into later on (fatal error on a fetch)
Runs now at a glance beside 2.0.5 on the same host
Code: Select all
pi@pihole:/srv/domoticz/plugins/Domoticz-SolarEdge.2.0.6 $ diff plugin.new.py plugin.2.0.6.py
67,74d66
< import sys
< from pathlib import Path
<
< # Add src/ directory to Python module search path.
< SRC_DIR = Path(__file__).resolve().parent / "src"
< if str(SRC_DIR) not in sys.path:
< sys.path.insert(0, str(SRC_DIR))
<
370c362
< last_update: datetime = datetime.strptime(Devices[unit[Column.ID] + offset].LastUpdate, "%Y-%m-%d %H:%M:%S")
---
> last_update: datetime = datetime.strptime(Devices[unit[Column.ID]].LastUpdate, "%Y-%m-%d %H:%M:%S")
--
Domoticz Beta on raspberry3b, and raspberry4(b) on Rasbian Trixie / Python 3.13 / 64 bit
Using: PiHole, SolarEdge Modbus, Sainlogic / Weather Underground, MQTT, Fritzbox, P1 Meter(s), dzvents Scripting
https://www.github.com/janreimen/
Domoticz Beta on raspberry3b, and raspberry4(b) on Rasbian Trixie / Python 3.13 / 64 bit
Using: PiHole, SolarEdge Modbus, Sainlogic / Weather Underground, MQTT, Fritzbox, P1 Meter(s), dzvents Scripting
https://www.github.com/janreimen/
-
AddieJanssen
- Posts: 31
- Joined: Sunday 27 September 2020 16:17
- Target OS: -
- Domoticz version:
- Contact:
Re: New Python plugin: Domoticz SolarEdge_ModbusTCP
That's why there's a release zip fileJayDotR wrote: Monday 21 September 2026 9:12 Hi Addie,
Seems that the move to "src/" is not seen so transparently
I doubt that the plugin.py must remain in the root folder, and eventually the imports could undergo a path modif (I will test) and keep you informedCode: Select all
2026-09-21 09:03:49.347 Status: SolarEdge ModBus Roof: Started. 2026-09-21 09:03:49.347 Status: SolarEdge ModBus Roof: Entering work loop. 2026-09-21 09:03:49.348 Status: SolarEdge ModBus Batt: Started. 2026-09-21 09:03:49.348 Status: SolarEdge ModBus Batt: Entering work loop. 2026-09-21 09:03:50.116 Error: SolarEdge ModBus Batt: (SolarEdge_ModbusTCP) failed to load 'plugin.py'. 2026-09-21 09:03:50.193 Error: SolarEdge ModBus Roof: (SolarEdge_ModbusTCP) failed to load 'plugin.py'. 2026-09-21 09:03:50.479 Error: SolarEdge ModBus Batt: Exception: 'ModuleNotFoundError: No module named 'plugin''. No traceback available. 2026-09-21 09:03:50.556 Error: SolarEdge ModBus Roof: Exception: 'ModuleNotFoundError: No module named 'plugin''. No traceback available.
Don't clone the repo, but instead download the zip file and extract all files.
- JayDotR
- Posts: 24
- Joined: Thursday 02 January 2025 21:15
- Target OS: Raspberry Pi / ODroid
- Domoticz version: beta
- Location: Lux
- Contact:
Re: New Python plugin: Domoticz SolarEdge_ModbusTCP
Hi Addie,
Indeed, makes sense with the zip. By convenience i made the classic git pull.
Nevertheless, I encountered an error when reading data, which is also part in the diff I posted the morning. I can check if I encounter it when using the zip as source. I sent you the diff to apply & error log by PM
Jan
Indeed, makes sense with the zip. By convenience i made the classic git pull.
Nevertheless, I encountered an error when reading data, which is also part in the diff I posted the morning. I can check if I encounter it when using the zip as source. I sent you the diff to apply & error log by PM
Jan
--
Domoticz Beta on raspberry3b, and raspberry4(b) on Rasbian Trixie / Python 3.13 / 64 bit
Using: PiHole, SolarEdge Modbus, Sainlogic / Weather Underground, MQTT, Fritzbox, P1 Meter(s), dzvents Scripting
https://www.github.com/janreimen/
Domoticz Beta on raspberry3b, and raspberry4(b) on Rasbian Trixie / Python 3.13 / 64 bit
Using: PiHole, SolarEdge Modbus, Sainlogic / Weather Underground, MQTT, Fritzbox, P1 Meter(s), dzvents Scripting
https://www.github.com/janreimen/
- imautohuttraeger
- Posts: 384
- Joined: Saturday 14 March 2020 13:40
- Target OS: Raspberry Pi / ODroid
- Domoticz version: latest
- Location: Germany
- Contact:
Re: New Python plugin: Domoticz SolarEdge_ModbusTCP
That's right. That's why I added this EDIT note:AddieJanssen wrote: Monday 21 September 2026 9:05 These errors can't come from v2.0.6. The line numbers mentioned don't match.
I have moved this backup folder outside the plugins folder nowimautohuttraeger wrote: Sunday 20 September 2026 22:55 EDIT: Seems that my .backup_zip directory must not stay in the plugins folder. Sorry. Will move it. Seems that a non coding guy like me is more disruptive than helpful![]()
Stop, look and listen.
-
AddieJanssen
- Posts: 31
- Joined: Sunday 27 September 2020 16:17
- Target OS: -
- Domoticz version:
- Contact:
Pre-release version v2.0.7 published
A new day - a new release.
Thanks JayDotR for finding a bug and providing the fix as well
I have just published v2.0.7 on GitHub that should fix the bug.
Thanks JayDotR for finding a bug and providing the fix as well
I have just published v2.0.7 on GitHub that should fix the bug.
- imautohuttraeger
- Posts: 384
- Joined: Saturday 14 March 2020 13:40
- Target OS: Raspberry Pi / ODroid
- Domoticz version: latest
- Location: Germany
- Contact:
Re: New Python plugin: Domoticz SolarEdge_ModbusTCP
Wow, that was fast. In your Wiki
https://github.com/addiejanssen/domotic ... lugin/wiki
the following is written:
https://github.com/addiejanssen/domotic ... lugin/wiki
the following is written:
Question: Will I loose all devices in Domoticz by a new clean install or will they be kept? I am asking, because I use several devices idx in scripts.Updating the plugin can be done by removing the previous version and do a clean install again. Make sure to stop the Domoticz service before you start or at least stop all hardware that is related to the plugin.
Make sure that the requirements listed in the requirements.txt file are met. If newer versions of the solaredge_modbus library are required, make sure that you remove the older versions to prevent version conflicts.
Stop, look and listen.
-
AddieJanssen
- Posts: 31
- Joined: Sunday 27 September 2020 16:17
- Target OS: -
- Domoticz version:
- Contact:
Re: New Python plugin: Domoticz SolarEdge_ModbusTCP
Replacing the folder/files of the plugin will have no impact on existing devices or settings.imautohuttraeger wrote: Monday 21 September 2026 22:20 Wow, that was fast. In your Wiki
https://github.com/addiejanssen/domotic ... lugin/wiki
the following is written:Question: Will I loose all devices in Domoticz by a new clean install or will they be kept? I am asking, because I use several devices idx in scripts.Updating the plugin can be done by removing the previous version and do a clean install again. Make sure to stop the Domoticz service before you start or at least stop all hardware that is related to the plugin.
Make sure that the requirements listed in the requirements.txt file are met. If newer versions of the solaredge_modbus library are required, make sure that you remove the older versions to prevent version conflicts.
Just make sure that you don't make changes to the hardware in Domoticz.
- imautohuttraeger
- Posts: 384
- Joined: Saturday 14 March 2020 13:40
- Target OS: Raspberry Pi / ODroid
- Domoticz version: latest
- Location: Germany
- Contact:
-
AddieJanssen
- Posts: 31
- Joined: Sunday 27 September 2020 16:17
- Target OS: -
- Domoticz version:
- Contact:
SolarEdge SunSpec Scanner
I need your help...
I have started work on the "detection of meters and batteries may not (correctly) work for all inverters" topic.
SolarEdge inverters implement the SunSpec protocol which provides an option to scan for devices connected to the inverter.
I have created a scanner that will contact the inverter to scan for devices attached to it.
I am looking for you to run the scanner and share the output here in this forum.
Based on that, I get an understanding of the different types of inverters in use and if scanning for devices works or not.
I would appreciate that you run the scanner even when there are no batteries or meters attached to your inverter.
You can find the scanner and instructions how to use it on GitHub: https://github.com/addiejanssen/solared ... ec-scanner
WARNING: the scanner requires a newer version of pymodbus which is incompatible with the Domoticz SolarEdge_ModbusTCP!
So, keep things separated by using different computers, containers or virtual environments!
Here's the output when I ran the scanner (python scanner.py inverter 502) for my inverter:
I have started work on the "detection of meters and batteries may not (correctly) work for all inverters" topic.
SolarEdge inverters implement the SunSpec protocol which provides an option to scan for devices connected to the inverter.
I have created a scanner that will contact the inverter to scan for devices attached to it.
I am looking for you to run the scanner and share the output here in this forum.
Based on that, I get an understanding of the different types of inverters in use and if scanning for devices works or not.
I would appreciate that you run the scanner even when there are no batteries or meters attached to your inverter.
You can find the scanner and instructions how to use it on GitHub: https://github.com/addiejanssen/solared ... ec-scanner
WARNING: the scanner requires a newer version of pymodbus which is incompatible with the Domoticz SolarEdge_ModbusTCP!
So, keep things separated by using different computers, containers or virtual environments!
Here's the output when I ran the scanner (python scanner.py inverter 502) for my inverter:
Code: Select all
Connecting to server
Connected to server
The inverter is providing a SunSpec Map
Reading Block at address [40002] for device [1]
Block id = 1: Common
Manufacturer: [SolarEdge ]
Model: [SE7K]
Options: []
Version: [0003.2537]
Device Address: [1]
Reading Block at address [40069] for device [1]
Block id = 103: Inverter (Three Phase)
Reading Block at address [40121] for device [1]
Block id = -1: The End of the block list has been reached
Closed connection to serve
- imautohuttraeger
- Posts: 384
- Joined: Saturday 14 March 2020 13:40
- Target OS: Raspberry Pi / ODroid
- Domoticz version: latest
- Location: Germany
- Contact:
Re: New Python plugin: Domoticz SolarEdge_ModbusTCP
Will try to run it on my Pi with a copy of the SD card for security reasons tomorrow.
However, in case we need to use pymodbus 3.15.0 more often for testing, I am thinking of this procedure:
1.
pip3 install pymodbus==3.15.0
2.
Do the scan, copy the output and post it on the forum
3.
Go back to old pymodbus, so that the current plugin works again:
pip3 install pymodbus==3.6.9
Would that work? If yes: Must I install the dependencies again?
However, in case we need to use pymodbus 3.15.0 more often for testing, I am thinking of this procedure:
1.
pip3 install pymodbus==3.15.0
2.
Do the scan, copy the output and post it on the forum
3.
Go back to old pymodbus, so that the current plugin works again:
pip3 install pymodbus==3.6.9
Would that work? If yes: Must I install the dependencies again?
Stop, look and listen.
-
AddieJanssen
- Posts: 31
- Joined: Sunday 27 September 2020 16:17
- Target OS: -
- Domoticz version:
- Contact:
Re: New Python plugin: Domoticz SolarEdge_ModbusTCP
There's an easier way of doing things...
Create another user on your pi and run the scanner while logged in as that user.
Create another user on your pi and run the scanner while logged in as that user.