MatterVN / ModbusTCP2MQTT

Sungrow & SMA Solar Inverter addon for Home Assistant using mobusTCP
MIT License
68 stars 50 forks source link

add sungrow sh10rt #9

Closed chainsawbike closed 2 years ago

chainsawbike commented 2 years ago

should also be valid for: SH8.0RT SH6.0RT SH5.0RT.

ptC7H12 commented 2 years ago

What is the source of your Modbus register definitions? This side claims, tha 1612277985677-eingangsregister_stand2021_02_02.txt t they got the map from Sungrow Germany and the map is very different to yours. Supportetd devices: SH5K-20 / SH3K6 / SH4K6 / SH5K-V13 SH5K-30 / SH3K6-30 / SH4K6-30 SH5.0RS / SH3.6RS / SH4.6RS / SH6.0RS SH10RT / SH8.0RT / SH6.0RT / SH5.0RT

Thats the file - but which one is correct? 1612277985677-eingangsregister_stand2021_02_02.txt

chainsawbike commented 2 years ago

I also found that file you need to add 1 to those registers for it to be correct, I found a pdf from sungrow that it is based on I'll upload and link it

There should be only be small differences between that and my map regarding single/three phase and battery handling

I also was thinking that it may be better to use the Id codes available over modbus ( I have these as well ) to properly support all the inverters listed above somewhat more automaticly as the list of inverters you gave only have small differences in a few registers but doing this would involve some significant code changes.

ptC7H12 commented 2 years ago

If you can upload your pdf this would be very nice. I own a sh5.0rt (also 3-phase) missing many registers in the file of this addon. Have you already tested your commit? Doesn't you need to edit the config and add a additional option for sh10rt? The ModbusTCP.py goes for a file recognition based on the choosed option - or do I misunderstand something?

chainsawbike commented 2 years ago

1608064349708-communication-protocol-of-residential-hybrid-inverterv1.0.20-1.pdf

Yes, I am using it now, I have fixed the units and a negative value issue since this PR though, iiuc the sh5.0rt and the sh10rt have identical registers.

I also added to the home assistant auto detect code in modbustcp.py to expose some of the extra values this modbus map gets

Regarding specifying which modbus map to use the issue is using the current system there will be a lot of almost identical modbus map files. instead I was thinking you just need to specify "sungrow" in the config file, then read register 5000, which contains the model id then use that to automaticly get the correct mapping using a base map and an inverter specific map rather than an individual file for each inverter.

If we go that far we may as well add to the modbus map the data needed to do the home assistant auto detect stuff so all values show up in home assistant.

ptC7H12 commented 2 years ago

That sounds very promising. Would you share your Modbustcp.py? I'm a beginner in Python and would like to look how you managed it.

And thank you for the pdf!

chainsawbike commented 2 years ago

i updated the modbus map with the units fixed.

here is the bit i edited in modbustcp.py: https://gist.github.com/chainsawbike/e6a9615ccff5971a7b63dfe27f0442d5 ... its not a good solution but it works

chainsawbike commented 2 years ago

fixed link