New Python plugin: Domoticz SolarEdge_ModbusTCP

Moderator: leecollings

User avatar
imautohuttraeger
Posts: 393
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

Post by imautohuttraeger »

I might miss something, but battery still seems not to be recognized.
Stop, look and listen.
AddieJanssen
Posts: 40
Joined: Sunday 27 September 2020 16:17
Target OS: -
Domoticz version:
Contact:

Re: New Python plugin: Domoticz SolarEdge_ModbusTCP

Post by AddieJanssen »

The output does not make sense - must be a few more bugs in the scanner. I will have a look into it tonight.
User avatar
JayDotR
Posts: 30
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

Post by JayDotR »

Hi AddieJanssen,

I ran the scanner.py in a venv with pymodbus==3.15.0 as indicated in your https://github.com/addiejanssen/solared ... ec-scanner

Code: Select all

(venv) pi@pihole:/srv/pymodbus-venv $ python -m pip list
Package  Version
-------- -------
pip      26.2.1
pymodbus 3.15.0

pi@pihole:/srv/pymodbus-venv $ ./venv/bin/python3.13 ./scanner.py 192.168.1xx.xxx 1502 --device-id 3
Connecting to server
 Connected to server

  The inverter is providing a SunSpec Map

   Reading Block at address [40002] for device [3]
    Block id = 1: Common
     Manufacturer:   [SolarEdge ]
     Model:          [SE16K-RW000BNN4]
     Options:        []
     Version:        [0004.0025.0013]
     Device Address: [3]

   Reading Block at address [40069] for device [3]
    Block id = 103: Inverter (Three Phase)

   Reading Block at address [40121] for device [3]
    Block id = 701: Unknown block

Closed connection to server
pi@pihole:/srv/pymodbus-venv $ ./venv/bin/python3.13 ./scanner.py 192.168.1xx.yyy 1502 --device-id 1
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:          [SE6000H-RWS00BNO4]
     Options:        []
     Version:        [0004.0022.0044]
     Device Address: [1]

   Reading Block at address [40069] for device [1]
ERROR: request ask for id=1 but got id=3, Skipping.
    Block id = 101: Inverter (Single Phase)

   Reading Block at address [40121] for device [1]
    Block id = 1: Common
     Manufacturer:   [SolarEdge]
     Model:          [SE-MTR-3Y-400V-A]
     Options:        [Export+Import]
     Version:        [79]
     Device Address: [2]

   Reading Block at address [40188] for device [1]
    Block id = 203: wye-connect three phase (abcn) meter

   Reading Block at address [40295] for device [1]
    Block id = 701: Unknown block

Closed connection to server
Tried with solaredge_modbus 0.8.0 installed on top

Code: Select all

(venv) pi@pihole:/srv/pymodbus-venv $ python -m pip list
Package          Version
---------------- -------
pip              26.2.1
pymodbus         3.15.0
pyserial         3.5
pyserial-asyncio 0.6
solaredge-modbus 0.8.0
(venv) pi@pihole:/srv/pymodbus-venv $ ./venv/bin/python3.13 ./scanner.py 192.168.1xx.xxx 1502 --device-id 1
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:          [SE6000H-RWS00BNO4]
     Options:        []
     Version:        [0004.0022.0044]
     Device Address: [1]

   Reading Block at address [40069] for device [1]
    Block id = 101: Inverter (Single Phase)

   Reading Block at address [40121] for device [1]
    Block id = 1: Common
     Manufacturer:   [SolarEdge]
     Model:          [SE-MTR-3Y-400V-A]
     Options:        [Export+Import]
     Version:        [79]
     Device Address: [2]

   Reading Block at address [40188] for device [1]
    Block id = 203: wye-connect three phase (abcn) meter

   Reading Block at address [40295] for device [1]
    Block id = 701: Unknown block

Closed connection to server
(venv) pi@pihole:/srv/pymodbus-venv $ ./venv/bin/python3.13 ./scanner.py 192.168.1xx.yyy 1502 --device-id 3
Connecting to server
 Connected to server

  The inverter is providing a SunSpec Map

   Reading Block at address [40002] for device [3]
    Block id = 1: Common
     Manufacturer:   [SolarEdge ]
     Model:          [SE16K-RW000BNN4]
     Options:        []
     Version:        [0004.0025.0013]
     Device Address: [3]

   Reading Block at address [40069] for device [3]
    Block id = 103: Inverter (Three Phase)

   Reading Block at address [40121] for device [3]
    Block id = 701: Unknown block

Closed connection to server
--
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: 40
Joined: Sunday 27 September 2020 16:17
Target OS: -
Domoticz version:
Contact:

Re: New Python plugin: Domoticz SolarEdge_ModbusTCP

Post by AddieJanssen »

Messages like "ERROR: request ask for id=1 but got id=3, Skipping." are most of the time caused by communication issues between the scanner and inverter. These can be time outs or when there are more than 2 connections to the inverter at the same time.
Running the scan multiple times may help, but may also show more errors...

The scanner is not using the solaredge_modbus library or anything of Domoticz. There's no need/benefit installing anything like that.
Even better: run the scanner in a clean environment where there's only the actual required components (which is pymodbus 3.15.0).
Last edited by AddieJanssen on Wednesday 23 September 2026 18:37, edited 2 times in total.
AddieJanssen
Posts: 40
Joined: Sunday 27 September 2020 16:17
Target OS: -
Domoticz version:
Contact:

Re: New Python plugin: Domoticz SolarEdge_ModbusTCP

Post by AddieJanssen »

Thanks for running the scanner and sharing the outcome! It helps to figure out how these inverters actually return information.

I did some further reading based on the scans by imautohuttraeger and have found a more up to date list of Sunspec models.
This should reduce the number of "Unknown block" messages. It also became clear that these inverters can return a whole lot more information...

It took me some time to understand that the SolarEdge inverters don't return battery information conform the Sunspec battery model specifications.
SolarEdge has their own way of sharing battery information.

I have uploaded a newer version of the scanner that (hopefully) shows some battery information.
When there's no battery attached to the inverter, it may return all sorts of errors - sounds bad, but in fact is a good thing for my test.

So, would you be so kind to run the scans again with the new scanner and share the info here?
You can find the scanner at: https://github.com/addiejanssen/solared ... ec-scanner

Oh and one more thing: when the scanner is showing wrong, incomplete, or incorrect information, please share what the correct setup is.
Otherwise we have no clue what is missing or wrong.

Thanks all!
User avatar
JayDotR
Posts: 30
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

Post by JayDotR »

Hi Addie,

I will challenge my two foes (chatgpt and claude) : for my setup, I think I could send you both (python + results) in the late evening ;)
--
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/
hjzwiers
Posts: 305
Joined: Friday 12 January 2018 8:26
Target OS: Raspberry Pi / ODroid
Domoticz version:
Contact:

Re: New Python plugin: Domoticz SolarEdge_ModbusTCP

Post by hjzwiers »

Hi Addie, are you building the controller according to the document:
Technical Note – Power Control Protocol for SolarEdge Inverters ?
User avatar
imautohuttraeger
Posts: 393
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

Post by imautohuttraeger »

I have replaced the file scanner.py by the new one (is that correct or do I need to do more?)

The result is an error:

Code: Select all


(scanner_env) pi@Raspberry:~ $ python /home/pi/solaredge-sunspec-scanner/scanner.py 192.168.1.143 1502
  File "/home/pi/solaredge-sunspec-scanner/scanner.py", line 161
    <title>solaredge-sunspec-scanner/scanner.py at main · addiejanssen/solaredge-sunspec-scanner</title>
                                                        ^
SyntaxError: invalid character '·' (U+00B7)
(scanner_env) pi@Raspberry:~

When I delete the invalid character in line 161 ('·'), I get another error in line 7:

Code: Select all

(scanner_env) pi@Raspberry:~ $ python /home/pi/solaredge-sunspec-scanner/scanner.py 192.168.1.143 1502
  File "/home/pi/solaredge-sunspec-scanner/scanner.py", line 7
    <!DOCTYPE html>
    ^
SyntaxError: invalid syntax
(scanner_env) pi@Raspberry:~

Stop, look and listen.
User avatar
JayDotR
Posts: 30
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

Post by JayDotR »

https://github.com/janreimen/Python-Ana ... -Registers ;)

Nevertheless, I tried yours (cf. attached files)
Attachments
se6000h.txt
Master Inverter
(4.24 KiB) Downloaded 4 times
se16k.txt
Slave Inverter
(3.63 KiB) Downloaded 4 times
--
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: 40
Joined: Sunday 27 September 2020 16:17
Target OS: -
Domoticz version:
Contact:

Re: New Python plugin: Domoticz SolarEdge_ModbusTCP

Post by AddieJanssen »

imautohuttraeger wrote: Wednesday 23 September 2026 19:53 I have replaced the file scanner.py by the new one (is that correct or do I need to do more?)

The result is an error:

Code: Select all


(scanner_env) pi@Raspberry:~ $ python /home/pi/solaredge-sunspec-scanner/scanner.py 192.168.1.143 1502
  File "/home/pi/solaredge-sunspec-scanner/scanner.py", line 161
    <title>solaredge-sunspec-scanner/scanner.py at main · addiejanssen/solaredge-sunspec-scanner</title>
                                                        ^
SyntaxError: invalid character '·' (U+00B7)
(scanner_env) pi@Raspberry:~

When I delete the invalid character in line 161 ('·'), I get another error in line 7:

Code: Select all

(scanner_env) pi@Raspberry:~ $ python /home/pi/solaredge-sunspec-scanner/scanner.py 192.168.1.143 1502
  File "/home/pi/solaredge-sunspec-scanner/scanner.py", line 7
    <!DOCTYPE html>
    ^
SyntaxError: invalid syntax
(scanner_env) pi@Raspberry:~

That's not my scanner.py. That's an HTML page.
Looks like you have downloaded the GitHub page itself....
Browse to https://github.com/addiejanssen/solared ... ec-scanner and just download the scanner.py.
AddieJanssen
Posts: 40
Joined: Sunday 27 September 2020 16:17
Target OS: -
Domoticz version:
Contact:

Re: New Python plugin: Domoticz SolarEdge_ModbusTCP

Post by AddieJanssen »

hjzwiers wrote: Wednesday 23 September 2026 19:49 Hi Addie, are you building the controller according to the document:
Technical Note – Power Control Protocol for SolarEdge Inverters ?
Yes, but also some other docs of SolarEdge and Sunspec.
When it comes to the inverter itself and meters attached to it, it's pretty nicely done by SolarEdge.
But when it comes to batteries... Ah well, I will make it work.
In a later stage I will look into the power control part of that document.
AddieJanssen
Posts: 40
Joined: Sunday 27 September 2020 16:17
Target OS: -
Domoticz version:
Contact:

Re: New Python plugin: Domoticz SolarEdge_ModbusTCP

Post by AddieJanssen »

JayDotR wrote: Wednesday 23 September 2026 20:04 https://github.com/janreimen/Python-Ana ... -Registers ;)

Nevertheless, I tried yours (cf. attached files)
That looks pretty good!
Does the output match the reality?
User avatar
imautohuttraeger
Posts: 393
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

Post by imautohuttraeger »

AddieJanssen wrote: Wednesday 23 September 2026 20:52 That's not my scanner.py. That's an HTML page.
Looks like you have downloaded the GitHub page itself....
OMG - how embarrassing 🤦

Here we go:

Code: Select all


Connecting to server
 Connected to server

  The inverter is providing a SunSpec Map

   Reading Block at address [40002 (0x9c42)] for device [1]
    Block id     = [1]
    Block length = [65]
    Block type   = [Common - All SunSpec compliant devices must include this as                                the first model]
     Manufacturer:   [SolarEdge ]
     Model:          [SE10K-RWB48BFN4]
     Options:        []
     Version:        [0004.0025.0011]
     Serial Number:  [hidden]
     Device Address: [1]

   Reading Block at address [40069 (0x9c85)] for device [1]
    Block id     = [103]
    Block length = [50]
    Block type   = [Inverter (Three Phase) - Include this model for three phase                                inverter monitoring]

   Reading Block at address [40121 (0x9cb9)] for device [1]
    Block id     = [1]
    Block length = [65]
    Block type   = [Common - All SunSpec compliant devices must include this as                                the first model]
     Manufacturer:   [SolarEdge]
     Model:          [MTR-240-3PC1-D-A-MW]
     Options:        [Export+Import]
     Version:        [1.0.62]
     Serial Number:  [hidden]
     Device Address: [2]

   Reading Block at address [40188 (0x9cfc)] for device [1]
    Block id     = [203]
    Block length = [105]
    Block type   = [wye-connect three phase (abcn) meter]

   Reading Block at address [40295 (0x9d67)] for device [1]
    Block id     = [701]
    Block length = [153]
    Block type   = [DER AC Measurement - DER AC measurement model.]

   Reading Block at address [40450 (0x9e02)] for device [1]
    Block id     = [702]
    Block length = [50]
    Block type   = [DER Capacity - DER capacity model.]

   Reading Block at address [40502 (0x9e36)] for device [1]
    Block id     = [703]
    Block length = [17]
    Block type   = [Enter Service - Enter service model.]

   Reading Block at address [40521 (0x9e49)] for device [1]
    Block id     = [704]
    Block length = [65]
    Block type   = [DER AC Controls - DER AC controls model.]

   Reading Block at address [40588 (0x9e8c)] for device [1]
    Block id     = [705]
    Block length = [57]
    Block type   = [DER Volt-Var - DER Volt-Var model.]

   Reading Block at address [40647 (0x9ec7)] for device [1]
    Block id     = [706]
    Block length = [47]
    Block type   = [DER Volt-Watt - DER Volt-Watt model.]

   Reading Block at address [40696 (0x9ef8)] for device [1]
    Block id     = [707]
    Block length = [105]
    Block type   = [DER Trip LV - DER low voltage trip model.]

   Reading Block at address [40803 (0x9f63)] for device [1]
    Block id     = [708]
    Block length = [105]
    Block type   = [DER Trip HV - DER high voltage trip model.]

   Reading Block at address [40910 (0x9fce)] for device [1]
    Block id     = [709]
    Block length = [135]
    Block type   = [DER Trip LF - DER low frequency trip model.]

   Reading Block at address [41047 (0xa057)] for device [1]
    Block id     = [710]
    Block length = [135]
    Block type   = [DER Trip HF - DER high frequency trip model.]

   Reading Block at address [41184 (0xa0e0)] for device [1]
    Block id     = [711]
    Block length = [32]
    Block type   = [DER Frequency Droop - DER Frequency Droop model.]

   Reading Block at address [41218 (0xa102)] for device [1]
    Block id     = [712]
    Block length = [44]
    Block type   = [DER Watt-Var - DER Watt-Var model.]

   Reading Block at address [41264 (0xa130)] for device [1]
    Block id     = [713]
    Block length = [7]
    Block type   = [DER Storage Capacity - DER storage capacity.]

   Reading Block at address [41273 (0xa139)] for device [1]
    Block id     = [-1]
    Block length = [0]
    Block type   = [The End of the block list has been reached]

  End of Sunspec MAP

  Trying to probe for batteries

   Reading Battery at address [57600 (0xe100)] for device [1]
     Manufacturer:     [SolarEdge]
     Model:            [SolarEdge Home Battery 48V - 3 ]
     Firmware Version: [48V DCDC 3.5.13]
     Serial Number:    [7B0716D7]
     Device id:        [112]
     Reserved:         [0]
     Next Address:     [57666 (0xe142)]

   Reading Battery at address [57856 (0xe200)] for device [1]
     Manufacturer:     [SolarEdge]
     Model:            [Home Battery 48V - 3 modules]
     Firmware Version: []
     Serial Number:    []
     Device id:        [255]
     Reserved:         [0]
     Next Address:     [57922 (0xe242)]

Disconnected from server


Stop, look and listen.
hjzwiers
Posts: 305
Joined: Friday 12 January 2018 8:26
Target OS: Raspberry Pi / ODroid
Domoticz version:
Contact:

Re: New Python plugin: Domoticz SolarEdge_ModbusTCP

Post by hjzwiers »

AddieJanssen wrote: Wednesday 23 September 2026 20:55
hjzwiers wrote: Wednesday 23 September 2026 19:49 Hi Addie, are you building the controller according to the document:
Technical Note – Power Control Protocol for SolarEdge Inverters ?
Yes, but also some other docs of SolarEdge and Sunspec.
When it comes to the inverter itself and meters attached to it, it's pretty nicely done by SolarEdge.
But when it comes to batteries... Ah well, I will make it work.
In a later stage I will look into the power control part of that document.
Ok, i will wait until you reach that stage, i am actively running the power control with a se10k-rwb48 with meters and 5 battery packs (23 kwh)
User avatar
JayDotR
Posts: 30
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

Post by JayDotR »

JayDotR wrote: Wednesday 23 September 2026 20:04 https://github.com/janreimen/Python-Ana ... -Registers ;)

Nevertheless, I tried yours (cf. attached files)
Concerning my uploaded files :
SE6000H is my Battery inverter (Mono-Phased 230V AC / 410 V DC)
SE-MTR-3Y-400V-A is the Meter used to define the working mode of the set of inverters (self-usage prior to sell if solar generation or battery available)
Battery is the right Device also
SE16K seems also legit read

for the specific registers, I will check during the weekend with my plugin if the readings I see are those read through pymodbus 3.5.8 + solaredge_modbus 0.8.0 and if they are in line with the output of your script
--
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: 40
Joined: Sunday 27 September 2020 16:17
Target OS: -
Domoticz version:
Contact:

Re: New Python plugin: Domoticz SolarEdge_ModbusTCP

Post by AddieJanssen »

hjzwiers wrote: Thursday 24 September 2026 11:01
AddieJanssen wrote: Wednesday 23 September 2026 20:55
hjzwiers wrote: Wednesday 23 September 2026 19:49 Hi Addie, are you building the controller according to the document:
Technical Note – Power Control Protocol for SolarEdge Inverters ?
Yes, but also some other docs of SolarEdge and Sunspec.
When it comes to the inverter itself and meters attached to it, it's pretty nicely done by SolarEdge.
But when it comes to batteries... Ah well, I will make it work.
In a later stage I will look into the power control part of that document.
Ok, i will wait until you reach that stage, i am actively running the power control with a se10k-rwb48 with meters and 5 battery packs (23 kwh)
Would appreciate if you could run the scanner on your inverter. The more info the better :)
User avatar
imautohuttraeger
Posts: 393
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

Post by imautohuttraeger »

BTW: No errors anymore with v2.0.7
Stop, look and listen.
AddieJanssen
Posts: 40
Joined: Sunday 27 September 2020 16:17
Target OS: -
Domoticz version:
Contact:

Re: New Python plugin: Domoticz SolarEdge_ModbusTCP

Post by AddieJanssen »

imautohuttraeger wrote: Thursday 24 September 2026 21:43 BTW: No errors anymore with v2.0.7
Nice - thanks for the update
Post Reply