Re: New Python plugin: Domoticz SolarEdge_ModbusTCP
Posted: Sunday 20 September 2026 21:09
Updated to 2.0.6.
Restructured repository seems to work.
Restructured repository seems to work.
Join 16,000+ members discussing home automation with Domoticz. Get help with Zigbee, ZWave, MQTT, scripting, and 150+ integrations
https://forum.domoticz.com/
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'
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'
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.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
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")
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.
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![]()
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.
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.
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