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
[resol][WIP] Add Resol Controller Binding - Initial Contribution #8302
Conversation
Travis tests were successfulHey @ramack, |
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 peeked into your binding. Here is my feedback.
There are some checkstyle warnings left. You could take a look at target/code-analysis/report.html
.
There are some formatting issues. You can view them with mvn spotless:check -Dspotless.check.skip=false
and fix them with mvn spotless:apply
.
The JAR of the external library should not be part of this PR. It should be referenced in the pom.xml.
You need to sign your commits. See https://www.openhab.org/docs/developer/contributing.html#sign-your-work and https://community.openhab.org/t/dco-check-signing-off-with-github-web-editor-explanation/83330
...penhab.binding.resol/src/main/java/org/openhab/binding/resol/handler/ResolBridgeHandler.java
Outdated
Show resolved
Hide resolved
...penhab.binding.resol/src/main/java/org/openhab/binding/resol/handler/ResolBridgeHandler.java
Show resolved
Hide resolved
...sol/src/main/java/org/openhab/binding/resol/internal/discovery/ResolVBusBridgeDiscovery.java
Outdated
Show resolved
Hide resolved
bundles/org.openhab.binding.resol/src/main/resources/ESH-INF/thing/bridge.xml
Outdated
Show resolved
Hide resolved
bundles/org.openhab.binding.resol/src/main/resources/ESH-INF/thing/bridge.xml
Show resolved
Hide resolved
bundles/org.openhab.binding.resol/src/main/resources/ESH-INF/thing/bridge.xml
Outdated
Show resolved
Hide resolved
Thanks a lot for the very fast reaction. I did not expect that, especially as I tagged it WIP, and was mainly hoping for the automatic feedback from travis&Jenkins. But for sure I appreciate every human comment!
This might also be due to working with an old upstream base. Is 2.5.x the correct branch to work with? - Is there already an ETA for the next release? And is the 2.5.x branch currently sufficiently stable? - So far I had always heavy issues after rebasing.
Did this most of the time. - The only one where I forgot is the one adding the jar - where it is even the question whether it should be there :-) Beside that there are also a few TODO comments and other things left open so you don't need to go into all details yet, but if you see further general things as above I'd be happy. |
The
It should be signed-off, too, because you take responsibility, that the library may be used within this binding. |
Ah, my main question about the jar got lost in formatting above, so let me put it again: |
You could take a look at this PR, which uses an external library. The library must be in a public maven repository. |
Travis tests have failedHey @ramack, |
Travis tests were successfulHey @ramack, |
Travis tests have failedHey @ramack, |
When updating the version number you need to rebase ( |
This is more or less what I tried. I did |
It es especially crazy, if a magic mvn command compiles the binding successfully but in eclipse I only get weird errors. So if you can recommend another way than using eclipse to debug the binding I'd potentially always become more efficient. |
Get rid of all the openhab-core projects in eclipse you don't need it when developing a binding. You only need to import the demo project (which is done when selecting openhab-development during eclipse setup) and your own binding. |
Did you succeed in getting eclipse running? It should work out of the box with only the demo project and your binding and the instructions on the openHAB eclipse page. |
Not yet. I removed the openhab-core projects and at least some of the errors are gone. But the pom.xml of my binding is still showing
And I am trying now to build the demo app on the command line. |
What version of eclipse are you running. I had some issues with version 2020--06 that gaven an error on the parent element in the pom. I don't know why it does so, but I switched back to 2020-03. |
Yes, I am on 2020-06, I'll try with 2020-03. Also it seems that another show stopper is that eclipse doesn't find the external maven repository which I use for the external library vbus-java. |
Ah ok, the eclipse verion might be a problem to. I haven't had time to look into it in detail and just hoped it's fixed when 202-09 is released. About the external repository. I was reviewing your code, (but haven't yet finished, so you can't see it yet). But the repository must be one of the known repostories, like maven central. The problem is, we can't just add any random repository. Because if that repository is not available it will break the build and that is not something that should happen. |
ok. Can you help @danielwippermann and explain in the ticket danielwippermann/resol-vbus-java#17 how to do that? |
With 2020-03 I get: but this seems to be "ignorable" with the proposed quickfix. Now eclipse (2020-03) does not show any error anymore, but as soon as I add the binding in the pom of the demo app, the app.bndrun dialog does not show any repository anymore, so I cannot add the binding as run requirement. I leave it for today, after hours of reinstalling eclipse and trying... - while command line compilation still works. Thanks for your help, but I am still lost :-( |
I'll post information on what the easiest way to publish a jar is in relation to usage with openHAB. The error about lifecyle can indeed be suppressed, it's a maven/eclipse thing that has no effect on working with eclipse. If I have some time tommorrow I can check if i can import the binding in my eclipse environment. |
Perfect, this would help! I reached one further conclusion: without the external dependency to vbus-java lib in my binding the bndrun-dialog seems happy (but for sure some compile issues occur.) If I readd the dependency, the compile errors vanish but bndrun dialog shows a lot of issues, especially with the OSGI framework: So the last issue I have after downgrading to eclipse 2020-03 might be the mvn dependency to the external library. |
If you add the repository to the repositories in the demo app |
Yes, this did the trick. Thanks a lot! Will hopefully work on it again tomorrow! |
I've started the application process for including the "de.resol" group ID into the central repo. I'll keep you posted :) |
The library has been released to the central Maven repo. https://repo1.maven.org/maven2/de/resol/vbus/ Please update your dependencies to use version "0.4.0". |
Signed-off-by: Raphael Mack <ramack@raphael-mack.de>
Signed-off-by: Raphael Mack <ramack@raphael-mack.de>
Signed-off-by: Raphael Mack <ramack@raphael-mack.de>
Signed-off-by: Raphael Mack <ramack@raphael-mack.de>
Signed-off-by: Raphael Mack <ramack@raphael-mack.de>
Signed-off-by: Raphael Mack <ramack@raphael-mack.de>
…n number Signed-off-by: Raphael Mack <ramack@raphael-mack.de>
Signed-off-by: Raphael Mack <ramack@raphael-mack.de>
Signed-off-by: Raphael Mack <ramack@raphael-mack.de>
Signed-off-by: Raphael Mack <ramack@raphael-mack.de>
3a34458
to
9e5eef7
Compare
I had the |
Signed-off-by: Raphael Mack <ramack@raphael-mack.de>
Signed-off-by: Raphael Mack <ramack@raphael-mack.de>
Automatic code migration to openHAB 3 succeeded. The resulting code can be found at https://ci.openhab.org/job/openHAB-Addons-Migration/97/artifact/bundles/. You can download the migrated code from there and create a new PR against the master branch of the openhab-addons repo to contribute it for being included in openHAB 3.x. Please see this issue about the details on how to proceed with your existing PR. |
Hi @ramack! I ported your code to OH3 as some users would like to continue using the Resol Binding after their upgrade. |
@wborn thanks for your efforts. I have already started to work on that also here: https://github.com/ramack/openhab-addons/tree/Resol3 but your solutions look more clean. In both versions though I have trouble with some data points and for example the temperatures are not getting updated. Also I only see the String and DateTime channels in the Thing (in the new OH3 UI). So it seems that the channel update (or the channel creation) in the BridgeHandle doesn't properly work. |
That's great that you've started working on an OH3 version! 👍 I only ran the script we use for porting add-ons on the branch of this PR and fixed a few compilation errors and warnings just so I was able to build a JAR. 🙂 |
Ok, so we have to admit that it doesn't work to read the most interesting dataponts right now, but I am on track of it, looks like the unit handling the the used resol-vbus library improved and we get a real unit now for many of the data points, and in the thing-types.xml I mapped everything to the generic, magic type "None", as soon as I add there a type
I start to get interesting values. But to be honest, I am not sure to do the right thing here in the thing-types, can you give me some advice here? - The main challenge is, that I create the channels dynamically, based on the datapoints returned by the library. So I tried to put there a "generic" type into the thing-types and adjust the label and description in the channel, but it seems somehow wrong... |
Did you also try adding the dimension in the They are all number now: ChannelTypeBuilder.state(channelTypeUID, u.getUnitFamily().toString(), "Number") Looks like you can map the result of |
Closing this in favor of the OH3 rework in #9449 |
Target of this PR is to contribute the Resol binding to openhab and close #7921 to support connection of devices from RESOL - Elektronische Regelungen GmbH, which are solar and heating controllers and heat count units. This includes support of many branded versions from Viessmann, SOLEX, COSMO, SOLTEX, DeDietrich and others.
The binding is already around and in production use since some years, discussed in the community forum and available in Eclipse IoT Marketplace. Now it is the time to clean it up and submit a PR into openhab.