Solaredge (via Sunspec) Modbus Binding is missing battery values

Hi all,
I have a Solaredge SE10k inverter with a BYD battery installed which I want to monitor with OpenHAB. The inverter and the meter are beeing found via the Modbus/Sunspec discovery just fine (had to tweak the “time between transactions” a bit to make the solaredge happy, but nothing serious).
However, the values for the BYD battery are not discovered. I know that they are there, because if i run the “Solaranzeige” (Docker) project against my solaredge endpoint the battery values show up.
What would be a sane way of getting the battery data in openhab:

  • run a modbus poller alongside the sunspec discovery?
  • make a feature request for the modbus-binding to include it in the discovery process?

Of course i could run the above project and export the data via mqtt into openhab, but that doesn’t feel quite right…
Unfortunately I lack php skills to fully understand how the “solaranzeige” project gets the data, I can’t even figure out what modbus- ids they are using…
any hints are appreciated.

Update: I’ve read the sunspec documenation from solaredge, apparently the battery values are not part of the sunspec standard. I will try to reverse- engineer the Modbus IDs and implement it “by hand” via a poller. Will post here when I succeed.

If anyone is interested: here are the registers:

57709-57710 Battery1 Temp (hex2float)
57712-57713 Battery1 Voltage (hex2float)
57714-57715 Battery1 Current (hex2float)
57716-57717 Battery1 Power (hex2float)
57730-57731 Battery1 SOH (hex2float)
57732-57733 Battery1 SOC (hex2float)

I’m getting a 2-battery system. Any clue as to the battery2 equivalents for these?

Sorry, don’t know the Battery2 values. I reverse- engineered the above from this project: GitHub - DeBaschdi/docker.solaranzeige
That’s the dockerized setup of a german project (Solaranzeige / PV-Monitor - Solaranzeige). It is kind of open source and community driven, but a) the code quality is suprime and b) the project owner has some strange views, like he doesn’t want code to be publicly viewable in a repository (wtf?).
The values should all be in www/html/solaredge_serie.php, you have to find your way from the offset Modbus readings for Battery2, don’t rely on the values in the comments, they are copy/pasted and inaccurate. It’s messy, but the info should be there (whereever it comes from).

Just had a look in the files (don’t remember so good, because thankfully my wife did most of the reverse- engineering): the Battery2 values should start at 0xe200 / 57856, grep for Battery2 in the php and work your way up for the values.
Running the docker against the solaredge and “watching” it with wireshark also works well - wireshark has a ModBus TCP decoder builtin. Good luck.

Thanks for the info! I did finally find (inside GitHub - nmakel/solaredge_modbus: SolarEdge Modbus data collection library) that the offset to battery2 is +0x100 from battery1. So that agrees!

There’s some (thin) evidence that only 2 batteries are accessible this way. (eg: that battery3 would not be @ b1 + 0x200). Since the HD Wave inverters support up to 3 batteries that would be curious. It won’t impact me since I’m only getting 2 but still curious.

I also found it odd that the battery data are little-endian. Everything else is big. Makes me think the inverter is just dumping battery-composed data into its address space and the battery designers went LE. Makes it all more phun I guess!

I have a SE10k, pretty sure that thing can only run 2 batteries. But the python lib is a nice find! Thanks

@n8wish IS he communication between the battery and the BYD battery also on RS485?
Is the BYD initiating the update or is the Solaredge initiating the update of the values.

I would like to see my battery in the solaredge portal, but I have 3rd party one, so was thinking to do so,ething similar as nmakel/solaredge_modbus but than for the battery

I have a network- only connection (TCP/IP on port 1502) to my Solaredge, and i can’t really mess with it (installation under warranty). The BYD data is also provided by the Solaredge and I don’t know how to talk to the battery separately.

Sure :wink: I can imagine.
Maybe non-destructive check :sunglasses:: Is there beside the electrical + & - wires (power) also RS485 wire between the BYD and the solarEdge, or do they talk to each other over the network?

The BYD Battery has a network uplink, and it shows open ports 80 and 8080 on the network. I’m like 99% sure that they talk to each other via TCP, but probably not Modbus.

1 Like

Sunspec is not about batteries.
Search for the “Power Control Open Protocol for SolarEdge Inverters” document, it has all the information you’ll need.

Just sliding into this thread as I am trying to get battery info from modbus to maybe control the battery charging via openhab.
Now I found the pdf you are probably referring to, but I cannot get any values from the registers mentioned in the pdf. I however can get values from the sunspec registers. Now my first idea was that this maybe is an issue of device id and the battery has a separate id? But I tried some and cannot get any to properly connect.

Did someone get this working?
Thanks for any advice!