-
-
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
[stiebeleltron] Initial commit #7718
Conversation
Travis tests were successfulHey @pail23, |
|
||
| Channel ID | Item Type | Read only | Description | | ||
| --------------------------- | ------------------ | --------- | ------------------------------------------- | | ||
| operation-mode | Number | false | The current operation mode of the heat pump | |
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.
Can you specify what the numbers refer to?
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.
I have added the possible values for the operation mode
|
||
| Channel ID | Item Type | Read only | Description | | ||
| ----------------------- | ------------- | --------- | ------------------------------------------------ | | ||
| production_heat_today | Number:Energy | true | The heat quantity delivered today | |
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.
The above channel IDs use dashes for sepration. Is there a reason why you use underscores, here?
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.
Good catch. Fixed. Thanks
|
||
| Thing | Description | | ||
| ------------------------ | -------------------------------------------------- | | ||
| Stiebel Eltron ISG | A stiebel eltron heat pump connected through a ISG | |
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.
Can you mention the ThingID here?
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.
Yes. Done.
/** | ||
* Reference to the modbus manager | ||
*/ |
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 comment has no benefit. You could remove it. Same for similar. Private fields don't need to be commented.
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.
Comment removed
...enhab.binding.modbus.stiebeleltron/src/main/resources/ESH-INF/config/config-descriptions.xml
Outdated
Show resolved
Hide resolved
...enhab.binding.modbus.stiebeleltron/src/main/resources/ESH-INF/config/config-descriptions.xml
Outdated
Show resolved
Hide resolved
@@ -0,0 +1,17 @@ | |||
# FIXME: please substitute the xx_XX with a proper locale, ie. de_DE |
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.
Did this file find its way into your binding by intention?
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.
File removed
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.
Again with the unchecked exception. The user could configure an unsupported unit.
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.
I guess this comment goes to StiebelEltronHandler (and not to the .properties file)
|
||
<channel-type id="fek-temperature-type"> | ||
<item-type>Number:Temperature</item-type> | ||
<label>FFK temperature</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.
Words in labels should be capitalized. See https://www.openhab.org/docs/developer/bindings/thing-xml.html#formatting-labels-and-descriptions
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.
Fixed on all occasions
bundles/pom.xml
Outdated
@@ -1,501 +1,982 @@ | |||
<?xml version="1.0" encoding="UTF-8" standalone="no"?><project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"> | |||
|
|||
<?xml version="1.0" encoding="UTF-8" standalone="no"?> |
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.
Can you remove the formatting from this file?
@fwolter many thanks for your review. I tried to address all your comments. |
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.
Did you notice my comments in the handler file?
private static final String BINDING_ID = ModbusBindingConstants.BINDING_ID; | ||
|
||
// List of all Thing Type UIDs | ||
public static final ThingTypeUID THING_TYPE_SAMPLE = new ThingTypeUID(BINDING_ID, "heatpump"); |
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.
The field is named THING_TYPE_SAMPLE
.
@fwolter Thanks for the hint. It should be fixed now |
Did you click on "Load more ..."? There are 19 comments, you didn't react to. |
@fwolter Indeed I did not see the 19 other review comments before. Thanks! |
@fwolter All your comments should be fixed now. Many thanks for your review. Please let me know if there are other things I should change. |
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.
Your changes look good. I found another few minor things, I overlooked at the first review.
openHAB 2.5.6 has been released. Can you rebase your code and change the version number to 2.5.7-SNAPSHOT?
There are some formatting issues. You can view them with mvn spotless:check -Dspotless.check.skip=false
and fix them with mvn spotless:apply
.
.../main/java/org/openhab/binding/modbus/stiebeleltron/internal/dto/SystemInformationBlock.java
Outdated
Show resolved
Hide resolved
*/ | ||
public class SystemParameterBlock { | ||
|
||
public Integer operation_mode; |
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.
See above (camel case)
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.
changed to camel case
*/ | ||
public class SystemParameterBlock { | ||
|
||
public Integer operation_mode; |
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.
Is there a reason why you use complex type? Can this be int
? Same for below.
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.
changed to int
*/ | ||
public class SystemStateBlock { | ||
|
||
public Integer state; |
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.
See above
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.
changed to int
...ain/java/org/openhab/binding/modbus/stiebeleltron/internal/handler/StiebelEltronHandler.java
Outdated
Show resolved
Hide resolved
public void bridgeStatusChanged(ThingStatusInfo bridgeStatusInfo) { | ||
super.bridgeStatusChanged(bridgeStatusInfo); | ||
|
||
logger.debug("Thing status changed to {}", this.getThing().getStatus().name()); |
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.
See above
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.
removed
if (getThing().getStatus() == ThingStatus.ONLINE) { | ||
startUp(); | ||
} else if (getThing().getStatus() == ThingStatus.OFFLINE) { | ||
tearDown(); | ||
} |
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.
You are checking for the Thing status here. Do you want to check the bridge status?
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.
good point. I have changed it to the bridge status
/** | ||
* Reset communication status to ONLINE if we're in an OFFLINE state | ||
*/ | ||
protected void resetCommunicationError() { |
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.
Is this method used anywhere?
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.
I have inserted the method call in the polling data handlers
|
||
<config-description uri="thing-type:stiebeleltron:modbusconfig"> | ||
|
||
<parameter name="refresh" type="integer" min="0" unit="s"> |
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.
Did you test 0? If I see correctly it will be passed to the modbus code, which will throw an IllegalArgumentException.
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.
changed it to one
Travis tests were successfulHey @pail23, |
1 similar comment
Travis tests were successfulHey @pail23, |
@fwolter Thanks once again. All your comments should be reflected, except the one regarding the Status Update |
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.
LGTM
Since this is a new binding, another maintainer needs to review your code. This can take some time, because the backlog is quite extensive. Please be patient.
Since PR #7994 makes improvements to the modbus api that this PR would use, I'll hold back on reviewing this PR until the API changes have gone through. |
Travis tests have failedHey @pail23, |
Travis tests were successfulHey @pail23, |
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 for implementing the new API.
if (getThing().getStatus() != ThingStatus.ONLINE) { | ||
updateStatus(ThingStatus.ONLINE); | ||
} | ||
}, failure -> {StiebelEltronHandler.this.handleReadError(failure);}); |
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.
Syntactical sugar. Same for below.
}, failure -> {StiebelEltronHandler.this.handleReadError(failure);}); | |
}, StiebelEltronHandler.this::handleReadError); |
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.
Changed to your proposal
String msg = ""; | ||
String cls = ""; | ||
cls = error.getClass().getName(); | ||
msg = error.getMessage(); |
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.
Initialization with empty strings has no effect, since they are overwritten below. You can initialize them with the intended values at once.
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.
Removed the initialization with the empty strings
Thanks @fwolter for your review. I have implemented the 2 proposed changes. |
Travis tests were successfulHey @pail23, |
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 for your contribution. Just some minor comments.
|
||
This extension adds support for the Stiebel Eltron modbus protocol. | ||
|
||
An Internet Service Gateway (ISG) with an installed modbus extension is required in order to run this binding. In case the modbus extension is not yet installed on the ISG, the ISG Updater Tool for the update can be found here: https://www.stiebel-eltron.de/de/home/produkte-loesungen/erneuerbare_energien/regelung_energiemanagement/internet_servicegateway/isg_web/downloads.html |
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.
Can you put each line on a new line so it makes it easier to review (future) improvements to the documentation.
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.
It think I implemented your feedback. Please have a look and let me know in case I didn't understand your review comment properly.
bundles/pom.xml
Outdated
@@ -230,7 +231,7 @@ | |||
<module>org.openhab.binding.snmp</module> | |||
<module>org.openhab.binding.solaredge</module> | |||
<module>org.openhab.binding.solarlog</module> | |||
<module>org.openhab.binding.somfymylink</module> | |||
<module>org.openhab.binding.somfymylink</module> |
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 revert this indentation change.
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.
Done
<parent> | ||
<groupId>org.openhab.addons.bundles</groupId> | ||
<artifactId>org.openhab.addons.reactor.bundles</artifactId> | ||
<version>2.5.7-SNAPSHOT</version> |
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 rebase/update to 2.5.8-SNAPSHOT
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.
Done
Signed-off-by: Paul Frank <[email protected]>
Signed-off-by: Paul Frank <[email protected]>
Signed-off-by: Paul Frank <[email protected]>
Signed-off-by: Paul Frank <[email protected]>
Co-authored-by: Fabian Wolter <[email protected]> Signed-off-by: Paul Frank <[email protected]>
…/org/openhab/binding/modbus/stiebeleltron/internal/dto/SystemInformationBlock.java Co-authored-by: Fabian Wolter <[email protected]> Signed-off-by: Paul Frank <[email protected]>
…/org/openhab/binding/modbus/stiebeleltron/internal/handler/StiebelEltronHandler.java Co-authored-by: Fabian Wolter <[email protected]> Signed-off-by: Paul Frank <[email protected]>
Signed-off-by: Paul Frank <[email protected]>
Signed-off-by: Paul Frank <[email protected]>
Signed-off-by: Paul Frank <[email protected]>
Signed-off-by: Paul Frank <[email protected]>
Signed-off-by: Paul Frank <[email protected]>
Signed-off-by: Paul Frank <[email protected]>
Travis tests have failedHey @pail23, |
Signed-off-by: Paul Frank <[email protected]>
Travis tests were successfulHey @pail23, |
Signed-off-by: Paul Frank <[email protected]>
Travis tests were successfulHey @pail23, |
Thanks @Hilbrand for the review! I tried to implement your feedback. |
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.
LGTM
Signed-off-by: Paul Frank <[email protected]>
Signed-off-by: Paul Frank <[email protected]>
Signed-off-by: Paul Frank <[email protected]>
Signed-off-by: Paul Frank <[email protected]>
Signed-off-by: Paul Frank <[email protected]> Signed-off-by: Daan Meijer <[email protected]>
Signed-off-by: Paul Frank <[email protected]>
Signed-off-by: Paul Frank <[email protected]>
[stiebeleltron] Initial contribution of a ISG Binding (Modbus)
This is a initial contribution for a binding to connect to the Internet Service Gateway of Stiebel Eltron heat pumps through modbus. The binding is heavily inspired by and based on the modbus spunspec binding.
A test version of the binding can be downloaded here.