-
-
Notifications
You must be signed in to change notification settings - Fork 92
add Modbus Sunspec compatibility to opendtu-onbattery #1150
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: development
Are you sure you want to change the base?
Conversation
Checking that the measurement does not exceed the max Power
Modbus BugFix
Modbus BugFix
This reverts commit 5617240ce1fb15a3796d1ed558cc89f9ba72d8d5.
Fixed Temperature, Frequency etc.
Fixed Temp, Freq, AC
… "Total Power" and "Total Yield" into registers.
merge 23.6.26
prevent sending 0 as "e_energy_exported" to avoid peaks and gaps in solarweb statistic
merge v23.6.28
merge v23.8.3
|
This pull-request has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions. |
|
@AndreasBoehm @schlimmchen @stefan123t I am not sure when I find time to do the changes requested above. my issue is, that adapting / merging to current OpenDTU versions (or also OpenDTU-OnBattery) is very time consuming caused by my knowledge. it looks like there are some enhancement requests regarding ModbusTCP, I am happy if I can help, but I maybe need your help too if it is really wanted to be merged. Thanks. Best regards |
| mb.Hreg(0x9cc2, hexbytes[0]); | ||
| } | ||
|
|
||
| if (Hoymiles.getNumInverters() == 1) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
what if a user has configured multiple inverters?
Now that the DPL supports multiple inverters we shall not limit this feature a single inverter only.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
with multiple inverters the modbus data for total power (40097 and 40098) and yieldtotal (40129 and 40130) is filled.
those two values are the important one which are accumulateable easily (like already done in the "Total Yield Total" and "Total Power" in webgui)
other data (like frequency, voltage, etc.) is not filled, as we do not know from which source to take, and accumulating / calculating averages makes no sense at all.
this data is not mandatory (at least not for fronius inverters) to accept the ModbusTCP as smartmeter.
|
Let's talk about more about what this PR or your feature actually does, at least how i understood it. Please correct me if any of my assumptions are wrong.
Changes that i would suggest
I am wondering if this would be something that should be in the upstream project as its not related to having a battery at all? |
exactly.
I copied existing elements with great difficulty to have the here available settings. I am sure I cannot manage to create its own page renaming I can do, only the here mentioned? #1150 (comment) code cleanup I think I can not do satisfying enough. I tried to make the code already best readable as possible for me. the sunspec protocol documentation looks to be liable to pay costs: https://sunspec.org/sunspec-modbus-specifications/
there a previous modbus implementation was asked to offer a PR here. |
|
@AloisKlingler there are three compatibel standards mentioned on the sunspec page you referred to:
I have been able to download the IEEE_1547-2018_SunSpec.pdf PDF specifications for Distributed Energy Resource (DER) interoperability using the protocols defined in IEEE 2030.5-2018, IEEE 1815-2012 and SunSpec ModBus over TCP/IP transport via Ethernet / RS-485 (only the latter) from the above site. The other two are behind a paywall, access to which might be available to scientific researchers. I agree with you all that it would be worthwhile to include this in the upstream project as it enables a standard ModBus interface besides MQTT and Web API to share data from the Hoymiles DTUs in the OpenDTU project. I hope this may be (re-)considered at a later stage, once the PR has been more refined to both projects coding standards. |
|
This pull-request has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions. |
|
This pull-request has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions. |
|
with victron adding the posibility to send a limit for pv inverters over modbus to any inverter that follows the sunspec protocol, adding this to openDTUonB would be great. someone already did add this question to tbnobody#1893 i do have not enough experience in coding to help build this, but i would like to help as much as i can. |
|
This pull-request has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions. |
|
Still interesting :) |
|
@LoQue90 I would recommend you to create a feature request in Issues, because even though this PR mentions sunspec there are very different sunspec variants out there e.g. Smart Meter, Inverter, etc. |
|
@AndreasBoehm i thought I don't add another FR because the first underlying needed part is the Modbus integration. |
|
this PR only
there is no write to any registers implemented, also the further way back to the inverter is not implemented. |
|
This PR does integrate modbus, read only, but as discussed earlier in this PR we need to do a lot of cleanup to get this merged -> it probably makes more sense to start from scratch for this feature. OpenDTU-OnBattery is based on OpenDTU, but not depending on it. If we want to integrate a feature we can do so, without the need to have this in OpenDTU first. |
|
Thanks for the clarification! |
|
This pull-request has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions. |
|
This pull-request has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions. |
this implementation is (maybe only partially) modbus-sunspec compatibility to simulate a sunspec energy-meter.
to have calculation (especially self-consumption) correct for e.g. fronius solar web you need to either place a 300€ fronius smart meter before each "foreign" inverter.
With this PR it is possible to configure OpenDTU with it's IP-address as a "Smartmeter" on Fronius Gen24 or Fronius Symo inverter. so the Fronius Inverter is able to poll current production and overall production continuously like a from a real fronius-smartmeter.
necessary configuration on OpenDTU:

configuration on an Gen24 Inverter:

visualisation on an Gen24 inverter:

visualisation of the additional "Smartmeter" in Fronius Solarweb as "Additional AC Source":

visualisation of the "Smartmeter" data in Solarweb is available as common curve like other inverters are:

for my OpenDTU (and also some other users of photovoltaikforum.com) this implementation is running now over a year (more or less) flawless.
to the PR: the tree conflicting files webapp_dist/* need to be resolved on merge. other conflicts I could solve.