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

[openwebnet] add support for Energy Meter #10191

Merged
merged 7 commits into from
Mar 21, 2021

Conversation

aconte80
Copy link
Contributor

@aconte80 aconte80 commented Feb 17, 2021

These changes will:

  • restore support for Energy Meters (formerly "Energy Central Unit" in OH2, for example BTI-F520). Issue #10188 or see community thread.
  • Improvement: handle readed data with Unit of Measure (Watt)

Fixes #10188
Fixes #10242

sync with official repo
Signed-off-by: Andrea Conte <andrea@conte.com>
Signed-off-by: Conte Andrea <andrea@conte.com>
@aconte80 aconte80 closed this Feb 18, 2021
@aconte80 aconte80 reopened this Feb 18, 2021
@mvalla
Copy link
Contributor

mvalla commented Feb 25, 2021

this PR will also close #10242 by using version 0.4.0 of the openwebnet4j lib (see: https://github.com/mvalla/openwebnet4j/releases/tag/0.4.0).

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.

Did you modify the images intentionally?

Signed-off-by: Conte Andrea <andrea@conte.com>
Signed-off-by: Conte Andrea <andrea@conte.com>
@aconte80 aconte80 requested a review from fwolter March 14, 2021 18:24
Signed-off-by: Conte Andrea <andrea@conte.com>
@fwolter
Copy link
Member

fwolter commented Mar 16, 2021

@mvalla The 0.4.0 version is not found when building this PR.

@mvalla
Copy link
Contributor

mvalla commented Mar 16, 2021

@mvalla The 0.4.0 version is not found when building this PR.

@fwolter Very strange: actually all versions of the lib are now returning "403 Fobidden".
For example: https://jcenter.bintray.com/com/github/openwebnet4j/openwebnet4j/0.3.4/

Maybe it's a temporary problem, hopefully not related to the soon to be Bintray/JCenter shutdown

@kaikreuzer
Copy link
Member

Maybe it's a temporary problem, hopefully not related to the soon to be Bintray/JCenter shutdown

It is related to it. I have started working on openhab/openhab-distro#1256 and this requires us to not use any dependencies from JCenter anymore.

@mvalla Could you publish the lib to Maven Central instead? This seems to be the only working option on the long run.
As long as Bintray is still available, you can use Bintray's "Push to Maven Central" feature to do it without too much effort.

@mvalla
Copy link
Contributor

mvalla commented Mar 17, 2021

it looks like a double problem.

  1. artifacts are not accessible anymore: they all return 403 Forbidden. After a quick check this applies to other artifacts as well - just click on one of the files. I have seen some service shortage announced on JCenter, but now declared as solved. This is strange as they promised existing artifacts will be served until 2022:

After this date JCenter repository will still resolve artifacts, but end users should migrate to the canonical repo (e.g. Java packages should be retrieved from Maven Central). On Feb 1st, 2022 JCenter will only resolve artifacts for Artifactory clients.

  1. migration away from JCenter by @kaikreuzer : yes of course I would like to move the lib to Maven Central, but it's not a 1-click process and the quicker "Push to Maven Central" does not work atm, maybe because of the 403 Forbidden error. I will have to go through the Sonatype approval process, and if everybody is migrating now they will be surely very busy (and slow).

Did you have similar problems with other artifacts used by OH and not available anymore?

@kaikreuzer kaikreuzer added rebuild Triggers Jenkins PR build and removed rebuild Triggers Jenkins PR build labels Mar 17, 2021
@kaikreuzer
Copy link
Member

Yes, I have similar problems with other artifacts and I am looking for an alternative source for each. If none can be found, I temporarily upload them to our Artifactory. I just did so with openwebnet4j as well, but I uses openwebnet4j as its group id.
Only noticed now that you defined the group id to be com.github.openwebnet4j. Why this, this is not at Github library, is it? I strongly suggest to change the groupId because otherwise you'll anyhow not be allowed to bring it to Maven Central.

@@ -23,7 +23,7 @@
<dependency>
<groupId>com.github.openwebnet4j</groupId>
Copy link
Member

Choose a reason for hiding this comment

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

Suggested change
<groupId>com.github.openwebnet4j</groupId>
<groupId>openwebnet4j</groupId>

This should make it resolve from our Artifactory for now.

@mvalla
Copy link
Contributor

mvalla commented Mar 17, 2021

Thanks @kaikreuzer for hosting the artifact on OH Artifactory : it's a shame JCenter apparently is offline even before the planned date!

Only noticed now that you defined the group id to be com.github.openwebnet4j. Why this, this is not at Github library, is it? I strongly suggest to change the groupId because otherwise you'll anyhow not be allowed to bring it to Maven Central.

Actually the policy is:

you must choose a groupId for a domain that you own, or for which you are the designated maintainer on behalf of the owner. In the case of a GitHub groupId (io.github.username), this will be immediately verified provided your project URL matches the requested groupId.

that is why I used com.github.openwebnet4j in the first place and I also created the github group openwebnet4j to migrate in the future.

So to summarize: I will move to Maven Central keeping com.github.openwebnet4j but it takes time...

@kaikreuzer
Copy link
Member

that is why I used com.github.openwebnet4j in the first place

If you read carefully, it says that the groupId must be io.github.mvalla. Maven Central seems to be fine with using com instead of io as well, but as this is not specified in their guideline, I'd go for io, since this is what is used for Github pages (and hence it qualifies as a domain name that is under your control).

@kaikreuzer kaikreuzer added rebuild Triggers Jenkins PR build and removed rebuild Triggers Jenkins PR build labels Mar 18, 2021
@kaikreuzer
Copy link
Member

@mvalla I have uploaded version 0.4.0 to our Artifactory under the current groupId, so that it can now be resolved.
Please adapt the groupId for future releases, though.
The build now fails with spotless errors that you'll need to fix as it seems.

@mvalla
Copy link
Contributor

mvalla commented Mar 20, 2021

@mvalla I have uploaded version 0.4.0 to our Artifactory under the current groupId, so that it can now be resolved.
Please adapt the groupId for future releases, though.
The build now fails with spotless errors that you'll need to fix as it seems.

thanks @kaikreuzer for publishing under OH Artifactory with the current groupId: that is indeed the cleanest temporary solution.
JCenter is still returning 403 Forbidden (for past releases as well).
I will open a new ticket to publish via OSSRH to Maven Central with new groupId io.github.openwebnet4j.

I leave to @aconte80 the fixes for the spotless errors.

@kaikreuzer
Copy link
Member

I leave to @aconte80 the fixes for the spotless errors.

Ah, right, I didn't notice that this PR wasn't from you :-)

Signed-off-by: Conte Andrea <andrea@conte.com>
@aconte80
Copy link
Contributor Author

@kaikreuzer @fwolter I've fixed the spotless error.

Copy link
Member

@kaikreuzer kaikreuzer left a comment

Choose a reason for hiding this comment

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

Perfect, thank you all!

@kaikreuzer kaikreuzer merged commit 2e770a3 into openhab:main Mar 21, 2021
@wborn wborn added this to the 3.1 milestone Mar 21, 2021
@mvalla
Copy link
Contributor

mvalla commented Mar 27, 2021

@fwolter @wborn please add links to issues #10242 and #10188 that are closed by this PR

@wborn
Copy link
Member

wborn commented Mar 27, 2021

They are linked now @mvalla. :-)

@kaikreuzer kaikreuzer added the enhancement An enhancement or new feature for an existing add-on label Apr 2, 2021
themillhousegroup pushed a commit to themillhousegroup/openhab2-addons that referenced this pull request May 10, 2021
Signed-off-by: Andrea Conte <andrea@conte.com>
Signed-off-by: John Marshall <john.marshall.au@gmail.com>
computergeek1507 pushed a commit to computergeek1507/openhab-addons that referenced this pull request Jul 13, 2021
Signed-off-by: Andrea Conte <andrea@conte.com>
thinkingstone pushed a commit to thinkingstone/openhab-addons that referenced this pull request Nov 7, 2021
Signed-off-by: Andrea Conte <andrea@conte.com>
marcfischerboschio pushed a commit to bosch-io/openhab-addons that referenced this pull request May 5, 2022
Signed-off-by: Andrea Conte <andrea@conte.com>
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
Projects
None yet
5 participants