drobtravels / solaredge-local

Information about local API for SolarEdge Inverters
58 stars 12 forks source link

Having issues pulling optimizer data #23

Open smilernet opened 4 years ago

smilernet commented 4 years ago

Hi,

Using the following cmd to test the protocol buffers:

curl -s http://inverter_ip/web/v1/maintenance | ./protoc -I=/opt/solaredge-local/message_types --decode Maintenance /opt/solaredge-local/message_types/maintenance.proto

Here's an excerpt of what I get for the optimizer data; as you can see the invSn & serialNumber has additional characters - \n\013

diagnostics { inverters { primary { invSn: "\n\013<inverter_serial>" optimizerList { serialNumber: "\n\013<optimizer_serial>" lastReport { 1 { 1: 2020

Any ideas what the issue might be with the additional characters?

sneerix commented 4 years ago

I have the same for SE4K. I happened about a week ago, after inverter firmware was upgraded (automatically?).

image

Before that, it was working correctly. I'll be happy to submit additional data or perform some tests if it helps to solve this issue.

sneerix commented 4 years ago

I've checked my maintenance file (got from http://inverter.ip/web/v1/maintenance) against https://protogen.marcgravell.com/decode and it seams to be decoded correctly. Also, when I parse maintenance file trough protoc --decode_raw it seams to be ok. But my knowledge to fix this is too small today. I've attached parsed maintenance files. maintenance_parsed.log maintenance_raw.log

sneerix commented 4 years ago

@drobtravels, will you be able to help us?

drobtravels commented 4 years ago

I'm not noticing this issue on mine (CPU 4.5.41). They must have made some changes in later versions.

Very strange that it only shows in the parsed versions. Serial Number is just a string, so its odd that it would have changed. You can try reviewing the potential types, updating the .proto file and see if there is a different type that solves that issue

sneerix commented 4 years ago

It seems, that after last firmware upgrade I've lost access to inverter web page. It is still sending data to solaredge cloud, modbus tcp is still accessible so network connections works ok. So, for at least now, I'm unable to use you solution anymore :-(

ghost commented 4 years ago

As of today I'm no longer able to read the optimizer data. Seems my inverter also upgraded to 4.8.19. I see the '\n\013' as well, as smilernet reported. However, only in the parsed output. E.g. curl -s http://<ip>/web/v1/maintenance | protoc --decode_raw returns (among other lines) 2 { 1 { 1: "10BBC12B-B7" } 2 { 1: 0 } }

But curl -s http://<ip>/web/v1/maintenance | protoc --decode Maintenance message_types/maintenance.proto returns optimizer { serialNumber: "\n\01310BBC12B-B7" 2 { 1: 0 } }

So I suspect they added a field, resulting in a misalignment of the parser?

merijn-weiss commented 4 years ago

Last week my inverter also received an automatic update to 4.8.19. This broke retrieving the maintenance information as reported by others as well. I've started to look into a fix and actually don't think the issue is the serial field.

The issue seems to be that SolarEdge changed the definition of the Protocol Buffer. I'm planning to make a new message type definition, but it is my first experience with Prococol Buffers.

It would help if somebody can share a raw file Maitenance file of an invertor that is not upgraded to 4.8.19 and still works with the solaredge_local implementation.

ghost commented 4 years ago

I've got good results after changing in the maintenance.proto file type 'string' to 'my_string', where my_string is defined as message my_string { string value = 1; }

and similar for int32 and bool types. Of course, that also requires updating your code, e.g. where you access the property serialNumber, it is now serialNumber.value. And this new format probably won't work with older inverters.

drobtravels, how do we best proceed?

merijn-weiss commented 4 years ago

I took the same approach. In addition I reworked the entire proto file to align to the naming used in the SolarEdge UI. Main question to address is how to make it work for various versions in a clean manner.

scheric commented 4 years ago

My inverter has spontaneously updated to 4.8.19 yesterday at 23:07 UTC+1 according to Home Assistant. I also lost all optimizer data from maintenance but I also lost inverter temperature from status data.

when I am using this code

print (status.inverters)

Results:

primary {
  dspSn: "xxxxxx-xxxx"
  voltage: 385.0412
  optimizersStatus {
    total: 10
    online: 10
  }
  temperature {
    units {
    }
  }
  subSystem: 6144
}

This is how it looked before.

primary {
    dspSn: "xxxxxxx"
    voltage: 371.3249206542969
    optimizersStatus {
      total: 10
      online: 10
    }
    temperature {
      value: 38
      units {
        celsius: true
      }
    }
    subSystem: 6144
}
stefxx commented 4 years ago

Hi guys, great work! Anyone willing to share their updated .proto files? Thanks!

merijn-weiss commented 4 years ago

Hello stefxx, just created a fork where I pushed the update maintenance file. Please note that I also aligned the naming of the fields to the names used by SolarEdge in their UI implementation. So these are breaking changes. I've not done the other files yet, but I'm planning to do so in the days to come.

drobtravels commented 4 years ago

Feel free to open a PR with a different file name (to avoid breaking existing versions)

On Fri, Mar 13, 2020, 9:05 AM merijn-weiss notifications@github.com wrote:

Hello stefxx, just created a fork where I pushed the update maintenance file. Please note that I also aligned the naming of the fields to the names used by SolarEdge in their UI implementation. So these are breaking changes. I've not done the other files yet, but I'm planning to do so in the days to come.

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/drobtravels/solaredge-local/issues/23#issuecomment-598709778, or unsubscribe https://github.com/notifications/unsubscribe-auth/ABF3ATQSUD7BXQT6BH2POITRHIVSJANCNFSM4KQOEKOA .

stefxx commented 4 years ago

@merijn-weiss, thanks! That was quick :)

stefxx commented 4 years ago

BTW, the temperature field in status.proto seems to have the same issue...

merijn-weiss commented 4 years ago

@stefxx , I'm aware. I will review all proto files and see how to create the update such that @drobtravels is able to accept a pull request without breaking the implementation for inverters with other firmware versions.