New Python plugin: Domoticz SolarEdge_ModbusTCP

Moderator: leecollings

AddieJanssen
Posts: 45
Joined: Sunday 27 September 2020 16:17
Target OS: -
Domoticz version:
Contact:

Re: New Python plugin: Domoticz SolarEdge_ModbusTCP

Post by AddieJanssen »

4. The solaredge_modbus library has been archived and needs attention.
Currently working on replacing this library.

2. The detection of meters and batteries in the meters branch may not work for all inverters.
I introduced the scanner to figure this out. Based on the feedback so far, I have a pretty good understanding on how SolarEdge implemented the Sunspec and how batteries are handled by the different software versions of SolarEdge.

I am planning to release an update of the scanner that will be based on the replacement of the solaredge_modbus library.
Hope to get this out in the next 2 weeks.

Once that is done and we don't see issues with it, I will replace the solaredge_modbus library of the plugin.
hjzwiers
Posts: 320
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 »

So basically you say start testing when the new branch is out. I wonder because i have
General: SolarEdge ModbusTCP - Inverter - Storage Control Mode with
0 Disabled
10 Maximize Self Consumption
20 Time of Use
30 Backup Only
40 Remote Control

General: SolarEdge ModbusTCP - Inverter - Remote Control Mode
0 Off
10 Charge from excess PV power only
20 Charge from PV first
30 Charge from PV and AC
40 Maximize export
50 Discharge to match load
60 unused
70 Maximize self consumption

General: SolarEdge ModbusTCP - Inverter - Storage AC Charge Policy
0 Disabled
10 Always Allowed
20 Fixed Energy Limit
30 Percent of Production

Together with all the solaredge functions (Meter1 - Total Imported Energy (Active) , Meter1 - Total Exported Energy (Active), Battery1 - State of Energy, To(+) / From(-)_Battery, Solar_Total and all the others), and some of them i've had to shorten the name ... the names are used in several functions so i dont know how much work the transfer will be .....
AddieJanssen
Posts: 45
Joined: Sunday 27 September 2020 16:17
Target OS: -
Domoticz version:
Contact:

Re: New Python plugin: Domoticz SolarEdge_ModbusTCP

Post by AddieJanssen »

Sorry, but I don't understand your message...
hjzwiers
Posts: 320
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 »

Sorry i formulated the question the way i did.

I have the inputs that i wrote and there are several outputs to the plugin, i have renamed a number of them and i reused them in a number of scripts.

I was wondering how much work it would be to transfer to your new format.
AddieJanssen
Posts: 45
Joined: Sunday 27 September 2020 16:17
Target OS: -
Domoticz version:
Contact:

SolarEdge Scanner

Post by AddieJanssen »

Hi all,

Although the flu has been slowing me down over the last week, I have been able to do a lot of reading up and investigating.
I think I now have (famous last words...) a pretty good method to scan for all the stuff that is attached to an inverter.

I have updated (and MOVED) the scanner which is using the new methods that need testing.

The scanner, by default, can now dump all registers it has read to the output; it does so by default, but that can be stopped on the command line.
That output enables me to simulate an inverter and test my software against it, without having access to such an inverter!
If you do not want to share that output on a public forum: please share it in a private message with me!
I really need a lot of these dumps to make sure that the software works as expected.

So, although you may have already done this before, would you be so kind to run the latest scanner and share the output with me?

You can find the scanner and instructions how to use it on GitHub: https://github.com/addiejanssen/solaredge-scanner

Thanks again!
hjzwiers
Posts: 320
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 »

deleted post
Last edited by hjzwiers on Sunday 04 October 2026 14:09, edited 1 time in total.
User avatar
imautohuttraeger
Posts: 399
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 »

Be assured I will let the scanner run. But most likely I don't have access to my home before Monday.
Stop, look and listen.
hjzwiers
Posts: 320
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 »

deleted post
Last edited by hjzwiers on Sunday 04 October 2026 14:09, edited 1 time in total.
hjzwiers
Posts: 320
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 »

deleted post
Last edited by hjzwiers on Sunday 04 October 2026 14:11, edited 1 time in total.
hjzwiers
Posts: 320
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 »

And a final version of scanner2.py if you want i can send it

Code: Select all

hjz@debian:/opt/stacks/domoticz/config/plugins$ sudo docker exec -it domoticz python3 /opt/domoticz/userdata/plugins/scanner2.py 192.168.2.186 1502
Connecting to server

 Connected to server

  Looking for SunSpec identifier at address [40000 (0x9c40)] for device [1]
  SunSpec identifier registers: [21365, 28243]
  SunSpec identifier: [SunS]
  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.0013]
     Device Address: [1]
    Registers    = [1, 65, 21359, 27745, 29253, 25703, 25888, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 21317, 12592, 19245, 21079, 16948, 14402, 17998, 13312, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 12336, 12340, 11824, 12338, 13614, 12336, 12595, 0, 14146, 12341, 12854, 17473, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 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]
    Registers    = [103, 50, 245, 81, 83, 80, 65534, 4001, 4018, 4014, 2309, 2316, 2321, 65535, 5277, 65535, 4998, 65534, 5691, 65535, 44238, 65534, 56264, 65534, 748, 31152, 0, 6532, 65532, 8200, 65535, 5357, 65535, 32768, 4319, 32768, 32768, 65534, 4, 0, 65535, 65535, 65535, 65535, 0, 0, 65535, 65535, 65535, 65535, 0, 0]

   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.104]
     Device Address: [65535]
    Registers    = [1, 65, 21359, 27745, 29253, 25703, 25856, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 19796, 21037, 12852, 12333, 13136, 17201, 11588, 11585, 11597, 22272, 0, 0, 0, 0, 0, 0, 17784, 28783, 29300, 11081, 28016, 28530, 29696, 0, 12590, 12334, 12592, 13312, 0, 0, 0, 0, 13876, 12337, 25908, 25700, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 65535]

   Reading Block at address [40188 (0x9cfc)] for device [1]
    Block id     = [203]
    Block length = [105]
    Block type   = [wye-connect three phase (abcn) meter]
    Registers    = [203, 105, 23909, 8943, 6496, 8469, 65532, 2305, 2305, 2309, 2316, 0, 3992, 4008, 4005, 65535, 4999, 65534, 4422, 13026, 11206, 45726, 65533, 4041, 1694, 1109, 1670, 65535, 61495, 64035, 64433, 64100, 65535, 64760, 61446, 63357, 3939, 65534, 11064, 38896, 9732, 27948, 6421, 35294, 3620, 43430, 28698, 38272, 5820, 11505, 10545, 53630, 21042, 40988, 65534, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 32768, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 32768, 0, 0]

   Reading Block at address [40295 (0x9d67)] for device [1]
    Block id     = [701]
    Block length = [153]
    Block type   = [DER AC Measurement - DER AC measurement model.]
    Registers    = [701, 153, 2, 1, 65535, 1, 0, 0, 65535, 65535, 51, 56, 65515, 92, 32768, 4004, 2312, 0, 49986, 65535, 65535, 65535, 65535, 65535, 65535, 65535, 65535, 65535, 65535, 65535, 65535, 65535, 65535, 65535, 65535, 32768, 32768, 32768, 32768, 32768, 32768, 32768, 32768, 32768, 65535, 65535, 65535, 2312, 65535, 65535, 65535, 65535, 65535, 65535, 65535, 65535, 65535, 65535, 65535, 65535, 65535, 65535, 65535, 65535, 32768, 32768, 32768, 65535, 65535, 65535, 2312, 65535, 65535, 65535, 65535, 65535, 65535, 65535, 65535, 65535, 65535, 65535, 65535, 65535, 65535, 65535, 65535, 32768, 32768, 32768, 65535, 65535, 65535, 2320, 65535, 65535, 65535, 65535, 65535, 65535, 65535, 65535, 65535, 65535, 65535, 65535, 65535, 65535, 65535, 65535, 65535, 65535, 65535, 0, 65535, 65533, 1, 65534, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0]

   Reading Block at address [40450 (0x9e02)] for device [1]
    Block id     = [702]
    Block length = [50]
    Block type   = [DER Capacity - DER capacity model.]
    Registers    = [702, 50, 10600, 8480, 80, 8480, 80, 10600, 6360, 6360, 65535, 65535, 65535, 65535, 2300, 2530, 2024, 65535, 65535, 65535, 0, 1, 2, 65535, 63487, 65535, 65535, 65535, 65535, 65535, 65535, 65535, 65535, 65535, 65535, 65535, 65535, 65535, 65535, 65535, 65535, 65535, 65535, 65535, 65535, 0, 65534, 0, 0, 65535, 0, 0]

   Reading Block at address [40502 (0x9e36)] for device [1]
    Block id     = [703]
    Block length = [17]
    Block type   = [Enter Service - Enter service model.]
    Registers    = [703, 17, 1, 11000, 9000, 0, 50100, 0, 49900, 0, 60, 0, 0, 0, 300, 65535, 65535, 65534, 65533]

   Reading Block at address [40521 (0x9e49)] for device [1]
    Block id     = [704]
    Block length = [65]
    Block type   = [DER AC Controls - DER AC controls model.]
    Registers    = [704, 65, 0, 65535, 65535, 65535, 65535, 65535, 65535, 65535, 65535, 65535, 65535, 65535, 0, 65535, 65535, 65535, 65535, 65535, 65535, 65535, 0, 0, 65535, 65535, 32768, 0, 65535, 32768, 65535, 65535, 65535, 65535, 65535, 0, 0, 65535, 0, 0, 32768, 0, 0, 32768, 65535, 65535, 65535, 65535, 65535, 65535, 65535, 65535, 65535, 65533, 65534, 0, 65534, 0, 65534, 1000, 0, 65535, 65535, 65535, 65535, 65535, 65535]

   Reading Block at address [40588 (0x9e8c)] for device [1]
    Block id     = [705]
    Block length = [57]
    Block type   = [DER Volt-Var - DER Volt-Var model.]
    Registers    = [705, 57, 0, 0, 1, 6, 2, 65535, 65535, 65535, 65535, 65535, 65534, 65534, 65533, 4, 0, 0, 100, 0, 0, 441, 0, 10500, 1, 5000, 1452, 9783, 1452, 9783, 1452, 10217, 64084, 10217, 64084, 12000, 64084, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0]

   Reading Block at address [40647 (0x9ec7)] for device [1]
    Block id     = [706]
    Block length = [47]
    Block type   = [DER Volt-Watt - DER Volt-Watt model.]
    Registers    = [706, 47, 0, 0, 1, 6, 2, 65535, 65535, 65535, 65535, 65535, 65534, 0, 65533, 6, 0, 0, 10500, 1, 1000, 100, 10000, 100, 10700, 100, 11000, 100, 11200, 100, 12000, 100, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0]

   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.]
    Registers    = [707, 105, 1, 0, 1, 5, 2, 65534, 65533, 1, 2, 7000, 0, 200, 8000, 0, 1950, 0, 8, 55712, 0, 8, 55712, 0, 8, 55712, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0]

   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.]
    Registers    = [708, 105, 1, 0, 1, 5, 2, 65534, 65533, 1, 5, 11500, 0, 80, 11000, 0, 2000, 17391, 8, 55712, 17391, 8, 55712, 17391, 9, 10176, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0]

   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.]
    Registers    = [709, 135, 1, 0, 1, 5, 2, 65534, 65533, 1, 1, 0, 4750, 0, 1900, 0, 2000, 8, 55712, 0, 2000, 8, 55712, 0, 2000, 8, 55712, 0, 2000, 8, 55712, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0]

   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.]
    Registers    = [710, 135, 1, 0, 1, 5, 2, 65534, 65533, 1, 5, 0, 5150, 0, 1900, 0, 10000, 8, 55712, 0, 10000, 8, 55712, 0, 10000, 8, 55712, 0, 10000, 8, 55712, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0]

   Reading Block at address [41184 (0xa0e0)] for device [1]
    Block id     = [711]
    Block length = [32]
    Block type   = [DER Frequency Droop - DER Frequency Droop model.]
    Registers    = [711, 32, 0, 0, 1, 2, 65535, 65535, 65535, 65535, 65535, 65533, 65533, 65533, 0, 30000, 0, 30000, 0, 0, 0, 10500, 32768, 1, 0, 0, 0, 0, 0, 0, 0, 0, 32768, 0]

   Reading Block at address [41218 (0xa102)] for device [1]
    Block id     = [712]
    Block length = [44]
    Block type   = [DER Watt-Var - DER Watt-Var model.]
    Registers    = [712, 44, 0, 0, 1, 6, 2, 65535, 65535, 65535, 65535, 65535, 65534, 65534, 2, 0, 65535, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 10000, 0, 0, 0, 65535, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0]

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

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

  End of SunSpec MAP
  No battery models were found in the SunSpec model list

  SolarEdge-specific battery scan:

  SolarEdge battery probe at [57600 (0xe100)] for device [1]

     Manufacturer     [SolarEdge]
     Model            [Home Battery 48V - 5 modules]
     Firmware Version [48V DCDC 3.5.13]
     Serial Number    [7B0526DA]
     Device id        [112]

     Individual SolarEdge battery registers:
       0xe100 (57600)  Manufacturer             = [SolarEdge]   raw=[21359, 27745, 29253, 25703, 25856, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0]
       0xe110 (57616)  Model                    = [Home Battery 48V - 5 modules]   raw=[18543, 28005, 8258, 24948, 29797, 29305, 8244, 14422, 8237, 8245, 8301, 28516, 30060, 25971, 0, 0]
       0xe120 (57632)  Firmware Version         = [48V DCDC 3.5.13]   raw=[13368, 22048, 17475, 17475, 8243, 11829, 11825, 13056, 0, 0, 0, 0, 0, 0, 0, 0]
       0xe130 (57648)  Serial Number            = [7B0526DA]   raw=[14146, 12341, 12854, 17473, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0]
       0xe140 (57664)  Device Address           = [112]   raw=[112]
       0xe141 (57665)  SunSpec Device ID        = [0]   raw=[0]
       0xe186 (57734)  Status                   = [262144]   raw=[4, 0]
       0xe188 (57736)  Internal Status          = [196608]   raw=[3, 0]

     Raw identification registers 0xe100-0xe141:
       0xe100 (57600)  [  0] = 21359 (0x536f)
       0xe101 (57601)  [  1] = 27745 (0x6c61)
       0xe102 (57602)  [  2] = 29253 (0x7245)
       0xe103 (57603)  [  3] = 25703 (0x6467)
       0xe104 (57604)  [  4] = 25856 (0x6500)
       0xe105 (57605)  [  5] =     0 (0x0000)
       0xe106 (57606)  [  6] =     0 (0x0000)
       0xe107 (57607)  [  7] =     0 (0x0000)
       0xe108 (57608)  [  8] =     0 (0x0000)
       0xe109 (57609)  [  9] =     0 (0x0000)
       0xe10a (57610)  [ 10] =     0 (0x0000)
       0xe10b (57611)  [ 11] =     0 (0x0000)
       0xe10c (57612)  [ 12] =     0 (0x0000)
       0xe10d (57613)  [ 13] =     0 (0x0000)
       0xe10e (57614)  [ 14] =     0 (0x0000)
       0xe10f (57615)  [ 15] =     0 (0x0000)
       0xe110 (57616)  [ 16] = 18543 (0x486f)
       0xe111 (57617)  [ 17] = 28005 (0x6d65)
       0xe112 (57618)  [ 18] =  8258 (0x2042)
       0xe113 (57619)  [ 19] = 24948 (0x6174)
       0xe114 (57620)  [ 20] = 29797 (0x7465)
       0xe115 (57621)  [ 21] = 29305 (0x7279)
       0xe116 (57622)  [ 22] =  8244 (0x2034)
       0xe117 (57623)  [ 23] = 14422 (0x3856)
       0xe118 (57624)  [ 24] =  8237 (0x202d)
       0xe119 (57625)  [ 25] =  8245 (0x2035)
       0xe11a (57626)  [ 26] =  8301 (0x206d)
       0xe11b (57627)  [ 27] = 28516 (0x6f64)
       0xe11c (57628)  [ 28] = 30060 (0x756c)
       0xe11d (57629)  [ 29] = 25971 (0x6573)
       0xe11e (57630)  [ 30] =     0 (0x0000)
       0xe11f (57631)  [ 31] =     0 (0x0000)
       0xe120 (57632)  [ 32] = 13368 (0x3438)
       0xe121 (57633)  [ 33] = 22048 (0x5620)
       0xe122 (57634)  [ 34] = 17475 (0x4443)
       0xe123 (57635)  [ 35] = 17475 (0x4443)
       0xe124 (57636)  [ 36] =  8243 (0x2033)
       0xe125 (57637)  [ 37] = 11829 (0x2e35)
       0xe126 (57638)  [ 38] = 11825 (0x2e31)
       0xe127 (57639)  [ 39] = 13056 (0x3300)
       0xe128 (57640)  [ 40] =     0 (0x0000)
       0xe129 (57641)  [ 41] =     0 (0x0000)
       0xe12a (57642)  [ 42] =     0 (0x0000)
       0xe12b (57643)  [ 43] =     0 (0x0000)
       0xe12c (57644)  [ 44] =     0 (0x0000)
       0xe12d (57645)  [ 45] =     0 (0x0000)
       0xe12e (57646)  [ 46] =     0 (0x0000)
       0xe12f (57647)  [ 47] =     0 (0x0000)
       0xe130 (57648)  [ 48] = 14146 (0x3742)
       0xe131 (57649)  [ 49] = 12341 (0x3035)
       0xe132 (57650)  [ 50] = 12854 (0x3236)
       0xe133 (57651)  [ 51] = 17473 (0x4441)
       0xe134 (57652)  [ 52] =     0 (0x0000)
       0xe135 (57653)  [ 53] =     0 (0x0000)
       0xe136 (57654)  [ 54] =     0 (0x0000)
       0xe137 (57655)  [ 55] =     0 (0x0000)
       0xe138 (57656)  [ 56] =     0 (0x0000)
       0xe139 (57657)  [ 57] =     0 (0x0000)
       0xe13a (57658)  [ 58] =     0 (0x0000)
       0xe13b (57659)  [ 59] =     0 (0x0000)
       0xe13c (57660)  [ 60] =     0 (0x0000)
       0xe13d (57661)  [ 61] =     0 (0x0000)
       0xe13e (57662)  [ 62] =     0 (0x0000)
       0xe13f (57663)  [ 63] =     0 (0x0000)
       0xe140 (57664)  [ 64] =   112 (0x0070)
       0xe141 (57665)  [ 65] =     0 (0x0000)

Disconnected from server
Last edited by hjzwiers on Sunday 04 October 2026 14:10, edited 1 time in total.
hjzwiers
Posts: 320
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 »

deleted post
Last edited by hjzwiers on Sunday 04 October 2026 14:11, edited 1 time in total.
hjzwiers
Posts: 320
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 »

Continuosly scanning the ports .....

hjz@debian:/opt/stacks/domoticz/config/plugins$ sudo docker exec -it domoticz python3 /opt/domoticz/userdata/plugins/scanner6.py 192.168.2.186 1502
==========================================================================================
SolarEdge Battery Diagnostic Scanner 6
LIVE Battery 1 monitor
==========================================================================================
Host : 192.168.2.186
Port : 1502
Device ID : 1
Interval : 10 seconds

Registers:
0xE174 Instantaneous Power
0xE184 State of Energy (SOE)
0xE186 Status
0xE188 Internal Status

Physical direction is determined from power:
> +50 W = CHARGING
< -50 W = DISCHARGING
otherwise = IDLE

Press Ctrl-C to stop.
==========================================================================================
2026-10-04 00:33:20 | #0001 | SOE 72.22% | Power -622.0 W | Actual DISCHARGING | Status 4 CHARGING | Internal 3 DISCHARGING
2026-10-04 00:33:31 | #0002 | SOE 72.22% | Power -641.0 W | Actual DISCHARGING | Status 4 CHARGING | Internal 3 DISCHARGING
2026-10-04 00:33:42 | #0003 | SOE 72.22% | Power -596.0 W | Actual DISCHARGING | Status 4 CHARGING | Internal 3 DISCHARGING
User avatar
imautohuttraeger
Posts: 399
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 »

Here are my results:

Code: Select all


Connecting to server
 Connected to server
  Looking for SunSpec identifier at address [40000 (0x9c40)] for device [1]
  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]
     Device Address: [1]
    Registers    = [1, 65, 21359, 27745, 29253, 25703, 25888, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 21317, 12592, 19245, 21079, 16948, 14402, 17998, 13312, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 12336, 12340, 11824, 12338, 13614, 12336, 12593, 0, 14146, 12343, 12598, 17463, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 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]
    Registers    = [103, 50, 3090, 1027, 1031, 1031, 65534, 4096, 4118, 4118, 2367, 2377, 2374, 65535, 7333, 0, 4999, 65534, 7340, 0, 62219, 65535, 55547, 65534, 290, 27344, 0, 9079, 65533, 8200, 65535, 7445, 0, 32768, 4695, 32768, 32768, 65534, 4, 0, 65535, 65535, 65535, 65535, 0, 0, 65535, 65535, 65535, 65535, 0, 0]
   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]
     Device Address: [2]
    Registers    = [1, 65, 21359, 27745, 29253, 25703, 25856, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 19796, 21037, 12852, 12333, 13136, 17201, 11588, 11585, 11597, 22272, 0, 0, 0, 0, 0, 0, 17784, 28783, 29300, 11081, 28016, 28530, 29696, 0, 12590, 12334, 13874, 0, 0, 0, 0, 0, 13875, 12851, 14647, 25904, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 2]
   Reading Block at address [40188 (0x9cfc)] for device [1]
    Block id     = [203]
    Block length = [105]
    Block type   = [wye-connect three phase (abcn) meter]
    Registers    = [203, 105, 27046, 10100, 8474, 8471, 65533, 2358, 2358, 2360, 2365, 0, 4078, 4092, 4099, 65535, 4999, 65534, 6344, 2396, 1981, 1965, 0, 6344,
2397, 1981, 1966, 0, 61242, 61787, 745, 64246, 65534, 55653, 55627, 55657, 55676, 65534, 21408, 15812, 9440, 22110, 7075, 52050, 6461, 42004, 5565, 34460, 1946,
31456, 2181, 47009, 3006, 56346, 65534, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 32768, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 32768, 0, 0]
   Reading Block at address [40295 (0x9d67)] for device [1]
    Block id     = [701]
    Block length = [153]
    Block type   = [DER AC Measurement - DER AC measurement model.]
    Registers    = [701, 153, 2, 1, 65535, 1, 0, 0, 65535, 65535, 726, 727, 65500, 100, 32768, 4076, 2353, 0, 49993, 65535, 65535, 65535, 65535, 65535, 65535, 65535, 65535, 65535, 65535, 65535, 65535, 65535, 65535, 65535, 65535, 32768, 32768, 32768, 32768, 32768, 32768, 32768, 32768, 32768, 65535, 65535, 65535, 2353, 65535, 65535, 65535, 65535, 65535, 65535, 65535, 65535, 65535, 65535, 65535, 65535, 65535, 65535, 65535, 65535, 32768, 32768, 32768, 65535, 65535, 65535, 2381, 65535, 65535, 65535, 65535, 65535, 65535, 65535, 65535, 65535, 65535, 65535, 65535, 65535, 65535, 65535, 65535, 32768, 32768, 32768, 65535, 65535, 65535, 2380, 65535, 65535, 65535, 65535, 65535, 65535, 65535, 65535, 65535, 65535, 65535, 65535, 65535, 65535, 65535, 65535, 65535, 65535, 65535, 0, 65535, 65533, 1, 65534, 1, 1,
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0]
   Reading Block at address [40450 (0x9e02)] for device [1]
    Block id     = [702]
    Block length = [50]
    Block type   = [DER Capacity - DER capacity model.]
    Registers    = [702, 50, 10000, 8000, 80, 8000, 80, 10000, 6000, 6000, 65535, 65535, 65535, 65535, 2300, 2530, 2024, 65535, 65535, 65535, 0, 1, 2, 65535, 63487, 65535, 65535, 65535, 65535, 65535, 65535, 65535, 65535, 65535, 65535, 65535, 65535, 65535, 65535, 65535, 65535, 65535, 65535, 65535, 65535, 0, 65534, 0, 0, 65535, 0, 0]
   Reading Block at address [40502 (0x9e36)] for device [1]
    Block id     = [703]
    Block length = [17]
    Block type   = [Enter Service - Enter service model.]
    Registers    = [703, 17, 1, 11000, 8500, 0, 50100, 0, 47500, 0, 60, 0, 0, 0, 600, 65535, 65535, 65534, 65533]
   Reading Block at address [40521 (0x9e49)] for device [1]
    Block id     = [704]
    Block length = [65]
    Block type   = [DER AC Controls - DER AC controls model.]
    Registers    = [704, 65, 1, 65535, 65535, 65535, 65535, 65535, 65535, 65535, 65535, 65535, 65535, 65535, 0, 65535, 65535, 65535, 65535, 65535, 65535, 65535,
0, 0, 65535, 65535, 32768, 0, 65535, 32768, 65535, 65535, 65535, 65535, 65535, 0, 0, 65535, 0, 0, 32768, 0, 0, 32768, 65535, 65535, 65535, 65535, 65535, 65535, 65535, 65535, 65535, 65533, 65534, 0, 65534, 0, 65534, 1000, 0, 65535, 65535, 65535, 65535, 65535, 65535]
   Reading Block at address [40588 (0x9e8c)] for device [1]
    Block id     = [705]
    Block length = [57]
    Block type   = [DER Volt-Var - DER Volt-Var model.]
    Registers    = [705, 57, 0, 0, 1, 6, 2, 65535, 65535, 65535, 65535, 65535, 65534, 65534, 65533, 6, 0, 0, 100, 0, 0, 441, 0, 11670, 1, 5000, 4360, 9300, 4360, 9700, 0, 10300, 0, 10700, 61176, 12000, 61176, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0]
   Reading Block at address [40647 (0x9ec7)] for device [1]
    Block id     = [706]
    Block length = [47]
    Block type   = [DER Volt-Watt - DER Volt-Watt model.]
    Registers    = [706, 47, 0, 0, 1, 6, 2, 65535, 65535, 65535, 65535, 65535, 65534, 0, 65533, 6, 0, 0, 11670, 1, 1000, 100, 10000, 100, 10700, 100, 11000, 100, 11500, 100, 12500, 100, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0]
   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.]
    Registers    = [707, 105, 1, 0, 1, 5, 2, 65534, 65533, 1, 2, 4500, 0, 300, 8000, 0, 3000, 0, 8, 55712, 0, 8, 55712, 0, 8, 55712, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0]
   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.]
    Registers    = [708, 105, 1, 0, 1, 5, 2, 65534, 65533, 1, 5, 12500, 0, 100, 17391, 8, 55712, 17391, 8, 55712, 17391, 8, 55712, 11000, 9, 10176, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0]
   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.]
    Registers    = [709, 135, 1, 0, 1, 5, 2, 65534, 65533, 1, 1, 0, 4750, 0, 100, 0, 2000, 8, 55712, 0, 2000, 8, 55712, 0, 2000, 8, 55712, 0, 2000, 8, 55712, 0,
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0]
   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.]
    Registers    = [710, 135, 1, 0, 1, 5, 2, 65534, 65533, 1, 5, 0, 5150, 0, 100, 0, 10000, 8, 55712, 0, 10000, 8, 55712, 0, 10000, 8, 55712, 0, 10000, 8, 55712, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0]
   Reading Block at address [41184 (0xa0e0)] for device [1]
    Block id     = [711]
    Block length = [32]
    Block type   = [DER Frequency Droop - DER Frequency Droop model.]
    Registers    = [711, 32, 0, 0, 1, 2, 65535, 65535, 65535, 65535, 65535, 65533, 65533, 65533, 0, 200, 0, 200, 50, 50, 0, 11670, 32768, 1, 0, 0, 0, 0, 0, 0, 0, 0, 32768, 0]
   Reading Block at address [41218 (0xa102)] for device [1]
    Block id     = [712]
    Block length = [44]
    Block type   = [DER Watt-Var - DER Watt-Var model.]
    Registers    = [712, 44, 0, 0, 1, 6, 2, 65535, 65535, 65535, 65535, 65535, 65534, 65534, 6, 0, 65535, 1, 0, 0, 5000, 0, 6000, 0, 8000, 0, 9000, 0, 10000, 0,
0, 0, 65535, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0]
   Reading Block at address [41264 (0xa130)] for device [1]
    Block id     = [713]
    Block length = [7]
    Block type   = [DER Storage Capacity - DER storage capacity.]
    Registers    = [713, 7, 65535, 65535, 10000, 65535, 65535, 65534, 65534]
   Reading Block at address [41273 (0xa139)] for device [1]
    Block id     = [65535]
    Block length = [0]
    Block type   = [The End of the block list has been reached]
  End of SunSpec MAP
  Looking for Battery at address [57600 (0xe100)] for device [1]
     Manufacturer     [SolarEdge]
     Model            [SolarEdge Home Battery 48V - 3 ]
     Firmware Version [48V DCDC 3.5.13]
     Device id        [112]
No response received after 3 retries, continue with next request
Received ModbusException(Modbus Error: [Input/Output] No response received after 3 retries, continue with next request) from library
     Registers        [None]
  Looking for Battery at address [57856 (0xe200)] for device [1]
   No battery found at this address
Disconnected from server


Stop, look and listen.
hjzwiers
Posts: 320
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 »

I was triggered by the respons from imautohuttraeger because he has the same inverter

I ran the old file and AI sees i ran it with the connection 168 instead of 186 ... sorry for the confusion.

Code: Select all

hjz@debian:/opt/stacks/domoticz/config/plugins$ sudo docker exec -it domoticz python3 /opt/domoticz/userdata/plugins/scanner.py 192.168.2.186 1502
Connecting to server

 Connected to server

  Looking for SunSpec identifier at address [40000 (0x9c40)] for device [1]
  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.0013]
     Device Address: [1]
    Registers    = [1, 65, 21359, 27745, 29253, 25703, 25888, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 21317, 12592, 19245, 21079, 16948, 14402, 17998, 13312, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 12336, 12340, 11824, 12338, 13614, 12336, 12595, 0, 14146, 12341, 12854, 17473, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 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]
    Registers    = [103, 50, 1922, 644, 637, 640, 65534, 4065, 4077, 4045, 2310, 2376, 2348, 65535, 4489, 0, 5001, 65534, 4498, 0, 38464, 65534, 55555, 65534, 748, 41360, 0, 5555, 65533, 8204, 65535, 4558, 0, 32768, 4463, 32768, 32768, 65534, 4, 0, 65535, 65535, 65535, 65535, 0, 0, 65535, 65535, 65535, 65535, 0, 0]

   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.104]
     Device Address: [65535]
    Registers    = [1, 65, 21359, 27745, 29253, 25703, 25856, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 19796, 21037, 12852, 12333, 13136, 17201, 11588, 11585, 11597, 22272, 0, 0, 0, 0, 0, 0, 17784, 28783, 29300, 11081, 28016, 28530, 29696, 0, 12590, 12334, 12592, 13312, 0, 0, 0, 0, 13876, 12337, 25908, 25700, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 65535]

   Reading Block at address [40188 (0x9cfc)] for device [1]
    Block id     = [203]
    Block length = [105]
    Block type   = [wye-connect three phase (abcn) meter]
    Registers    = [203, 105, 3715, 1241, 1023, 1450, 65533, 2302, 2302, 2357, 2328, 0, 4039, 4048, 4017, 65535, 4999, 65534, 15393, 52343, 21270, 7316, 65533, 6852, 2431, 2054, 2952, 65535, 58686, 63410, 63493, 62856, 65535, 65340, 61547, 65086, 3849, 65534, 11064, 47796, 9734, 64076, 6422, 39758, 3622, 17183, 28698, 48272, 5820, 45430, 10548, 61822, 21044, 14416, 65534, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 32768, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 32768, 0, 0]

   Reading Block at address [40295 (0x9d67)] for device [1]
    Block id     = [701]
    Block length = [153]
    Block type   = [DER AC Measurement - DER AC measurement model.]
    Registers    = [701, 153, 2, 1, 65535, 1, 0, 0, 65535, 65535, 449, 450, 65508, 100, 32768, 3999, 2309, 0, 50018, 65535, 65535, 65535, 65535, 65535, 65535, 65535, 65535, 65535, 65535, 65535, 65535, 65535, 65535, 65535, 65535, 32768, 32768, 32768, 32768, 32768, 32768, 32768, 32768, 32768, 65535, 65535, 65535, 2309, 65535, 65535, 65535, 65535, 65535, 65535, 65535, 65535, 65535, 65535, 65535, 65535, 65535, 65535, 65535, 65535, 32768, 32768, 32768, 65535, 65535, 65535, 2375, 65535, 65535, 65535, 65535, 65535, 65535, 65535, 65535, 65535, 65535, 65535, 65535, 65535, 65535, 65535, 65535, 32768, 32768, 32768, 65535, 65535, 65535, 2346, 65535, 65535, 65535, 65535, 65535, 65535, 65535, 65535, 65535, 65535, 65535, 65535, 65535, 65535, 65535, 65535, 65535, 65535, 65535, 0, 65535, 65533, 1, 65534, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0]

   Reading Block at address [40450 (0x9e02)] for device [1]
    Block id     = [702]
    Block length = [50]
    Block type   = [DER Capacity - DER capacity model.]
    Registers    = [702, 50, 10600, 8480, 80, 8480, 80, 10600, 6360, 6360, 65535, 65535, 65535, 65535, 2300, 2530, 2024, 65535, 65535, 65535, 0, 1, 2, 65535, 63487, 65535, 65535, 65535, 65535, 65535, 65535, 65535, 65535, 65535, 65535, 65535, 65535, 65535, 65535, 65535, 65535, 65535, 65535, 65535, 65535, 0, 65534, 0, 0, 65535, 0, 0]

   Reading Block at address [40502 (0x9e36)] for device [1]
    Block id     = [703]
    Block length = [17]
    Block type   = [Enter Service - Enter service model.]
    Registers    = [703, 17, 1, 11000, 9000, 0, 50100, 0, 49900, 0, 60, 0, 0, 0, 300, 65535, 65535, 65534, 65533]

   Reading Block at address [40521 (0x9e49)] for device [1]
    Block id     = [704]
    Block length = [65]
    Block type   = [DER AC Controls - DER AC controls model.]
    Registers    = [704, 65, 0, 65535, 65535, 65535, 65535, 65535, 65535, 65535, 65535, 65535, 65535, 65535, 0, 65535, 65535, 65535, 65535, 65535, 65535, 65535, 0, 0, 65535, 65535, 32768, 0, 65535, 32768, 65535, 65535, 65535, 65535, 65535, 0, 0, 65535, 0, 0, 32768, 0, 0, 32768, 65535, 65535, 65535, 65535, 65535, 65535, 65535, 65535, 65535, 65533, 65534, 0, 65534, 0, 65534, 1000, 0, 65535, 65535, 65535, 65535, 65535, 65535]

   Reading Block at address [40588 (0x9e8c)] for device [1]
    Block id     = [705]
    Block length = [57]
    Block type   = [DER Volt-Var - DER Volt-Var model.]
    Registers    = [705, 57, 0, 0, 1, 6, 2, 65535, 65535, 65535, 65535, 65535, 65534, 65534, 65533, 4, 0, 0, 100, 0, 0, 441, 0, 10500, 1, 5000, 1452, 9783, 1452, 9783, 1452, 10217, 64084, 10217, 64084, 12000, 64084, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0]

   Reading Block at address [40647 (0x9ec7)] for device [1]
    Block id     = [706]
    Block length = [47]
    Block type   = [DER Volt-Watt - DER Volt-Watt model.]
    Registers    = [706, 47, 0, 0, 1, 6, 2, 65535, 65535, 65535, 65535, 65535, 65534, 0, 65533, 6, 0, 0, 10500, 1, 1000, 100, 10000, 100, 10700, 100, 11000, 100, 11200, 100, 12000, 100, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0]

   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.]
    Registers    = [707, 105, 1, 0, 1, 5, 2, 65534, 65533, 1, 2, 7000, 0, 200, 8000, 0, 1950, 0, 8, 55712, 0, 8, 55712, 0, 8, 55712, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0]

   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.]
    Registers    = [708, 105, 1, 0, 1, 5, 2, 65534, 65533, 1, 5, 11500, 0, 80, 11000, 0, 2000, 17391, 8, 55712, 17391, 8, 55712, 17391, 9, 10176, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0]

   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.]
    Registers    = [709, 135, 1, 0, 1, 5, 2, 65534, 65533, 1, 1, 0, 4750, 0, 1900, 0, 2000, 8, 55712, 0, 2000, 8, 55712, 0, 2000, 8, 55712, 0, 2000, 8, 55712, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0]

   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.]
    Registers    = [710, 135, 1, 0, 1, 5, 2, 65534, 65533, 1, 5, 0, 5150, 0, 1900, 0, 10000, 8, 55712, 0, 10000, 8, 55712, 0, 10000, 8, 55712, 0, 10000, 8, 55712, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0]

   Reading Block at address [41184 (0xa0e0)] for device [1]
    Block id     = [711]
    Block length = [32]
    Block type   = [DER Frequency Droop - DER Frequency Droop model.]
    Registers    = [711, 32, 0, 0, 1, 2, 65535, 65535, 65535, 65535, 65535, 65533, 65533, 65533, 0, 30000, 0, 30000, 0, 0, 0, 10500, 32768, 1, 0, 0, 0, 0, 0, 0, 0, 0, 32768, 0]

   Reading Block at address [41218 (0xa102)] for device [1]
    Block id     = [712]
    Block length = [44]
    Block type   = [DER Watt-Var - DER Watt-Var model.]
    Registers    = [712, 44, 0, 0, 1, 6, 2, 65535, 65535, 65535, 65535, 65535, 65534, 65534, 2, 0, 65535, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 10000, 0, 0, 0, 65535, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0]

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

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

  End of SunSpec MAP

  Looking for Battery at address [57600 (0xe100)] for device [1]

     Manufacturer     [SolarEdge]
     Model            [Home Battery 48V - 5 modules]
     Firmware Version [48V DCDC 3.5.13]
     Device id        [112]
No response received after 3 retries, continue with next request
Received ModbusException(Modbus Error: [Input/Output] No response received after 3 retries, continue with next request) from library
     Registers        [None]

  Looking for Battery at address [57856 (0xe200)] for device [1]
   No battery found at this address

Disconnected from server
User avatar
imautohuttraeger
Posts: 399
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 »

hjzwiers wrote: Sunday 04 October 2026 13:20 i ran it with the connection 168 instead of 186 ... sorry for the confusion.
Actually, that sort of things usually happen to me an not to other people. 😀
Stop, look and listen.
hjzwiers
Posts: 320
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 »

I made an version with AI to detect all the variables:

Code: Select all

hjz@debian:/opt/stacks/domoticz/config/plugins$ sudo docker exec -it domoticz python3 /opt/domoticz/userdata/plugins/scanner11.py 192.168.2.186 1502
==============================================================================
Scanner11 - SolarEdge decoded inverter/meter/battery report
==============================================================================
Target: 192.168.2.186:1502  Modbus ID: 1
Time:   2026-10-04T14:29:12
READ ONLY - no Modbus writes
==============================================================================
Connected

==============================================================================
BATTERY - SOLAREDGE PROPRIETARY MAP
==============================================================================
  Manufacturer                       SolarEdge
  Model                              Home Battery 48V - 5 modules
  Firmware                           48V DCDC 3.5.13
  Serial                             7B0526DA
  Modbus ID                          112
    raw Modbus ID                   : 0070
  SunSpec DID                        0
    raw SunSpec DID                 : 0000

Battery measurements:
  Rated energy                       23000.000 Wh
    raw Rated energy                : B000 46B3
  Max charge continuous              5000.000 W
    raw Max charge continuous       : 4000 459C
  Max discharge continuous           5000.000 W
    raw Max discharge continuous    : 4000 459C
  Max charge peak                    5000.000 W
    raw Max charge peak             : 4000 459C
  Max discharge peak                 5000.000 W
    raw Max discharge peak          : 4000 459C
  Average temperature                25.400 C
    raw Average temperature         : 3333 41CB
  Max temperature                    0.000 C
    raw Max temperature             : 0000 0000
  Instantaneous voltage              819.967 V
    raw Instantaneous voltage       : FDDE 444C
  Instantaneous current              -6.030 A
    raw Instantaneous current       : F8E4 C0C0
  Instantaneous power                4939.000 W
    raw Instantaneous power         : 5800 459A
  Max energy                         23000.000 Wh
    raw Max energy                  : B000 46B3
  Available energy                   22118.400 Wh
    raw Available energy            : CCCD 46AC
  SOH                                96.000 %
    raw SOH                         : 0000 42C0
  SOE                                84.444 %
    raw SOE                         : E38E 42A8
  Total exported energy              4532 Wh
    raw Total exported energy       : 11B4 0000 0000 0000
  Total imported energy              10304 Wh
    raw Total imported energy       : 2840 0000 0000 0000
  Status                             3 (DISCHARGING)
    raw Status                      : 0003 0000
  Internal status                    3 (DISCHARGING)
    raw Internal status             : 0003 0000
  Event log                          0000 0000 0000 0000 0000 0000 0000 0000
  Internal event log                 0000 0000 0000 0000 0000 0000 0000 0000

==============================================================================
SUNSPEC INVERTER
==============================================================================

Model 1 - Common inverter information
  Manufacturer                       SolarEdge
  Model                              SE10K-RWB48BFN4
  Version
  Serial                             (outside read)
    raw first 67 registers          : 5375 6E53 0001 0041 536F 6C61 7245 6467 6520 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 5345 3130 4B2D 5257 4234 3842 464E 3400 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 3030 3034 2E30 3032 352E 3030 3133 0000 3742 3035 3236 4441 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000

Model 103 - Three-phase inverter
    raw model 103                   : 0067 0032 013B 0069 0069 0068 FFFE 0FE7 0FF5 0FD3 090F 0944 0935 FFFF 1C19 FFFF 1386 FFFE 1CE9 FFFF BC07 FFFE DA09 FFFE 02EC AC04 0000 22C3 FFFC 200E FFFF 1C87 FFFF 8000 11CA 8000 8000 FFFE 0004 0000 FFFF FFFF FFFF FFFF 0000 0000 FFFF FFFF FFFF FFFF
  DID                                103
  Model length                       50
  AC Current A                       315
  AC Current B                       105
  AC Current C                       105
  AC Current scale factor            104
  AC Voltage AB                      65534
  AC Voltage BC                      4071
  AC Voltage CA                      4085
  AC Voltage scale factor            4051
  AC Voltage AN                      2319
  AC Voltage BN                      2372
  AC Voltage CN                      2357
  AC Voltage LL scale factor         65535
  AC Voltage LN scale factor         7193
  AC Power                           65535
  AC Power scale factor              4998
  Frequency                          65534
  Frequency scale factor             7401
  Power Factor                       65535
  Power Factor scale factor          48135
  Reactive Power                     65534
  Reactive Power scale factor        55817
  Apparent Power                     65534
  Apparent Power scale factor        748
  Energy Today                       44036
  Energy Today scale factor          0
  Energy Total                       8899
  Energy Total scale factor          65532
  DC Current                         8206
  DC Current scale factor            65535
  DC Voltage                         7303
  DC Voltage scale factor            65535
  DC Power                           32768
  DC Power scale factor              4554
  Temperature                        32768
  Temperature scale factor           32768

Raw Model 103 registers:
  40069 0x9C85: 0067 0032 013B 0069 0069 0068 FFFE 0FE7
  40077 0x9C8D: 0FF5 0FD3 090F 0944 0935 FFFF 1C19 FFFF
  40085 0x9C95: 1386 FFFE 1CE9 FFFF BC07 FFFE DA09 FFFE
  40093 0x9C9D: 02EC AC04 0000 22C3 FFFC 200E FFFF 1C87
  40101 0x9CA5: FFFF 8000 11CA 8000 8000 FFFE 0004 0000
  40109 0x9CAD: FFFF FFFF FFFF FFFF 0000 0000 FFFF FFFF
  40117 0x9CB5: FFFF FFFF

==============================================================================
SUNSPEC METER
==============================================================================
  Manufacturer                       SolarEdge
  Model                              MTR-240-3PC1-D-A-MW
  Options                            Export+Import
  Version
  Serial
    raw meter common                : 0001 0041 536F 6C61 7245 6467 6500 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 4D54 522D 3234 302D 3350 4331 2D44 2D41 2D4D 5700 0000 0000 0000 0000 0000 0000 4578 706F 7274 2B49 6D70 6F72 7400 0000 312E 302E 3130 3400 0000 0000 0000 0000 3634 3031 6534 6464 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000

Model 203 - Three-phase meter
  DID                                203
  Model length                       105

Raw Model 203 registers:
  40188 0x9CFC: 00CB 0069 0BF6 0422 02AE 0524 FFFD 0902
  40196 0x9D04: 0902 0939 092E 0000 0FD5 0FE4 0FC3 FFFF
  40204 0x9D0C: 1387 FFFE B94F 17BC BF08 E28A FFFD 73C3
  40212 0x9D14: 5783 3017 6EBC FFFE 8C74 DAB7 D3DE DDE0
  40220 0x9D1C: FFFE FB78 DF13 F1F0 2166 FFFE 2B38 C2E8
  40228 0x9D24: 2607 3DE0 1916 B322 0E26 4338 701A C780
  40236 0x9D2C: 16BC B176 2934 F278 5234 94E4 FFFE 0000
  40244 0x9D34: 0000 0000 0000 0000 0000 0000 0000 0000
  40252 0x9D3C: 0000 0000 0000 0000 0000 0000 0000 8000
  40260 0x9D44: 0000 0000 0000 0000 0000 0000 0000 0000
  40268 0x9D4C: 0000 0000 0000 0000 0000 0000 0000 0000
  40276 0x9D54: 0000 0000 0000 0000 0000 0000 0000 0000
  40284 0x9D5C: 0000 0000 0000 0000 0000 0000 0000 0000
  40292 0x9D64: 8000

==============================================================================
SUNSPEC MODELS 701+
==============================================================================
  40300 0x9D6C: 0001 0000 0000 FFFF FFFF 0047 0049 FFEF
  40308 0x9D74: 0061 8000 0FB1 090F 0000 C356 FFFF FFFF
  40316 0x9D7C: FFFF FFFF FFFF FFFF FFFF FFFF FFFF FFFF
  40324 0x9D84: FFFF FFFF FFFF FFFF FFFF FFFF 8000 8000
  40332 0x9D8C: 8000 8000 8000 8000 8000 8000 8000 FFFF
  40340 0x9D94: FFFF FFFF 090F FFFF FFFF FFFF FFFF FFFF
  40348 0x9D9C: FFFF FFFF FFFF FFFF FFFF FFFF FFFF FFFF
  40356 0x9DA4: FFFF FFFF FFFF 8000 8000 8000 FFFF FFFF
  40364 0x9DAC: FFFF 0946 FFFF FFFF FFFF FFFF FFFF FFFF
  40372 0x9DB4: FFFF FFFF FFFF FFFF FFFF FFFF FFFF FFFF
  40380 0x9DBC: FFFF FFFF 8000 8000 8000 FFFF FFFF FFFF
  40388 0x9DC4: 0939 FFFF FFFF FFFF FFFF FFFF FFFF FFFF
  40396 0x9DCC: FFFF FFFF FFFF FFFF FFFF FFFF FFFF FFFF
  40404 0x9DD4: FFFF FFFF FFFF FFFF 0000 FFFF FFFD 0001
  40412 0x9DDC: FFFE 0001 0001 0000 0000 0000 0000 0000
  40420 0x9DE4: 0000 0000 0000 0000 0000

==============================================================================
SCAN COMPLETE
==============================================================================
hjzwiers
Posts: 320
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 »

It proves im still human lol
imautohuttraeger wrote: Sunday 04 October 2026 14:19
hjzwiers wrote: Sunday 04 October 2026 13:20 i ran it with the connection 168 instead of 186 ... sorry for the confusion.
Actually, that sort of things usually happen to me an not to other people. 😀
hskip
Posts: 3
Joined: Monday 19 October 2015 21:28
Target OS: Raspberry Pi / ODroid
Domoticz version:
Contact:

Re: New Python plugin: Domoticz SolarEdge_ModbusTCP

Post by hskip »

Here is the result of scanning my SolarEdge SE3000; hopefully, it provides the desired information.

(venv) hans@RPIpilot:~/scanner $ python scanner.py 192.168.178.77 502
Connecting to server

Connected to server

Looking for SunSpec identifier at address [40000 (0x9c40)] for device [1]
The inverter is providing a SunSpec Map

Reading Block at address [40002 (0x9c42)] for device [1]
ERROR: request ask for transaction_id=2 but got id=1, Skipping.
Block id = [1]
Block length = [65]
Block type = [Common - All SunSpec compliant devices must include this as the first model]
Manufacturer: [SolarEdge ]
Model: [SE3000]
Options: []
Version: [0003.2537]
Device Address: [1]
Registers = [1, 65, 21359, 27745, 29253, 25703, 25888, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 21317, 13104, 12336, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 12336, 12339, 11826, 13619, 14080, 0, 0, 0, 14150, 12601, 12354, 17207, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1]

Reading Block at address [40069 (0x9c85)] for device [1]
Block id = [101]
Block length = [50]
Block type = [Inverter (Single Phase) - Include this model for single phase inverter monitoring]
Registers = [101, 50, 26562, 26562, 65535, 65535, 65531, 2327, 65535, 65535, 65535, 65535, 65535, 65535, 10000, 65533, 49966, 65533, 6132, 65534, 6050, 65534, 56167, 65534, 639, 27240, 0, 28956, 65530, 3506, 65535, 10152, 65533, 32768, 2541, 32768, 32768, 65534, 4, 0, 65535, 65535, 65535, 65535, 0, 0, 65535, 65535, 65535, 65535, 0, 0]

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

End of SunSpec MAP

Looking for Battery at address [57600 (0xe100)] for device [1]
No battery found at this address

Looking for Battery at address [57856 (0xe200)] for device [1]
Received ModbusException(Modbus Error: [Connection] ModbusTcpClient 192.168.178.77:502: Connection unexpectedly closed 0.000 seconds into read of unbounded read bytes without response from device before it closed connection) from library
Traceback (most recent call last):
File "/home/hans/scanner/scanner.py", line 389, in <module>
process_battery(client=client, device_id=args.device_id, address=57856, dump=args.do_not_dump_registers)
~~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/home/hans/scanner/scanner.py", line 331, in process_battery
if battery_device_id == 255 or registers[0] == 0:
~~~~~~~~~^^^
IndexError: list index out of range
(venv) hans@RPIpilot:~/scanner $ python3 scanner.py 192.168.178.77 502
Connecting to server

Connected to server

Looking for SunSpec identifier at address [40000 (0x9c40)] for device [1]
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: [SE3000]
Options: []
Version: [0003.2537]
Device Address: [1]
Registers = [1, 65, 21359, 27745, 29253, 25703, 25888, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 21317, 13104, 12336, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 12336, 12339, 11826, 13619, 14080, 0, 0, 0, 14150, 12601, 12354, 17207, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1]

Reading Block at address [40069 (0x9c85)] for device [1]
Block id = [101]
Block length = [50]
Block type = [Inverter (Single Phase) - Include this model for single phase inverter monitoring]
Registers = [101, 50, 28125, 28125, 65535, 65535, 65531, 2335, 65535, 65535, 65535, 65535, 65535, 65535, 18000, 65533, 49968, 65533, 6504, 65534, 6250, 65534, 64663, 65534, 639, 27240, 0, 5191, 65531, 3520, 65535, 18274, 65533, 32768, 2526, 32768, 32768, 65534, 4, 0, 65535, 65535, 65535, 65535, 0, 0, 65535, 65535, 65535, 65535, 0, 0]

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

End of SunSpec MAP

Looking for Battery at address [57600 (0xe100)] for device [1]
No battery found at this address

Looking for Battery at address [57856 (0xe200)] for device [1]
Received ModbusException(Modbus Error: [Connection] ModbusTcpClient 192.168.178.77:502: Connection unexpectedly closed 0.000 seconds into read of unbounded read bytes without response from device before it closed connection) from library
Traceback (most recent call last):
File "/home/hans/scanner/scanner.py", line 389, in <module>
process_battery(client=client, device_id=args.device_id, address=57856, dump=args.do_not_dump_registers)
~~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/home/hans/scanner/scanner.py", line 331, in process_battery
if battery_device_id == 255 or registers[0] == 0:
~~~~~~~~~^^^
IndexError: list index out of range
AddieJanssen
Posts: 45
Joined: Sunday 27 September 2020 16:17
Target OS: -
Domoticz version:
Contact:

Re: New Python plugin: Domoticz SolarEdge_ModbusTCP

Post by AddieJanssen »

Thanks all! This is exactly why I need your help.

It's clear that reading the battery details is not working at all. I will look into that later this week.

On the positive side: I have used the information you all provided to start creating a replacement of the solaredge_modbus library.
Focus is on the values that do work, next step is to look at the stuff that isn't working (mainly optional values that SolarEdge did not implement).

Here's a glimpse (based on a scan of hjzwiers) of the things that do work:

Code: Select all

========================================== DEVICE DETAILS ==========================================
[id]           [1]
[name]         [common]
[label]        [Common]
[description]  [All SunSpec compliant devices must include this as the first model]
------------------------------------------- MEASUREMENTS -------------------------------------------
[id]           Decoded value [1]
[l]            Decoded value [65]
[mn]           Decoded value [SolarEdge ]
[md]           Decoded value [SE10K-RWB48BFN4]
[opt]          Decoded value []
[vr]           Decoded value [0004.0025.0013]
[sn]           Decoded value [7B0526DA]
[da]           Decoded value [1]
====================================================================================================

========================================== DEVICE DETAILS ==========================================
[id]           [103]
[name]         [inverter_three_phase]
[label]        [Inverter (Three Phase)]
[description]  [Include this model for three phase inverter monitoring]
------------------------------------------- MEASUREMENTS -------------------------------------------
[id]           Decoded value [103]
[l]            Decoded value [50]
[a]            Decoded value [242] Scale factor [a_sf] Scaled value [2.42]
[apha]         Decoded value [82] Scale factor [a_sf] Scaled value [0.82]
[aphb]         Decoded value [79] Scale factor [a_sf] Scaled value [0.79]
[aphc]         Decoded value [80] Scale factor [a_sf] Scaled value [0.80]
[a_sf]         Decoded value [-2]
[ppvphab]      Decoded value [4014] Scale factor [v_sf] Scaled value [401.40]
[ppvphbc]      Decoded value [4034] Scale factor [v_sf] Scaled value [403.40]
[ppvphca]      Decoded value [4031] Scale factor [v_sf] Scaled value [403.10]
[phvpha]       Decoded value [2323] Scale factor [v_sf] Scaled value [232.30]
[phvphb]       Decoded value [2314] Scale factor [v_sf] Scaled value [231.40]
[phvphc]       Decoded value [2333] Scale factor [v_sf] Scaled value [233.30]
[v_sf]         Decoded value [-1]
[w]            Decoded value [5212] Scale factor [w_sf] Scaled value [521.20]
[w_sf]         Decoded value [-1]
[hz]           Decoded value [5001] Scale factor [hz_sf] Scaled value [50.01]
[hz_sf]        Decoded value [-2]
[va]           Decoded value [5640] Scale factor [va_sf] Scaled value [564.00]
[va_sf]        Decoded value [-1]
[var]          Decoded value [-21553] Scale factor [var_sf] Scaled value [-215.53]
[var_sf]       Decoded value [-2]
[pf]           Decoded value [-9238] Scale factor [pf_sf] Scaled value [-92.38]
[pf_sf]        Decoded value [-2]
[wh]           Decoded value [49052008] Scale factor [wh_sf] Scale = 1 - no change to value
[wh_sf]        Decoded value [0]
[dca]          Decoded value [6450] Scale factor [dca_sf] Scaled value [0.65]
[dca_sf]       Decoded value [-4]
[dcv]          Decoded value [8202] Scale factor [dcv_sf] Scaled value [820.20]
[dcv_sf]       Decoded value [-1]
[dcw]          Decoded value [5291] Scale factor [dcw_sf] Scaled value [529.10]
[dcw_sf]       Decoded value [-1]
[tmpcab]       Decoded value [-32768] Scale factor [tmp_sf] Scaled value [-327.68]
[tmpsnk]       Decoded value [4319] Scale factor [tmp_sf] Scaled value [43.19]
[tmptrns]      Decoded value [-32768] Scale factor [tmp_sf] Scaled value [-327.68]
[tmpot]        Decoded value [-32768] Scale factor [tmp_sf] Scaled value [-327.68]
[tmp_sf]       Decoded value [-2]
[st]           Decoded value [MPPT]
[stvnd]        Decoded value [0]
[evt1]         Decoded value [4294967295]
[evt2]         Decoded value [4294967295]
[evtvnd1]      Decoded value [0]
[evtvnd2]      Decoded value [4294967295]
[evtvnd3]      Decoded value [4294967295]
[evtvnd4]      Decoded value [0]
====================================================================================================

========================================== DEVICE DETAILS ==========================================
[id]           [1]
[name]         [common]
[label]        [Common]
[description]  [All SunSpec compliant devices must include this as the first model]
------------------------------------------- MEASUREMENTS -------------------------------------------
[id]           Decoded value [1]
[l]            Decoded value [65]
[mn]           Decoded value [SolarEdge]
[md]           Decoded value [MTR-240-3PC1-D-A-MW]
[opt]          Decoded value [Export+Import]
[vr]           Decoded value [1.0.104]
[sn]           Decoded value [6401e4dd]
[da]           Decoded value [65535]
====================================================================================================

========================================== DEVICE DETAILS ==========================================
[id]               [203]
[name]             [ac_meter_abcn]
[label]            [wye-connect three phase (abcn) meter]
[description]      []
------------------------------------------- MEASUREMENTS -------------------------------------------
[id]               Decoded value [203]
[l]                Decoded value [105]
[a]                Decoded value [25497] Scale factor [a_sf] Scaled value [2.55]
[apha]             Decoded value [8819] Scale factor [a_sf] Scaled value [0.88]
[aphb]             Decoded value [6429] Scale factor [a_sf] Scaled value [0.64]
[aphc]             Decoded value [10248] Scale factor [a_sf] Scaled value [1.02]
[a_sf]             Decoded value [-4]
[phv]              Decoded value [2317] Scale factor [v_sf] Scaled value [231.70]
[phvpha]           Decoded value [2317] Scale factor [v_sf] Scaled value [231.70]
[phvphb]           Decoded value [2312] Scale factor [v_sf] Scaled value [231.20]
[phvphc]           Decoded value [2328] Scale factor [v_sf] Scaled value [232.80]
[ppv]              Decoded value [0] Scale factor [v_sf] Scaled value [0.00]
[phvphab]          Decoded value [4005] Scale factor [v_sf] Scaled value [400.50]
[phvphbc]          Decoded value [4025] Scale factor [v_sf] Scaled value [402.50]
[phvphca]          Decoded value [4021] Scale factor [v_sf] Scaled value [402.10]
[v_sf]             Decoded value [-1]
[hz]               Decoded value [5000] Scale factor [hz_sf] Scaled value [50.00]
[hz_sf]            Decoded value [-2]
[w]                Decoded value [-5526] Scale factor [w_sf] Scaled value [-5.53]
[wpha]             Decoded value [13265] Scale factor [w_sf] Scaled value [13.27]
[wphb]             Decoded value [32026] Scale factor [w_sf] Scaled value [32.03]
[wphc]             Decoded value [14718] Scale factor [w_sf] Scaled value [14.72]
[w_sf]             Decoded value [-3]
[va]               Decoded value [4256] Scale factor [va_sf] Scaled value [425.60]
[vapha]            Decoded value [1717] Scale factor [va_sf] Scaled value [171.70]
[vaphb]            Decoded value [1159] Scale factor [va_sf] Scaled value [115.90]
[vaphc]            Decoded value [1991] Scale factor [va_sf] Scaled value [199.10]
[va_sf]            Decoded value [-1]
[var]              Decoded value [-4255] Scale factor [var_sf] Scaled value [-425.50]
[varpha]           Decoded value [-1525] Scale factor [var_sf] Scaled value [-152.50]
[varphb]           Decoded value [-1114] Scale factor [var_sf] Scaled value [-111.40]
[varphc]           Decoded value [-1616] Scale factor [var_sf] Scaled value [-161.60]
[var_sf]           Decoded value [-1]
[pf]               Decoded value [-33] Scale factor [pf_sf] Scaled value [-0.33]
[pfpha]            Decoded value [-3499] Scale factor [pf_sf] Scaled value [-34.99]
[pfphb]            Decoded value [-1630] Scale factor [pf_sf] Scaled value [-16.30]
[pfphc]            Decoded value [5030] Scale factor [pf_sf] Scaled value [50.30]
[pf_sf]            Decoded value [-2]
[totwhexp]         Decoded value [725129200] Scale factor [totwh_sf] Scaled value [7251292.00]
[totwhexppha]      Decoded value [637823200] Scale factor [totwh_sf] Scaled value [6378232.00]
[totwhexpphb]      Decoded value [420841750] Scale factor [totwh_sf] Scaled value [4208417.50]
[totwhexpphc]      Decoded value [237283750] Scale factor [totwh_sf] Scaled value [2372837.50]
[totwhimp]         Decoded value [1880790400] Scale factor [totwh_sf] Scaled value [18807904.00]
[totwhimppha]      Decoded value [381431025] Scale factor [totwh_sf] Scaled value [3814310.25]
[totwhimpphb]      Decoded value [691130700] Scale factor [totwh_sf] Scaled value [6911307.00]
[totwhimpphc]      Decoded value [1379048200] Scale factor [totwh_sf] Scaled value [13790482.00]
[totwh_sf]         Decoded value [-2]
[totvahexp]        Decoded value [0] Scale factor [totvah_sf] Scaled value [0.00]
[totvahexppha]     Decoded value [0] Scale factor [totvah_sf] Scaled value [0.00]
[totvahexpphb]     Decoded value [0] Scale factor [totvah_sf] Scaled value [0.00]
[totvahexpphc]     Decoded value [0] Scale factor [totvah_sf] Scaled value [0.00]
[totvahimp]        Decoded value [0] Scale factor [totvah_sf] Scaled value [0.00]
[totvahimppha]     Decoded value [0] Scale factor [totvah_sf] Scaled value [0.00]
[totvahimpphb]     Decoded value [0] Scale factor [totvah_sf] Scaled value [0.00]
[totvahimpphc]     Decoded value [0] Scale factor [totvah_sf] Scaled value [0.00]
[totvah_sf]        Decoded value [-32768]
[totvarhimpq1]     Decoded value [0] Scale factor [totvarh_sf] Scaled value [0.00]
[totvarhimpq1pha]  Decoded value [0] Scale factor [totvarh_sf] Scaled value [0.00]
[totvarhimpq1phb]  Decoded value [0] Scale factor [totvarh_sf] Scaled value [0.00]
[totvarhimpq1phc]  Decoded value [0] Scale factor [totvarh_sf] Scaled value [0.00]
[totvarhimpq2]     Decoded value [0] Scale factor [totvarh_sf] Scaled value [0.00]
[totvarhimpq2pha]  Decoded value [0] Scale factor [totvarh_sf] Scaled value [0.00]
[totvarhimpq2phb]  Decoded value [0] Scale factor [totvarh_sf] Scaled value [0.00]
[totvarhimpq2phc]  Decoded value [0] Scale factor [totvarh_sf] Scaled value [0.00]
[totvarhexpq3]     Decoded value [0] Scale factor [totvarh_sf] Scaled value [0.00]
[totvarhexpq3pha]  Decoded value [0] Scale factor [totvarh_sf] Scaled value [0.00]
[totvarhexpq3phb]  Decoded value [0] Scale factor [totvarh_sf] Scaled value [0.00]
[totvarhexpq3phc]  Decoded value [0] Scale factor [totvarh_sf] Scaled value [0.00]
[totvarhexpq4]     Decoded value [0] Scale factor [totvarh_sf] Scaled value [0.00]
[totvarhexpq4pha]  Decoded value [0] Scale factor [totvarh_sf] Scaled value [0.00]
[totvarhexpq4phb]  Decoded value [0] Scale factor [totvarh_sf] Scaled value [0.00]
[totvarhexpq4phc]  Decoded value [0] Scale factor [totvarh_sf] Scaled value [0.00]
[totvarh_sf]       Decoded value [-32768]
[evt]              Decoded value [0]
====================================================================================================

========================================== DEVICE DETAILS ==========================================
[id]           [705]
[name]         [DERVoltVar]
[label]        [DER Volt-Var]
[description]  [DER Volt-Var model.]
------------------------------------------- MEASUREMENTS -------------------------------------------
[id]           Decoded value [705]
[l]            Decoded value [57]
[ena]          Decoded value [DISABLED]
[adptcrvreq]   Decoded value [0]
[adptcrvrslt]  Decoded value [COMPLETED]
[npt]          Decoded value [6]
[ncrv]         Decoded value [2]
[rvrttms]      Decoded value [4294967295]
[rvrtrem]      Decoded value [4294967295]
[rvrtcrv]      Decoded value [65535]
[v_sf]         Decoded value [-2]
[deptref_sf]   Decoded value [-2]
[rsptms_sf]    Decoded value [-3]
====================================================================================================

========================================== DEVICE DETAILS ==========================================
[id]           [706]
[name]         [DERVoltWatt]
[label]        [DER Volt-Watt]
[description]  [DER Volt-Watt model.]
------------------------------------------- MEASUREMENTS -------------------------------------------
[id]           Decoded value [706]
[l]            Decoded value [47]
[ena]          Decoded value [DISABLED]
[adptcrvreq]   Decoded value [0]
[adptcrvrslt]  Decoded value [COMPLETED]
[npt]          Decoded value [6]
[ncrv]         Decoded value [2]
[rvrttms]      Decoded value [4294967295]
[rvrtrem]      Decoded value [4294967295]
[rvrtcrv]      Decoded value [65535]
[v_sf]         Decoded value [-2]
[deptref_sf]   Decoded value [0]
[rsptms_sf]    Decoded value [-3]
====================================================================================================

========================================== DEVICE DETAILS ==========================================
[id]           [707]
[name]         [DERTripLV]
[label]        [DER Trip LV]
[description]  [DER low voltage trip model.]
------------------------------------------- MEASUREMENTS -------------------------------------------
[id]           Decoded value [707]
[l]            Decoded value [105]
[ena]          Decoded value [ENABLED]
[adptcrvreq]   Decoded value [0]
[adptcrvrslt]  Decoded value [COMPLETED]
[npt]          Decoded value [5]
[ncrvset]      Decoded value [2]
[v_sf]         Decoded value [-2]
[tms_sf]       Decoded value [-3]
====================================================================================================

========================================== DEVICE DETAILS ==========================================
[id]           [708]
[name]         [DERTripHV]
[label]        [DER Trip HV]
[description]  [DER high voltage trip model.]
------------------------------------------- MEASUREMENTS -------------------------------------------
[id]           Decoded value [708]
[l]            Decoded value [105]
[ena]          Decoded value [ENABLED]
[adptcrvreq]   Decoded value [0]
[adptcrvrslt]  Decoded value [COMPLETED]
[npt]          Decoded value [5]
[ncrvset]      Decoded value [2]
[v_sf]         Decoded value [-2]
[tms_sf]       Decoded value [-3]
====================================================================================================

========================================== DEVICE DETAILS ==========================================
[id]           [709]
[name]         [DERTripLF]
[label]        [DER Trip LF]
[description]  [DER low frequency trip model.]
------------------------------------------- MEASUREMENTS -------------------------------------------
[id]           Decoded value [709]
[l]            Decoded value [135]
[ena]          Decoded value [ENABLED]
[adptcrvreq]   Decoded value [0]
[adptcrvrslt]  Decoded value [COMPLETED]
[npt]          Decoded value [5]
[ncrvset]      Decoded value [2]
[hz_sf]        Decoded value [-2]
[tms_sf]       Decoded value [-3]
====================================================================================================

========================================== DEVICE DETAILS ==========================================
[id]           [710]
[name]         [DERTripHF]
[label]        [DER Trip HF]
[description]  [DER high frequency trip model.]
------------------------------------------- MEASUREMENTS -------------------------------------------
[id]           Decoded value [710]
[l]            Decoded value [135]
[ena]          Decoded value [ENABLED]
[adptcrvreq]   Decoded value [0]
[adptcrvrslt]  Decoded value [COMPLETED]
[npt]          Decoded value [5]
[ncrvset]      Decoded value [2]
[hz_sf]        Decoded value [-2]
[tms_sf]       Decoded value [-3]
====================================================================================================

========================================== DEVICE DETAILS ==========================================
[id]           [711]
[name]         [DERFreqDroop]
[label]        [DER Frequency Droop]
[description]  [DER Frequency Droop model.]
------------------------------------------- MEASUREMENTS -------------------------------------------
[id]           Decoded value [711]
[l]            Decoded value [32]
[ena]          Decoded value [DISABLED]
[adptctlreq]   Decoded value [0]
[adptctlrslt]  Decoded value [COMPLETED]
[nctl]         Decoded value [2]
[rvrttms]      Decoded value [4294967295]
[rvrtrem]      Decoded value [4294967295]
[rvrtctl]      Decoded value [65535]
[db_sf]        Decoded value [-3]
[k_sf]         Decoded value [-3]
[rsptms_sf]    Decoded value [-3]
====================================================================================================

========================================== DEVICE DETAILS ==========================================
[id]           [712]
[name]         [DERWattVar]
[label]        [DER Watt-Var]
[description]  [DER Watt-Var model.]
------------------------------------------- MEASUREMENTS -------------------------------------------
[id]           Decoded value [712]
[l]            Decoded value [44]
[ena]          Decoded value [DISABLED]
[adptcrvreq]   Decoded value [0]
[adptcrvrslt]  Decoded value [COMPLETED]
[npt]          Decoded value [6]
[ncrv]         Decoded value [2]
[rvrttms]      Decoded value [4294967295]
[rvrtrem]      Decoded value [4294967295]
[rvrtcrv]      Decoded value [65535]
[w_sf]         Decoded value [-2]
[deptref_sf]   Decoded value [-2]
====================================================================================================
Looking at the SunSpec info: all these "7xx" blocks are the replacement of the "1xx" and "2xx".
That's why I want to make sure that I can decode them now and not push the topic forward in time.
Impact of that is, that it will take a bit more time to come up with the next version of the plugin and adding stuff like power control.

That's it for now - back to work tomorrow. I will monitor the forum, but will for sure not have a lot of time to respond over the next few days.
hjzwiers
Posts: 320
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 »

I did some more probing on the battery
Scanner13 results:
SunSpec models 701–713 are present. Model 713 is readable and contains valid SoC: raw 2778 with Pct_SF −2 = 27.78%. WHRtg, WHAvail, SoH and Sta are 0xFFFF, i.e. not implemented.

Proprietary E100 battery is fully readable: 23 kWh, 5 kW charge/discharge, SOH 96%, SOE 27.78%, status 3 (discharging).

E172 current = −0.1768 A and E174 power = +144 W at 820.5 V. V×I = −145.1 W, so magnitude agrees very closely; apparent issue is sign convention, not invalid data.

E200 responds as a battery identity but has Modbus address 255, empty firmware/serial and all numerical fields not-implemented/zero, so it appears to be an unused battery slot rather than Battery 2.

E18A/E192 both return zero. Registers beyond E19A/E29A don't return normal Modbus exception frames; the inverter simply gives no response.

Code: Select all

hjz@debian:/opt/stacks/domoticz/config/plugins$ sudo docker exec -it domoticz python3 /opt/domoticz/userdata/plugins/scanner13.py 192.168.2.186 1502
==============================================================================
SolarEdge Developer Diagnostic Scanner 13
==============================================================================
Host: 192.168.2.186  Port: 1502  Device ID: 1
Mode: READ ONLY — no inverter/battery settings are changed

==============================================================================
1. SUNSPEC MODEL INVENTORY
==============================================================================
40000 raw: [21365, 28243]
SunSpec identifier: 'SunS'

Model       Start       Length
----------------------------------------
    1       40002       65
  103       40069       50
    1       40121       65
  203       40188       105
  701       40295       153
  702       40450       50
  703       40502       17
  704       40521       65
  705       40588       57
  706       40647       47
  707       40696       105
  708       40803       105
  709       40910       135
  710       41047       135
  711       41184       32
  712       41218       44
  713       41264       7
65535       41273       0

==============================================================================
2. SUNSPEC MODEL 713 — DER STORAGE CAPACITY
==============================================================================
Start=41264 (0xA130) Length=7
Raw model words:
  word[00] =   713 0x02C9
  word[01] =     7 0x0007
  word[02] = 65535 0xFFFF
  word[03] = 65535 0xFFFF
  word[04] =  2778 0x0ADA
  word[05] = 65535 0xFFFF
  word[06] = 65535 0xFFFF
  word[07] = 65534 0xFFFE
  word[08] = 65534 0xFFFE

SunSpec 713 fields:
  WHRtg   = 65535 (raw)
  WHAvail = 65535 (raw)
  SoC     = 2778 (raw)
  SoH     = 65535 (raw)
  Sta     = 65535 (raw)
  WH_SF   = -2
  Pct_SF  = -2
  Decoded SoC = 27.78 %
  Decoded WHRtg = NOT IMPLEMENTED
  Decoded WHAvail = NOT IMPLEMENTED
  Decoded SoH = NOT IMPLEMENTED
  Storage status = NOT IMPLEMENTED

==============================================================================
3. PROPRIETARY BATTERY DETECTION
==============================================================================
Base 0xE100:
  Manufacturer : SolarEdge
  Model        : Home Battery 48V - 5 modules
  Firmware     : 48V DCDC 3.5.13
  Serial       : 7B0526DA
  Device addr  : 112
  SunSpec DID  : 0
Base 0xE200:
  Manufacturer : SolarEdge
  Model        : Home Battery 48V - 5 modules
  Firmware     :
  Serial       :
  Device addr  : 255
  SunSpec DID  : 0
  0xE300 device address            58176  MODBUS EXCEPTION code=None (UNKNOWN) response=Modbus Error: [Input/Output] Modbus Error: [Invalid Message] No response received, expected at least 8 bytes (0 received)
  0xE300 DID                       58177  MODBUS EXCEPTION code=None (UNKNOWN) response=Modbus Error: [Input/Output] No Response received from the remote slave/Unable to decode response
Base 0xE300: no valid identity

==============================================================================
4. PROPRIETARY BATTERY DATA 0xE100
==============================================================================
  0xE142 Rated energy                   plugin-wordorder=23000 Wh | big-word=-4.66665984e-10 | raw=[45056, 18099]
  0xE144 Max charge continuous          plugin-wordorder=5000 W | big-word=2.00424862 | raw=[16384, 17820]
  0xE146 Max discharge continuous       plugin-wordorder=5000 W | big-word=2.00424862 | raw=[16384, 17820]
  0xE148 Max charge peak                plugin-wordorder=5000 W | big-word=2.00424862 | raw=[16384, 17820]
  0xE14A Max discharge peak             plugin-wordorder=5000 W | big-word=2.00424862 | raw=[16384, 17820]
  0xE16C Average temperature            plugin-wordorder=23 C | big-word=2.35754454e-41 | raw=[0, 16824]
  0xE16E Maximum temperature            plugin-wordorder=0 C | big-word=0 | raw=[0, 0]
  0xE170 Instantaneous voltage          plugin-wordorder=820.504089 V | big-word=1.65397413e-19 | raw=[8259, 17485]
  0xE172 Instantaneous current          plugin-wordorder=-0.176807866 A | big-word=4.92246112e-31 | raw=[3359, 48693]
  0xE174 Instantaneous power            plugin-wordorder=144 W | big-word=2.4057492e-41 | raw=[0, 17168]
  0xE176 Total exported energy          plugin-wordorder=21324 Wh | big-word=6002172403378028544 | raw=[21324, 0, 0, 0]
  0xE17A Total imported energy          plugin-wordorder=14219 Wh | big-word=4002292693848817664 | raw=[14219, 0, 0, 0]
  0xE17E Maximum energy                 plugin-wordorder=23000 Wh | big-word=-4.66665984e-10 | raw=[45056, 18099]
  0xE180 Available energy               plugin-wordorder=22118.4004 Wh | big-word=-107623776 | raw=[52429, 18092]
  0xE182 State of health                plugin-wordorder=96 % | big-word=2.39453882e-41 | raw=[0, 17088]
  0xE184 State of energy                plugin-wordorder=27.7777767 % | big-word=0.000108364722 | raw=[14563, 16862]
  0xE186 Status                         plugin-wordorder=3 (DISCHARGING) | big-word=196608 | raw=[3, 0]
  0xE188 Internal status                plugin-wordorder=3 (DISCHARGING) | big-word=196608 | raw=[3, 0]
  0xE18A Event log                      0 | raw=[0, 0]
  0xE192 Internal event log             0 | raw=[0, 0]

Electrical consistency check:
  V = 820.504089 V
  I = -0.176807866 A
  P reported = 144 W
  V × I      = -145.071577 W
  Difference = 289.071577 W
  Relative error = 199.261%

==============================================================================
4. PROPRIETARY BATTERY DATA 0xE200
==============================================================================
  0xE142 Rated energy                   plugin-wordorder=-3.40282347e+38 Wh | big-word=NaN | raw=[65535, 65407]
  0xE144 Max charge continuous          plugin-wordorder=-3.40282347e+38 W | big-word=NaN | raw=[65535, 65407]
  0xE146 Max discharge continuous       plugin-wordorder=-3.40282347e+38 W | big-word=NaN | raw=[65535, 65407]
  0xE148 Max charge peak                plugin-wordorder=-3.40282347e+38 W | big-word=NaN | raw=[65535, 65407]
  0xE14A Max discharge peak             plugin-wordorder=-3.40282347e+38 W | big-word=NaN | raw=[65535, 65407]
  0xE16C Average temperature            plugin-wordorder=-3.40282347e+38 C | big-word=NaN | raw=[65535, 65407]
  0xE16E Maximum temperature            plugin-wordorder=0 C | big-word=0 | raw=[0, 0]
  0xE170 Instantaneous voltage          plugin-wordorder=-3.40282347e+38 V | big-word=NaN | raw=[65535, 65407]
  0xE172 Instantaneous current          plugin-wordorder=-3.40282347e+38 A | big-word=NaN | raw=[65535, 65407]
  0xE174 Instantaneous power            plugin-wordorder=0 W | big-word=0 | raw=[0, 0]
  0xE176 Total exported energy          plugin-wordorder=0 Wh | big-word=0 | raw=[0, 0, 0, 0]
  0xE17A Total imported energy          plugin-wordorder=0 Wh | big-word=0 | raw=[0, 0, 0, 0]
  0xE17E Maximum energy                 plugin-wordorder=-3.40282347e+38 Wh | big-word=NaN | raw=[65535, 65407]
  0xE180 Available energy               plugin-wordorder=-3.40282347e+38 Wh | big-word=NaN | raw=[65535, 65407]
  0xE182 State of health                plugin-wordorder=-3.40282347e+38 % | big-word=NaN | raw=[65535, 65407]
  0xE184 State of energy                plugin-wordorder=-3.40282347e+38 % | big-word=NaN | raw=[65535, 65407]
  0xE186 Status                         plugin-wordorder=7 (TESTING) | big-word=458752 | raw=[7, 0]
  0xE188 Internal status                plugin-wordorder=0 (UNKNOWN) | big-word=0 | raw=[0, 0]
  0xE18A Event log                      0 | raw=[0, 0]
  0xE192 Internal event log             0 | raw=[0, 0]

Electrical consistency check:
  V = -3.40282347e+38 V
  I = -3.40282347e+38 A
  P reported = 0 W
  V × I      = 1.15792075e+77 W
  Difference = -1.15792075e+77 W
  Relative error = 100.000%

==============================================================================
5. EXCEPTION-CODE PROBES
==============================================================================
These probes deliberately read addresses that scanner12 could not read.
No writes are performed. The goal is to capture the actual Modbus exception.
  probe 0xE19B                     57755  MODBUS EXCEPTION code=None (UNKNOWN) response=Modbus Error: [Input/Output] Modbus Error: [Invalid Message] No response received, expected at least 8 bytes (0 received)
  probe 0xE1A0                     57760  MODBUS EXCEPTION code=None (UNKNOWN) response=Modbus Error: [Input/Output] No Response received from the remote slave/Unable to decode response
  probe 0xE29B                     58011  MODBUS EXCEPTION code=None (UNKNOWN) response=Modbus Error: [Input/Output] No Response received from the remote slave/Unable to decode response
  probe 0xE2A0                     58016  MODBUS EXCEPTION code=None (UNKNOWN) response=Modbus Error: [Input/Output] No Response received from the remote slave/Unable to decode response

==============================================================================
6. DEVELOPER SUMMARY
==============================================================================
SunSpec models: 1, 103, 1, 203, 701, 702, 703, 704, 705, 706, 707, 708, 709, 710, 711, 712, 713
Proprietary identities: 2
  0xE100: SolarEdge / Home Battery 48V - 5 modules / DID=0 / Modbus=112
  0xE200: SolarEdge / Home Battery 48V - 5 modules / DID=0 / Modbus=255

Model 713 is decoded according to the published SunSpec DER Storage Capacity definition.
Battery float decoding shown as the installed plugin's little-word interpretation plus raw words.
Exception probes report actual Modbus exception codes when the inverter supplies them.

READ ONLY. No Modbus write operation exists in this program.
the code

Code: Select all

#!/usr/bin/env python3
"""
SolarEdge Developer Diagnostic Scanner 13
READ-ONLY diagnostic scanner.

Goals:
  - Decode SunSpec model 713 using the published DER Storage Capacity model.
  - Verify the installed plugin's proprietary-battery word-order decoding.
  - Read the exact event-log registers used by the installed plugin.
  - Capture Modbus exception codes instead of reducing failures to READ ERROR.
  - Compare battery voltage/current/power for internal consistency.

Usage:
  python3 scanner13.py <host> [port] [device_id]

No Modbus writes are performed.
"""

import sys
import time
import math
import struct

try:
    from pymodbus.client import ModbusTcpClient
except ImportError:
    from pymodbus.client.sync import ModbusTcpClient

DEFAULT_HOST = "192.168.2.186"
DEFAULT_PORT = 1502
DEFAULT_DEVICE = 1
SUNSPEC_BASE = 40000
BATTERY_BASES = [0xE100, 0xE200, 0xE300]

# Exact proprietary battery registers from the installed plugin.
BATTERY_FIELDS = [
    (0xE142, 2, "Rated energy", "SEFLOAT", "Wh"),
    (0xE144, 2, "Max charge continuous", "SEFLOAT", "W"),
    (0xE146, 2, "Max discharge continuous", "SEFLOAT", "W"),
    (0xE148, 2, "Max charge peak", "SEFLOAT", "W"),
    (0xE14A, 2, "Max discharge peak", "SEFLOAT", "W"),
    (0xE16C, 2, "Average temperature", "SEFLOAT", "C"),
    (0xE16E, 2, "Maximum temperature", "SEFLOAT", "C"),
    (0xE170, 2, "Instantaneous voltage", "SEFLOAT", "V"),
    (0xE172, 2, "Instantaneous current", "SEFLOAT", "A"),
    (0xE174, 2, "Instantaneous power", "SEFLOAT", "W"),
    (0xE176, 4, "Total exported energy", "UINT64", "Wh"),
    (0xE17A, 4, "Total imported energy", "UINT64", "Wh"),
    (0xE17E, 2, "Maximum energy", "SEFLOAT", "Wh"),
    (0xE180, 2, "Available energy", "SEFLOAT", "Wh"),
    (0xE182, 2, "State of health", "SEFLOAT", "%"),
    (0xE184, 2, "State of energy", "SEFLOAT", "%"),
    (0xE186, 2, "Status", "UINT32", ""),
    (0xE188, 2, "Internal status", "UINT32", ""),
    (0xE18A, 2, "Event log", "UINT16", ""),
    (0xE192, 2, "Internal event log", "UINT16", ""),
]

BATTERY_STATUS = {
    1: "OFF",
    2: "EMPTY",
    3: "DISCHARGING",
    4: "CHARGING",
    5: "FULL",
    6: "HOLDING",
    7: "TESTING",
}


def pack_words(words):
    return b"".join(struct.pack(">H", x & 0xFFFF) for x in words)


def text(words):
    return pack_words(words).decode("ascii", errors="replace").rstrip("\x00 ").strip()


def sef_le_words(words):
    if len(words) != 2:
        return None
    return struct.unpack(">f", pack_words(list(reversed(words))))[0]


def sef_be_words(words):
    if len(words) != 2:
        return None
    return struct.unpack(">f", pack_words(words))[0]


def u16(words):
    return words[0] if words else None


def u32_le_words(words):
    if len(words) != 2:
        return None
    return (words[1] << 16) | words[0]


def u32_be_words(words):
    if len(words) != 2:
        return None
    return (words[0] << 16) | words[1]


def u64_le_words(words):
    if len(words) != 4:
        return None
    return sum((x & 0xFFFF) << (16 * i) for i, x in enumerate(words))


def u64_be_words(words):
    value = 0
    for x in words:
        value = (value << 16) | (x & 0xFFFF)
    return value


def fmt_value(value):
    if isinstance(value, float):
        if math.isnan(value):
            return "NaN"
        if math.isinf(value):
            return "Inf" if value > 0 else "-Inf"
        return f"{value:.9g}"
    return str(value)


def exception_info(response):
    code = getattr(response, "exception_code", None)
    if code is None:
        code = getattr(response, "exceptionCode", None)
    name = {
        1: "ILLEGAL FUNCTION",
        2: "ILLEGAL DATA ADDRESS",
        3: "ILLEGAL DATA VALUE",
        4: "SLAVE DEVICE FAILURE",
        5: "ACKNOWLEDGE",
        6: "SLAVE DEVICE BUSY",
        8: "MEMORY PARITY ERROR",
        10: "GATEWAY PATH UNAVAILABLE",
        11: "GATEWAY TARGET DEVICE FAILED TO RESPOND",
    }.get(code, "UNKNOWN")
    return code, name


def read_regs(client, address, count, device, label, retries=2):
    """Read and report the real Modbus response, including exception code."""
    for attempt in range(1, retries + 1):
        try:
            try:
                response = client.read_holding_registers(
                    address=address, count=count, slave=device
                )
            except TypeError:
                response = client.read_holding_registers(
                    address=address, count=count, unit=device
                )

            if response is None:
                print(f"  {label:<32} {address:5d}  NO RESPONSE (attempt {attempt})")
            elif response.isError():
                code, name = exception_info(response)
                print(
                    f"  {label:<32} {address:5d}  MODBUS EXCEPTION "
                    f"code={code} ({name}) response={response}"
                )
            elif not hasattr(response, "registers"):
                print(f"  {label:<32} {address:5d}  INVALID RESPONSE {response}")
            elif len(response.registers) != count:
                print(
                    f"  {label:<32} {address:5d}  WRONG LENGTH "
                    f"expected={count} got={len(response.registers)}"
                )
            else:
                return list(response.registers)
        except Exception as exc:
            print(
                f"  {label:<32} {address:5d}  EXCEPTION "
                f"{type(exc).__name__}: {exc}"
            )

        if attempt < retries:
            try:
                client.close()
            except Exception:
                pass
            time.sleep(0.15)
            try:
                client.connect()
            except Exception:
                pass
    return None


def header(title):
    print("\n" + "=" * 78)
    print(title)
    print("=" * 78)


def sunspec_models(client, device):
    header("1. SUNSPEC MODEL INVENTORY")
    ident = read_regs(client, SUNSPEC_BASE, 2, device, "SunSpec identifier", retries=1)
    if ident is None:
        return []
    print("40000 raw:", ident)
    print("SunSpec identifier:", repr(text(ident)))
    if ident != [0x5375, 0x6E53]:
        print("SunSpec identifier not found")
        return []

    models = []
    address = SUNSPEC_BASE + 2
    print("\nModel       Start       Length")
    print("-" * 40)

    for _ in range(100):
        h = read_regs(client, address, 2, device, f"model header {address}", retries=1)
        if h is None:
            break
        did, length = h
        print(f"{did:5d}       {address:<11d} {length:<11d}")
        if did == 0xFFFF:
            break
        models.append((did, address, length))
        address += 2 + length

    return models


def decode_713(client, device, models):
    header("2. SUNSPEC MODEL 713 — DER STORAGE CAPACITY")
    block = next((x for x in models if x[0] == 713), None)
    if block is None:
        print("Model 713 was not found.")
        return

    _, start, length = block
    raw_payload = read_regs(client, start + 2, length, device, "Model 713 payload", retries=1)
    if raw_payload is None:
        return

    words = [713, length] + raw_payload
    print(f"Start={start} (0x{start:04X}) Length={length}")
    print("Raw model words:")
    for i, value in enumerate(words):
        print(f"  word[{i:02d}] = {value:5d} 0x{value:04X}")

    # Published SunSpec DER Storage Capacity model 713:
    # ID, L, WHRtg, WHAvail, SoC, SoH, Sta, WH_SF, Pct_SF.
    wh_rtg, wh_avail, soc, soh, sta, wh_sf, pct_sf = raw_payload[:7]
    print("\nSunSpec 713 fields:")
    print(f"  WHRtg   = {wh_rtg} (raw)")
    print(f"  WHAvail = {wh_avail} (raw)")
    print(f"  SoC     = {soc} (raw)")
    print(f"  SoH     = {soh} (raw)")
    print(f"  Sta     = {sta} (raw)")
    print(f"  WH_SF   = {wh_sf if wh_sf < 32768 else wh_sf - 65536}")
    print(f"  Pct_SF  = {pct_sf if pct_sf < 32768 else pct_sf - 65536}")

    # SunSpec not-implemented markers for uint16 are 0xFFFF and for enum16
    # commonly 0xFFFF. Scale factors are signed int16.
    if soc != 0xFFFF:
        sf = pct_sf if pct_sf < 32768 else pct_sf - 65536
        print(f"  Decoded SoC = {soc * (10 ** sf):.6g} %")
    else:
        print("  Decoded SoC = NOT IMPLEMENTED")

    if wh_rtg != 0xFFFF:
        sf = wh_sf if wh_sf < 32768 else wh_sf - 65536
        print(f"  Decoded WHRtg = {wh_rtg * (10 ** sf):.6g} Wh")
    else:
        print("  Decoded WHRtg = NOT IMPLEMENTED")

    if wh_avail != 0xFFFF:
        sf = wh_sf if wh_sf < 32768 else wh_sf - 65536
        print(f"  Decoded WHAvail = {wh_avail * (10 ** sf):.6g} Wh")
    else:
        print("  Decoded WHAvail = NOT IMPLEMENTED")

    if soh != 0xFFFF:
        sf = pct_sf if pct_sf < 32768 else pct_sf - 65536
        print(f"  Decoded SoH = {soh * (10 ** sf):.6g} %")
    else:
        print("  Decoded SoH = NOT IMPLEMENTED")

    if sta != 0xFFFF:
        print(f"  Storage status raw = {sta}")
    else:
        print("  Storage status = NOT IMPLEMENTED")


def battery_identity(client, base, device):
    manufacturer = read_regs(client, base, 16, device, f"0x{base:04X} manufacturer", retries=1)
    address = read_regs(client, base + 0x40, 1, device, f"0x{base:04X} device address", retries=1)
    did = read_regs(client, base + 0x41, 1, device, f"0x{base:04X} DID", retries=1)
    if manufacturer is None or address is None or did is None:
        return None
    m = text(manufacturer)
    if not m:
        return None
    model = read_regs(client, base + 0x10, 16, device, f"0x{base:04X} model", retries=1) or []
    firmware = read_regs(client, base + 0x20, 16, device, f"0x{base:04X} firmware", retries=1) or []
    serial = read_regs(client, base + 0x30, 16, device, f"0x{base:04X} serial", retries=1) or []
    return {
        "manufacturer": m,
        "model": text(model),
        "firmware": text(firmware),
        "serial": text(serial),
        "address": address[0],
        "did": did[0],
    }


def proprietary_battery_bases(client, device):
    header("3. PROPRIETARY BATTERY DETECTION")
    found = []
    for base in BATTERY_BASES:
        info = battery_identity(client, base, device)
        if info is None:
            print(f"Base 0x{base:04X}: no valid identity")
            continue
        found.append((base, info))
        print(f"Base 0x{base:04X}:")
        print(f"  Manufacturer : {info['manufacturer']}")
        print(f"  Model        : {info['model']}")
        print(f"  Firmware     : {info['firmware']}")
        print(f"  Serial       : {info['serial']}")
        print(f"  Device addr  : {info['address']}")
        print(f"  SunSpec DID  : {info['did']}")
    return found


def show_battery(client, base, device):
    header(f"4. PROPRIETARY BATTERY DATA 0x{base:04X}")
    values = {}
    for address, count, label, dtype, unit in BATTERY_FIELDS:
        regs = read_regs(client, base + (address - 0xE100), count, device, label, retries=1)
        if regs is None:
            continue

        if dtype == "SEFLOAT":
            plugin_value = sef_le_words(regs)
            alternate = sef_be_words(regs)
            print(
                f"  0x{address:04X} {label:<30} "
                f"plugin-wordorder={fmt_value(plugin_value)} {unit} | "
                f"big-word={fmt_value(alternate)} | raw={regs}"
            )
            values[label] = plugin_value
        elif dtype == "UINT64":
            plugin_value = u64_le_words(regs)
            alternate = u64_be_words(regs)
            print(
                f"  0x{address:04X} {label:<30} "
                f"plugin-wordorder={plugin_value} {unit} | "
                f"big-word={alternate} | raw={regs}"
            )
            values[label] = plugin_value
        elif dtype == "UINT32":
            plugin_value = u32_le_words(regs)
            alternate = u32_be_words(regs)
            status_name = BATTERY_STATUS.get(plugin_value, "UNKNOWN")
            print(
                f"  0x{address:04X} {label:<30} "
                f"plugin-wordorder={plugin_value} ({status_name}) | "
                f"big-word={alternate} | raw={regs}"
            )
            values[label] = plugin_value
        else:
            value = u16(regs)
            print(f"  0x{address:04X} {label:<30} {value} | raw={regs}")
            values[label] = value

    # Cross-check the three instantaneous electrical values.
    v = values.get("Instantaneous voltage")
    i = values.get("Instantaneous current")
    p = values.get("Instantaneous power")
    if all(isinstance(x, (int, float)) and math.isfinite(x) for x in (v, i, p)):
        expected = v * i
        print("\nElectrical consistency check:")
        print(f"  V = {v:.9g} V")
        print(f"  I = {i:.9g} A")
        print(f"  P reported = {p:.9g} W")
        print(f"  V × I      = {expected:.9g} W")
        print(f"  Difference = {p - expected:.9g} W")
        if abs(expected) > 1:
            print(f"  Relative error = {abs(p - expected) / abs(expected) * 100:.3f}%")
        else:
            print("  Relative error not meaningful because V×I is near zero.")


def exception_probe(client, device):
    header("5. EXCEPTION-CODE PROBES")
    print("These probes deliberately read addresses that scanner12 could not read.")
    print("No writes are performed. The goal is to capture the actual Modbus exception.")

    # These are the first failing addresses observed in scanner12 for Battery 1
    # and the apparent second slot. Keep the probe set small.
    for address in (0xE19B, 0xE1A0, 0xE29B, 0xE2A0):
        read_regs(client, address, 1, device, f"probe 0x{address:04X}", retries=1)


def main():
    host = sys.argv[1] if len(sys.argv) > 1 else DEFAULT_HOST
    port = int(sys.argv[2]) if len(sys.argv) > 2 else DEFAULT_PORT
    device = int(sys.argv[3]) if len(sys.argv) > 3 else DEFAULT_DEVICE

    print("=" * 78)
    print("SolarEdge Developer Diagnostic Scanner 13")
    print("=" * 78)
    print(f"Host: {host}  Port: {port}  Device ID: {device}")
    print("Mode: READ ONLY — no inverter/battery settings are changed")

    client = ModbusTcpClient(host=host, port=port, timeout=3)
    if not client.connect():
        print("ERROR: Could not connect.")
        return 1

    try:
        models = sunspec_models(client, device)
        decode_713(client, device, models)

        # Reconnect before proprietary area, keeping the two interfaces isolated.
        client.close()
        time.sleep(0.3)
        client = ModbusTcpClient(host=host, port=port, timeout=3)
        if not client.connect():
            print("ERROR: Could not reconnect for battery scan.")
            return 1

        batteries = proprietary_battery_bases(client, device)
        for base, info in batteries:
            show_battery(client, base, device)

        exception_probe(client, device)

        header("6. DEVELOPER SUMMARY")
        print("SunSpec models:", ", ".join(str(x[0]) for x in models) if models else "none")
        print("Proprietary identities:", len(batteries))
        for base, info in batteries:
            print(
                f"  0x{base:04X}: {info['manufacturer']} / {info['model']} / "
                f"DID={info['did']} / Modbus={info['address']}"
            )
        print("\nModel 713 is decoded according to the published SunSpec DER Storage Capacity definition.")
        print("Battery float decoding shown as the installed plugin's little-word interpretation plus raw words.")
        print("Exception probes report actual Modbus exception codes when the inverter supplies them.")
        print("\nREAD ONLY. No Modbus write operation exists in this program.")
    finally:
        try:
            client.close()
        except Exception:
            pass

    return 0


if __name__ == "__main__":
    sys.exit(main())
Post Reply