-
-
Notifications
You must be signed in to change notification settings - Fork 3.6k
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
[modbus.sungrow] Added some more registers #18364
base: main
Are you sure you want to change the base?
Conversation
Ok, I just realized, that the checks didn't succeed. I guess, I will have to look into the problems, before this should be reviewed. |
5192e2e
to
b253c19
Compare
I fixed the errors stated by the build pipeline. |
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.
Thanks you for your contribution. There are some minor comments to fix. Besides the added registers, there are more changes (like default poll interval) could you list the changes clearly in the start post? It's ok for now, but we usually prefer to have the changes seperated, it makes it easier to backport changes, improve review speed and it improve the release notes / documentation.
As some channels are removed and others are added, this PR also needs upgrade instructions. For reference: https://www.openhab.org/docs/developer/bindings/thing-xml.html#updating-thing-types You could also inspect a binding (like plugwiseha) to see how it works.
bundles/org.openhab.binding.modbus.sungrow/doc/WiNet-S2_Modbus.png
Outdated
Show resolved
Hide resolved
...sungrow/src/main/java/org/openhab/binding/modbus/sungrow/internal/mapper/ToStringMapper.java
Outdated
Show resolved
Hide resolved
.../src/main/java/org/openhab/binding/modbus/sungrow/internal/mapper/impl/DeviceTypeMapper.java
Outdated
Show resolved
Hide resolved
...ow/src/main/java/org/openhab/binding/modbus/sungrow/internal/mapper/impl/DrmStateMapper.java
Outdated
Show resolved
Hide resolved
bundles/org.openhab.binding.modbus.sungrow/src/main/resources/OH-INF/thing/thing-types.xml
Outdated
Show resolved
Hide resolved
bundles/org.openhab.binding.modbus.sungrow/src/main/resources/OH-INF/thing/thing-types.xml
Outdated
Show resolved
Hide resolved
bundles/org.openhab.binding.modbus.sungrow/src/main/resources/OH-INF/thing/thing-types.xml
Outdated
Show resolved
Hide resolved
bundles/org.openhab.binding.modbus.sungrow/src/main/resources/OH-INF/thing/thing-types.xml
Outdated
Show resolved
Hide resolved
bundles/org.openhab.binding.modbus.sungrow/src/main/resources/OH-INF/thing/thing-types.xml
Outdated
Show resolved
Hide resolved
As mentioned in the issue #17486, this breaks compatibility with inverters that don't provide this additional registers and requires a little more refactoring. |
I just had one idea how to solve this problem: We could add a new flag for all registers "optional".
The thing-initialization could then be done as follows:
As in 2 only the optional registers are checked, the amount of modbus/network requests is lower (than checking every register). This has the following advantages:
How do you think about? |
Fixes openhab#17486 Signed-off-by: Tim <[email protected]>
b253c19
to
18a8bb5
Compare
Hi, your idea sounds good. I'll have a look at this later. For now I tried to correct the points from the review above. |
Only 2 comments are left open. |
[modbus.sungrow] Added some more registers
This is my first contribution to openhab and my first work with modbus.
Description
I added some registers, among others (power flow state, mppt3 and mppt4 and some more), using the documentation "Communication Protocol of Residential Hybrid Inverter V1.1.5".
This should fix issue #17486
Testing
We need to get some positive testing feedback from people, who use the current version of the addon, as I am not 100% sure, if querying the added registers might produce errors or even render the addon unusable for them.
Testing can be done with the jar at https://github.com/tscholand/openhab-addons/releases/download/TESTING/org.openhab.binding.modbus.sungrow-5.0.0-SNAPSHOT.jar