New Solarman V5 Binding for Deye, Sofar and other type of solar inverters

Hi there,

Three weeks ago, I purchased a Deye inverter and wanted to integrate it with my OpenHAB installation. After some online searching, I came across kbialek’s deye-inverter-mqtt project, which I installed and confirmed was working. However, since I preferred an OpenHAB native implementation, I decided to create my own. While I was in the middle of developing it, I stumbled upon ptrbojko’s openhab-lsw4inverter-binding. Despite this, my sunk cost bias compelled me to complete my own implementation of the Solarman V5 protocol for OpenHAB, which was heavily inspired by Stephan Joubert’s home_assistant_solarman project and utilized the mapping files from there.

Although I have only tested it with my SUN-12K-SG04LP3-EU inverter, it should work with many other inverters that use the Solarman Stick Logger, such as Deye, Sofar, Solis, ZCS Azzurro, and KStar.

You can find my implementation at GitHub - catalinsanda/org.openhab.binding.solarman: Binding used to communicate with Solarman (IGEN-Tech) v5 based solar inverter data loggers.

The initial release is available at Release Initial release for the OpenHAB Solarman Logger Binding · catalinsanda/org.openhab.binding.solarman · GitHub. Please note that it runs on top of OpenHAB 4.x, so wait a bit if you’re still on 3.x.

Please feel free to try it out and let me know if you encounter any issues.

Thank you,
Catalin

2 Likes

Hi,

I am the ptrbojko :wink: - maintainer of the mentioned binding.

I you want to merge both binding into one - pm me. Like you - I have created my binding just for my needs, but instead of rewriting HA code, I have tried to leverage java strong points. I use my binding for more than a year now, so it is pretty solid in terms of uptime. However - your approach covers more config variations from start - this is awasome.

I have pushed my binding to the third party marketplace, and setup basic git flow on top of github actions, just for ref.

Regards,
Piotr

Hi Piotr, thanks for reaching out!

After looking a bit of your code, I think you are right, we went with different approaches, mine was more pragmatic, more or less adapt the HA implementation to OpenHAB, yours was more embellished, playing a bit more with builders and state machines.

Not sure how we can merge the two, considering the difference in approaches, but let me tell you my plans, maybe we can align on those.

The current implementation covers my needs, fetches the data from my inverter and makes it available to OpenHAB for some automation scripts and nice graphs, but I would like, when time permits and if people are interested in it to make it a more generic implementation of the Solarman protocol:

  • Separate more the logger connection code from the protocol handling and state management so it can vary depending on the logger type and firmware.
  • In essence, the Solarman V5 protocol is just a wrapper on top of Modbus, so I would like to make that more cleaner in the code and switch from my crappy implementation of Modbus to the one provided by the platform (see: org.openhab.core.io.transport.modbus). Not sure it will work out, but it’s worth a try.
  • I like how the HA folks have separated the request/response values from the protocol implementation and treated those as configuration. Especially because it seems that the Modbus request/responses depend on the inverter and not on the logger. This makes supporting different inverters a lot easier.
  • I plan to extend that by allowing users to enhance the inverter definitions with custom requests and the possibility to define channels by providing their own list of Modbus registries. Very similar to the original Modbus binding.
  • Have support for writing data – although this can be dangerous.
  • If you can have multiple inverters connected to the same logger (e.g, via parallel connection), maybe switch to a bridge where each inverter is its own thing. Not sure if this is possible, or you just have one inverter per logger and it’s always the slave with ID 1.

Let me know your thoughts.

Regards,
Catalin

Hi,

really cool. I have also 4 Inverter from Bosswerk (they are labeled from Deye). When the binding is available in openHAB 3.x, i will also test it.

If I can help something, feel free to contact me.

Best regards,
Reinhard

As for my goals:

  1. Add more inverters and confirm they work. I have draw the modbus codes from the same source as You, but ocnvert them in the process. This leads to:
  2. Make on source of truth for thing channels and modbus codes. Currently I have just put them in a builders and xml descriptor for channels. I already see - that your code get this covered.
  3. Implement “server mockish thing”. Loggers would connect to the openhab to push data as they currently do to solarman cloud. Loggers have an option to add secondary address to connect (first is used for solarman cloud). This would enable less resource eating solution and thing discovery.

As for your list, here are my thoughts:
1 State management and separation - this was more or less my goal and my last changes.
2 Sounds cool, but I would vary that not all folks use modbus bindings (I don’t).
3 You already did that, no?
4 Allowing users to extend… - I don’t get that need in full, but I would consider if anyone would really use it. Most of people just want to check on current production (for rules like me) and grid frequency (like me, my power provider likes to change the freq over 50hz which should be allowed only for heavy service work on a grid).
5. Support for writting data - as far I know, loggers allow only to send request frame with type “3”. This limits the modbus request only to read data.
6. Dunno. I think loggers require that inverter is ID 1.

I have another binging (for setup webhooks in openhab) and some plan to look through matter/thread case and google home things (just because such tech lands in my home recently). So my work on a lsw binding will be smaller in time.

Regards,
Piotr

1 Like

Hi Piotr,

Like your goals, especially the third one, but I haven’t seen any implementation doing this so far. Also, for your second one, you can find all (?) the MODBUS commands for DEYE inverters in the PDF attached here: Solarman modbus integration - #17 by giorginus80.

I’ve got a couple of hours of free time and improved the binding a bit, most importantly to use one TCP connection per inverter pool and add partial support for user defined reads. The thinking behind this is that not all codes are included in the HA definitions. One notable example is the frequency of the grid or the inverter.

So, somebody who is interested in this, like yourself, can add it to the other dynamically defined channels, like this:

Thing solarman:logger:local [ hostname="a.b.c.d", inverterType="deye_sg04lp3", serialNumber="1234567890", additionalRequests="0x03:0x27D-0x27E" ] {
Channels:
Type number : Inverter_Frequency [scale="0.01", uom="Hz", rule="3", registers="0x27E"]
}

I assumed writing is possible by looking at the APIs exposed by this library: pysolarmanv5 documentation - never tried it though.

I plant to invest as much time as I can in this, but considering how things are looking, it will probably not be much. Keep it up to date with OpenHAB releases, fix occasional bugs, and hopefully very slowly implement the features mentioned above.

Reinhard – due to limited time I’ll not bring this to 3.x. Please give it a try once you migrate to 4.0

Regards,
Catalin

Hi,
when i understand right, i can implement a standard Deye SUN600G3-EU-230.

I have try to install the binding, but i dont know with of the two options are right for me.
my Logger serial No is 41xxxxxxxx

regards
Frank

Have you tried the deye_2mppt inverter type?
I don’t have that inverter, so I can’t say if it’s going to work or not, but it’s worth a try.

If you get errors in the logs, send them my way to try and fix them.

Please note that this binding is currently working only with the 4.0.0 M2 version of OpenHAB. and I will be keeping it up to date with future stable versions, but not older ones.

Hello,

I have installed SOFAR HYD 10KTL-3PH-PRO inverter and Wifi Logger SN23xxx.
I have managed to get only Online and Operating state from channels till now.
No Active/reactive power is coming into my openhab items.

My Logger module version is LSW3_15_XXXX_1.68.

Thanks for any hint.

BR.
Marek

What inverter type are you using?
What channels are being created by the binding?
Any errors in the logs?

Please paste your things config file.

Please note that this biding is a bit different that others you might have used, in the sense that the list of channels is dynamic based on the inverter type. So the items/sitemap provided are just an example for the deye_sg04lp3 inverter type. For other inverter types, you’ll need to tweak the items and sitemap.

Sorry for the mess, I have just noticed this Topic is for different binding.
I am using Piotr Bojko’s openhab-lsw4inverter-binding for SOFAR HYD 10KTL-3PH-PRO inverter:

Anyway when I switch to DEBUG mode and suspend/enable the Thing, i got:

Sorry once more.
Marek.

No problem, you can give mine a try, maybe you have better luck.

Thanks, once it will be OH3 ready, I can give it a try.
M.

I have installed Zucchetti ZZT-3000SP-V2 inverter and Wifi Logger SN238xxx.

No Active/reactive power is coming into my openhab items.

My Logger module version is LSW3_15_FFFF_1.0.89R

Thanks for any hint.

Giovanni

Hi Piotr.
I’ve installed a LSW-3 logger (s/n 2366374030 firmware LSW3_15_FFFF_1.0.89R).
I’m testting the binding but not data are received. If you want I can help testing the software

Kind regards

Hi

I am awaiting delivery of a SunSync 8.8kW interter with 2 x batteries and have been hunting for a Binding that would work.

Looks like this one might work - but it appears that the Logger being shipped with my SynSync is not one the the LSW types?

I am hoping that the ModBUS details will still be the same.

Is the serial number used in the binding for Authentication or purely to determine which Inverter profile etc to use?

In other words, could I try the Binding out without the LSW logger with a valid serial number?

Thanks
mark

Hi Mark,

From what I could gather, the Modbus registers are defined by the inverter and are the same, regardless on how you read them (e.g., directly by connecting to the Modbus over RS485 port, through the LSW logger, etc). In the case of the Solarman logger (LSW, LSE, etc), the Modbus is wrapped inside the Solarman V5 protocol, which uses the serial number of the logger for authentication.

So, the answer to your question is no, you can use this binding only with a Solarman logger.

But, if you have access to a Modbus over RS232/485 port you can use the registers from this binding: org.openhab.binding.solarman/src/main/resources/definitions at main · catalinsanda/org.openhab.binding.solarman · GitHub and the OpenHAB Modbus binding to read the values.

Hope this helps,
Catalin

Thank you for the clarification and link to the registers.

So it seems that the new SunSynk logger will not work. Waiting for feedback from SunSynk.

According to SunSynk WiFi Dongle Hacking. - Inverters - Power Forum - Renewable Energy Discussion SunSynk used to provide Solarman loggers with their inverters, but have since moved to their own loggers which are incompatible with Solarman. Take a look at that thread for a few solutions.

1 Like

Thank you. That is very helpful. And seems to match the document I have for the most part.

I did discover that when using the SunSynk Logger you can access logs on their cloud portal, which actually gives the MODBus “registers” too :slight_smile:

And from the document I received:

What I am unclear of is how to determine what “Read Value Type” would be required for each register since this doe snot appear to be documented (and I don’t seem to see this in your definitions either)?