Skip to content
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

[openthermgateway] Add support for Ventilation/Heat Recovery units #11203

Closed
wants to merge 27 commits into from

Conversation

ArjenKorevaar
Copy link
Member

Added support for Ventilation/Heat Recovery units to the OpenTherm Gateway binding.

More info at #11202

Solar Boiler units are currently only partially supported by the OpenTherm Gateway device itself, so this may be added to the binding at a later time.

@openhab-bot
Copy link
Collaborator

This pull request has been mentioned on openHAB Community. There might be relevant details there:

https://community.openhab.org/t/opentherm-gateway-binding/39160/294

@ArjenKorevaar
Copy link
Member Author

Not sure why the build failed, it seems unrelated to the changes made to the binding.

Stacktrace

org.opentest4j.AssertionFailedError: Error cleaning up test (deleting table)
Caused by: java.util.concurrent.ExecutionException: software.amazon.awssdk.services.dynamodb.model.ResourceNotFoundException: Cannot do operations on a non-existent table (Service: DynamoDb, Status Code: 400, Request ID: 5c0b87d4-911e-4f17-a872-69038f24a1dd, Extended Request ID: null)
Caused by: software.amazon.awssdk.services.dynamodb.model.ResourceNotFoundException: Cannot do operations on a non-existent table (Service: DynamoDb, Status Code: 400, Request ID: 5c0b87d4-911e-4f17-a872-69038f24a1dd, Extended Request ID: null)

@Skinah Skinah added the enhancement An enhancement or new feature for an existing add-on label Sep 7, 2021
@kaikreuzer kaikreuzer added rebuild Triggers Jenkins PR build and removed rebuild Triggers Jenkins PR build labels Sep 9, 2021
@ArjenKorevaar
Copy link
Member Author

Rebased onto main, now PR build succeeds

@ArjenKorevaar ArjenKorevaar changed the title [openthermgateway] Add support for Ventilation/Heat Recovery units PTAL : [openthermgateway] Add support for Ventilation/Heat Recovery units Nov 12, 2021
@ArjenKorevaar
Copy link
Member Author

ArjenKorevaar commented Nov 27, 2021

Rebased onto main

Copy link
Member

@fwolter fwolter left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

There are some checkstyle warnings left. You could take a look at target/code-analysis/report.html after building it with mvn clean install.

Are there any breaking changes like renamed channels or renamed Thing/Bridge UIDs?

bundles/org.openhab.binding.openthermgateway/README.md Outdated Show resolved Hide resolved

| Channel ID | Item Type | Description | Access |
|------------|-----------|-------------|--------|
| vh_ventilationenable | Switch | Ventilation enabled | R |
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What's the reason for adding a suffix to the channel names?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The names of the channels are mostly a copy/paste from the OpenTherm specifications. And those names do not always follow openHAB coding guidlines when it comes to the number of words, length in characters or things like using a suffix. So I find myself abbreviating or leaving words out.. just to comply with coding guidlines really but not making anything better in terms of readability imho or matching with the OT specs. So.. I don't know.. should I change them?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'd remove the prefix as it seems redundant for all Channels.

bundles/org.openhab.binding.openthermgateway/README.md Outdated Show resolved Hide resolved
bundles/org.openhab.binding.openthermgateway/README.md Outdated Show resolved Hide resolved
@fwolter fwolter changed the title PTAL : [openthermgateway] Add support for Ventilation/Heat Recovery units [openthermgateway] Add support for Ventilation/Heat Recovery units Dec 11, 2021
@ArjenKorevaar
Copy link
Member Author

ArjenKorevaar commented Dec 18, 2021

@fwolter thank you for the review! I will look into each comment but this may take some time. I'll let you know once it's ready to be reviewed again.

There are some checkstyle warnings left. You could take a look at target/code-analysis/report.html after building it with mvn clean install.

Fixed most of them.. just the import of .* I haven't found a more elegant solution to

Are there any breaking changes like renamed channels or renamed Thing/Bridge UIDs?

Yes, definitely. The previous version had 1 Thing and that was used for boilers only. This version has a Bridge to communicate with the gateway and then separate Things for the actual devices, which allowed for support for ventilation/heat recovery units. In the future, more Things may be added such as solar panels and energy storage units.

@fwolter
Copy link
Member

fwolter commented Dec 27, 2021

Fixed most of them.. just the import of .* I haven't found a more elegant solution to

You can simply use the Organize Imports function of eclipse to resolve these.

I added the portentially not backward compatible label. The changes should be mentioned in the update.lst to show a warning when the user updates the system. See https://github.com/openhab/openhab-distro/blob/main/distributions/openhab/src/main/resources/bin/update.lst

@andrewfg
Copy link
Contributor

andrewfg commented Feb 2, 2022

Ok @ArjenKorevaar, this is going to take me more time than I thought, so I will do it in three (at least) steps..

  1. Review of potential merge conflicts between the two files (OpenThermGatewaySocketConnector & OpenThermGatewayHandler) that are touched in my [openthermgateway] Rationalize exception handling & decouple tasks on different threads. #12185 and in this PR. I have good reasons why I think my fixes are better than yours, which I will mention in the review. And I will propose the correct respective core that would resolve the merge conflicts
  2. Code review of all the other files in this PR.
  3. Functional test on my operative system.

Copy link
Contributor

@andrewfg andrewfg left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Review step 1 on the OpenThermGatewaySocketConnector and OpenThermGatewayHandler classes..

@andrewfg
Copy link
Contributor

andrewfg commented Feb 2, 2022

  1. Code review of all the other files in this PR.

@ArjenKorevaar before I start work on the general code review, I would like to ask your opinion about how you prefer to handle it. There are two possible ways..

  1. I could make review comments and proposed changes here in this PR; the advantage is that all proposals are discussed and formally tracked in this PR; and the disadvantage is that you have to make the requested changes in your IDE yourself and make respective commits, or
  2. Alternatively I could derive a git branch on my repo from your own repo/branch, and make the changes directly in my IDE, and then make a 'sub-' PR from my repo/branch to your repo/branch; which if you would adopt my code changes, will then automatically flow into this PR here; the discussions and changes would then be tracked on your repo/branch, rather than here, but the advantage for you is that it saves you making the requested changes in your IDE yourself.

So it depends a bit on your workload and what you prefer. => Please let me know..

@ArjenKorevaar
Copy link
Member Author

@andrewfg just a heads-up: I won't be able to spend time to look into this any time soon.

@andrewfg
Copy link
Contributor

andrewfg commented Feb 3, 2022

When I am done, I will make a PR from my repo/branch to your repo/branch, so that if you merge my changes, they will cascade into this PR

.. well that did not go quite as I expected .. I really hate Git! Instead of pushing my proposed changes to a PR on @ArjenKorevaar 's repo (so he could optionally choose whether to adopt them or not, and then cascade into this PR), it seems that all of my commits landed directly in this PR automatically! (I don't really know how that happened..) But anyway, @ArjenKorevaar if you are NOT happy with my suggestions, then you will need to unwind the 16 commits made by me today February 3rd, 2022.

Please accept my humble apologies for the unintended usurpation of your PR. The good news is that all of my code review suggestions, (and some of @fwolter 's still open suggestions), are now included in the PR, so I can now give you an LGTM on the final result!

@andrewfg
Copy link
Contributor

andrewfg commented Feb 3, 2022

PS I note the following..

  • the CI build failed, but I think it is not the fault of this code ??
  • it also reports potential merge conflicts on two files, but I am not clever enough to resolve them..

@andrewfg
Copy link
Contributor

andrewfg commented Feb 3, 2022

potential merge conflicts on two files

The two files OpenThermGatewayBindingConstants.java and DataType.java are ones that have been moved (to another package in the project) or re-moved entirely from the project. I have no idea why the CI build system chokes on that, but I can assure you that it all builds fine locally in Eclipse or MVN.

@andrewfg
Copy link
Contributor

andrewfg commented Feb 3, 2022

^
I don't know if this helps, but regarding the merge conflicts (see screenshot below)..

  • OpenThermGatewayBindingConstants.java is tagged in Git as being a) deleted, and then b) added
  • DataType.java is tagged in Git as being renamed to ConnectionState.java

image

@andrewfg
Copy link
Contributor

andrewfg commented Feb 7, 2022

One of my prior commits had broken the Thing initialization, so I pushed a fix just now.
Also I have installed the current JAR on my operative system, and will let it run fir a day or two.

@andrewfg andrewfg requested review from fwolter and jlaur February 11, 2022 15:22
@andrewfg
Copy link
Contributor

@ArjenKorevaar there are a couple of open issues that you need to resolve concerning the review from @fwolter

  • use of logger.debug() in a couple of places
  • use of vh_ prefix on channel names

@fwolter I wonder if you can kindly help us with the merge conflict?

@fwolter
Copy link
Member

fwolter commented Feb 20, 2022

Yes, how can I help?

@andrewfg
Copy link
Contributor

andrewfg commented Feb 20, 2022

how can I help?

@fwolter the merge conflict is due to two files where the Git change tracker is not clever enough to recognise the changes..

  • one is a renamed and repurposed class (was DataType, repurposed to ConnectionState) where it seems that the changes were so big that GitHub cannot recognise the change
  • the second is a file (OpenthermGatewayBindingConstants) was moved to a different sub directory

Unfortunately I dont know enough about Git commands to tell it how to unwind its confusion.

@fwolter
Copy link
Member

fwolter commented Feb 20, 2022

There were other commits in the meantime, modifying the two files. That's why they are conflicting in this PR. @ArjenKorevaar you need to rebase your branch with git rebase upstream/main and resolve the conflicts by hand when executing the command.

@andrewfg
Copy link
Contributor

you need to rebase your branch with git rebase upstream/main and resolve the conflicts by hand when executing the command.

@fwolter , @ArjenKorevaar told me that he is quite busy and does not have much time to work on this.

So as an alternative potential approach I created this new branch on my repo, to which I have copied all the files from this PR, and also also rebased it on the current main branch, thus removing the merge conflicts.

So if we would proceed with a PR based on my new branch rather than proceeding with this PR, we could potentially speed up the review and approval process since I myself would be able to do all the remaining work, without imposing further effort on @ArjenKorevaar.

However before I do this, can you please give me the Ok?

@fwolter
Copy link
Member

fwolter commented Feb 23, 2022

Sounds good.

@ArjenKorevaar
Copy link
Member Author

Sounds good to me too. I am currently abroad and won't be able to work on this for atleast another couple of weeks.

@fwolter
Copy link
Member

fwolter commented Feb 27, 2022

Closed in favor of #12367.

@fwolter fwolter closed this Feb 27, 2022
@ArjenKorevaar ArjenKorevaar deleted the bridge_3.2.x branch April 7, 2023 14:33
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement An enhancement or new feature for an existing add-on (potentially) not backward compatible
Projects
None yet
Development

Successfully merging this pull request may close these issues.

7 participants