-
-
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. |
Fixes openhab#17486 Signed-off-by: Tim <[email protected]>
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.
|
||
## Supported Inverters | ||
|
||
As defined within the spec mentioned above the following inverters are supported, but not all are tested yet: | ||
|
||
- SH3K6 |
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.
Are these devices removed on purpose?
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.
This file is not used anywhere is it? Better to remove.
/** | ||
* Defines methods for mapping a given value (from the registers) to a corresponding String. | ||
* | ||
* @author Tim <[email protected]> |
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.
* @author Tim <tim.scholand@gmail.com> | |
* @author Tim Scholand - Initial contribution |
* This mapper implements {@link ToStringMapper} and maps the hex codes of the sungrow modbus register to the human | ||
* readable device names. | ||
* | ||
* @author Tim <[email protected]> |
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.
* @author Tim <tim.scholand@gmail.com> | |
* @author Tim Scholand - Initial contribution |
* This mapper implements {@link ToStringMapper} and maps the integer codes of the sungrow modbus register to the human | ||
* readable DRM states. | ||
* | ||
* @author Tim <[email protected]> |
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.
* @author Tim <tim.scholand@gmail.com> | |
* @author Tim Scholand - Initial contribution |
</channel-type> | ||
<channel-type id="sg-power-flow-status-pv-power" advanced="true"> | ||
<item-type>Switch</item-type> | ||
<label>Power Flow Status - Power generated from PV</label> |
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.
Please adjust the labels to 2-3 words, 23 chars and capitalized words. Applies to all channels.
Some labels could just be copy pasted to a description
tag.
<!-- | ||
<channel-type id="sg-meter-phase-a-active-power" advanced="true"> | ||
<item-type>Number:Power</item-type> | ||
<label>Meter Phase A Active Power</label> | ||
<category>Energy</category> | ||
<tags> | ||
<tag>Measurement</tag> | ||
<tag>Power</tag> | ||
</tags> | ||
<state pattern="%.2f %unit%" readOnly="true"/> | ||
</channel-type> | ||
<channel-type id="sg-meter-phase-b-active-power" advanced="true"> | ||
<item-type>Number:Power</item-type> | ||
<label>Meter Phase B Active Power</label> | ||
<category>Energy</category> | ||
<tags> | ||
<tag>Measurement</tag> | ||
<tag>Power</tag> | ||
</tags> | ||
<state pattern="%.2f %unit%" readOnly="true"/> | ||
</channel-type> | ||
<channel-type id="sg-meter-phase-c-active-power" advanced="true"> | ||
<item-type>Number:Power</item-type> | ||
<label>Meter Phase C Active Power</label> | ||
<category>Energy</category> | ||
<tags> | ||
<tag>Measurement</tag> | ||
<tag>Power</tag> | ||
</tags> | ||
<state pattern="%.2f %unit%" readOnly="true"/> | ||
</channel-type> | ||
--> |
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.
Drop or use
<label>Export Limit Max</label> | ||
<category>Energy</category> | ||
<tags> | ||
<tag>Power</tag> |
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.
Either two or no tags are expected. In this case i think it should be removed.
<label>BDC Rated Power</label> | ||
<category>Energy</category> | ||
<tags> | ||
<tag>Power</tag> |
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.
Either two or no tags are expected. In this case i think it should be removed.
<label>Max. Discharging Current (BMS)</label> | ||
<category>Energy</category> | ||
<tags> | ||
<tag>Current</tag> |
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.
Either two or no tags are expected. In this case i think it should be removed.
[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