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

[energenie] oh1 migration #6461

Merged
merged 22 commits into from
May 7, 2020
Merged

[energenie] oh1 migration #6461

merged 22 commits into from
May 7, 2020

Conversation

hmerk
Copy link
Contributor

@hmerk hmerk commented Nov 27, 2019

Signed-off-by: Hans-Jörg Merk hans-joerg.merk@t-online.de

@hmerk hmerk added new binding If someone has started to work on a binding. For a new binding PR. oh1 migration Relates to migrating an openHAB 1 addon to openHAB 2 labels Nov 27, 2019
@hmerk hmerk requested a review from a team as a code owner November 27, 2019 13:52
@TravisBuddy
Copy link

Travis tests were successful

Hey @hmerk,
we found no major flaws with your code. Still you might want to look at this logfile, as we usually suggest some optional improvements.

Copy link
Member

@Hilbrand Hilbrand left a comment

Choose a reason for hiding this comment

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

I've done a quick review. Didnt' catch everything. But this should you get started 😄

@hmerk
Copy link
Contributor Author

hmerk commented Nov 27, 2019

Thanks @Hilbrand for you first review comments. Will make the changes tomorrow.
According to default password, „1“ is indeed the factory default.

@TravisBuddy
Copy link

Travis tests were successful

Hey @hmerk,
we found no major flaws with your code. Still you might want to look at this logfile, as we usually suggest some optional improvements.

2 similar comments
@TravisBuddy
Copy link

Travis tests were successful

Hey @hmerk,
we found no major flaws with your code. Still you might want to look at this logfile, as we usually suggest some optional improvements.

@TravisBuddy
Copy link

Travis tests were successful

Hey @hmerk,
we found no major flaws with your code. Still you might want to look at this logfile, as we usually suggest some optional improvements.

@hmerk hmerk added rebuild Triggers Jenkins PR build and removed rebuild Triggers Jenkins PR build labels Nov 29, 2019
Copy link
Member

@Hilbrand Hilbrand left a comment

Choose a reason for hiding this comment

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

Ok here are some more comments. This covers most of the issues. Only comments left after that are related to the use of the Socket. If you're ok with it I can make the changes related to usage of Socket after you've updated from to my review.

Sorry to give you a hard time, while all you are doing is copying most of the original OH1 code 😉 This is something I expect will happen with other older bindings.

@hmerk
Copy link
Contributor Author

hmerk commented Nov 30, 2019

Thanks @Hilbrand for your second review. I have included most of your change requests.
According to the socket usage, your suggestion would be fine for me.
But I still don't understand how to add the identical channels to all devices without repeating them, cause that's what you asked for.
And don't worry gving me a hard time. Even better, I learn a lot from your valuable comments 👍

@TravisBuddy
Copy link

Travis tests were successful

Hey @hmerk,
we found no major flaws with your code. Still you might want to look at this logfile, as we usually suggest some optional improvements.

1 similar comment
@TravisBuddy
Copy link

Travis tests were successful

Hey @hmerk,
we found no major flaws with your code. Still you might want to look at this logfile, as we usually suggest some optional improvements.

@Hilbrand
Copy link
Member

@hmerk I've updated the code to move part of the code into it's own class. Apparently I have to much power 😄 I checkout out your branch and added a commit to this and then pushed. Which ended up directly to this pull request. Might not be a problem, but I expected it to want to create a branch in my own repository. So can you review my added commit and if possible test to see if I didn't broke anything.

@TravisBuddy
Copy link

Travis tests were successful

Hey @hmerk,
we found no major flaws with your code. Still you might want to look at this logfile, as we usually suggest some optional improvements.

@hmerk
Copy link
Contributor Author

hmerk commented Dec 18, 2019

@Hilbrand thanks for your suggested changes, much appreciated.
I will try to test the new version intensively before Christmas and provide feedback.

@hmerk
Copy link
Contributor Author

hmerk commented Dec 19, 2019

@Hilbrand I started testing the new oH3.0 Snapshot Version by copying the jar from jfrog into addons folder of a fresh oH2.5 Release VM.
Result: Configured Things won't get ONLINE:

image

I will check the code changes later today to see if I can find the issue....

@hmerk
Copy link
Contributor Author

hmerk commented Dec 19, 2019

@Hilbrand I enabled trace log and it seems that your code changes broke the solution calculation :-(

`
2019-12-19 07:24:27.506 [TRACE] [nie.internal.handler.EnergenieSocket] - EG responded with task (int) '[111, -1, -4, 124]' (hex) '6FFFFC7C'

2019-12-19 07:24:27.506 [TRACE] [nie.internal.handler.EnergenieSocket] - Solution '[0, 0, 0, 0]' send to EG

2019-12-19 07:24:27.517 [TRACE] [nie.internal.handler.EnergenieSocket] - Start Condition '[17]' send to EG

2019-12-19 07:24:27.519 [TRACE] [nie.internal.handler.EnergenieSocket] - EG responded with task (int) '[52, -86, 82, 65]' (hex) '34AA5241'

2019-12-19 07:24:27.520 [TRACE] [nie.internal.handler.EnergenieSocket] - Solution '[0, 0, 0, 0]' send to EG

2019-12-19 07:24:27.525 [TRACE] [nie.internal.handler.EnergenieSocket] - Start Condition '[17]' send to EG

2019-12-19 07:24:27.527 [TRACE] [nie.internal.handler.EnergenieSocket] - EG responded with task (int) '[-67, -81, 107, -54]' (hex) 'BDAF6BCA'

2019-12-19 07:24:27.528 [TRACE] [nie.internal.handler.EnergenieSocket] - Solution '[0, 0, 0, 0]' send to EG

2019-12-19 07:24:29.009 [DEBUG] [ie.internal.handler.EnergenieHandler] - Couldn't get I/O for the connection to: 192.168.0.130:5000.

2019-12-19 07:24:29.021 [DEBUG] [ie.internal.handler.EnergenieHandler] - Couldn't get I/O for the connection to: 192.168.0.132:5000.

2019-12-19 07:24:29.031 [DEBUG] [ie.internal.handler.EnergenieHandler] - Couldn't get I/O for the connection to: 192.168.0.130:5000.

2019-12-19 07:24:30.569 [DEBUG] [ie.internal.handler.EnergenieHandler] - Couldn't get I/O for the connection to: 192.168.0.131:5000.

2019-12-19 07:25:29.013 [TRACE] [nie.internal.handler.EnergenieSocket] - Start Condition '[17]' send to EG

2019-12-19 07:25:29.015 [TRACE] [nie.internal.handler.EnergenieSocket] - EG responded with task (int) '[87, 110, 40, 100]' (hex) '576E2864'

2019-12-19 07:25:29.015 [TRACE] [nie.internal.handler.EnergenieSocket] - Solution '[0, 0, 0, 0]' send to EG

2019-12-19 07:25:29.024 [TRACE] [nie.internal.handler.EnergenieSocket] - Start Condition '[17]' send to EG

2019-12-19 07:25:29.026 [TRACE] [nie.internal.handler.EnergenieSocket] - EG responded with task (int) '[-95, -102, 5, -82]' (hex) 'A19A05AE'

2019-12-19 07:25:29.027 [TRACE] [nie.internal.handler.EnergenieSocket] - Solution '[0, 0, 0, 0]' send to EG

2019-12-19 07:25:29.035 [TRACE] [nie.internal.handler.EnergenieSocket] - Start Condition '[17]' send to EG

2019-12-19 07:25:29.037 [TRACE] [nie.internal.handler.EnergenieSocket] - EG responded with task (int) '[-92, 24, 123, -79]' (hex) 'A4187BB1'

2019-12-19 07:25:29.038 [TRACE] [nie.internal.handler.EnergenieSocket] - Solution '[0, 0, 0, 0]' send to EG

2019-12-19 07:25:30.518 [DEBUG] [ie.internal.handler.EnergenieHandler] - Couldn't get I/O for the connection to: 192.168.0.130:5000.

2019-12-19 07:25:30.529 [DEBUG] [ie.internal.handler.EnergenieHandler] - Couldn't get I/O for the connection to: 192.168.0.132:5000.

2019-12-19 07:25:30.540 [DEBUG] [ie.internal.handler.EnergenieHandler] - Couldn't get I/O for the connection to: 192.168.0.130:5000.

2019-12-19 07:25:33.641 [DEBUG] [ie.internal.handler.EnergenieHandler] - Couldn't get I/O for the connection to: 192.168.0.131:5000.
`

@hmerk
Copy link
Contributor Author

hmerk commented Dec 19, 2019

@Hilbrand After a first quick check, the handler never uses socket.authorize() since your PR, therefore no task is retrieved and could be handled. According to the Data Exchange Protocol documentation, a task is just valid for 4 seconds. If no solution is received in this time, the device falls back to start condition. Therefore polling the device or handling a command always needs to authorize first.
I will try to solve this by providing a new commit.

@Hilbrand
Copy link
Member

Ah I see. Some leftover from my refactoring. The task should be passed to the calculateSolution method.

@TravisBuddy
Copy link

Travis tests were successful

Hey @hmerk,
we found no major flaws with your code. Still you might want to look at this logfile, as we usually suggest some optional improvements.

Signed-off-by: Hans-Jörg Merk <hans-joerg.merk@t-online.de>
@TravisBuddy
Copy link

Travis tests were successful

Hey @hmerk,
we found no major flaws with your code. Still you might want to look at this logfile, as we usually suggest some optional improvements.

Signed-off-by: Hans-Jörg Merk <hans-joerg.merk@t-online.de>
@TravisBuddy
Copy link

Travis tests were successful

Hey @hmerk,
we found no major flaws with your code. Still you might want to look at this logfile, as we usually suggest some optional improvements.

Copy link
Contributor

@cpmeister cpmeister left a comment

Choose a reason for hiding this comment

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

LGTM. Thanks for taking the time to migrate this!

@hmerk
Copy link
Contributor Author

hmerk commented May 6, 2020

@cpmeister Thanks for your patience and your valuable review comments.

@J-N-K @Hilbrand Could we get your approval as well as all comments have been adressed and the Binding is working in my environment. Travis and Jenkins are fine as well.

@hmerk
Copy link
Contributor Author

hmerk commented May 6, 2020

@armitagemderivitec

Very much looking forward to this integration. Is there any news?

Should be merged soon and will be available in SNAPSHOT and 2.5.5 Release.

@Hilbrand Hilbrand requested a review from J-N-K May 6, 2020 09:50
@m17kea
Copy link

m17kea commented May 6, 2020

@hmerk great thanks!

Copy link
Member

@J-N-K J-N-K left a comment

Choose a reason for hiding this comment

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

@hmerk, good job. Only some minor comments.

Signed-off-by: Hans-Jörg Merk <hans-joerg.merk@t-online.de>
@hmerk
Copy link
Contributor Author

hmerk commented May 7, 2020

@J-N-K Thanks, but I have to give back the cudos to you, @Hilbrand and @cpmeister .
Without all your outstanding support, this would not have been possible.

@TravisBuddy
Copy link

Travis tests were successful

Hey @hmerk,
we found no major flaws with your code. Still you might want to look at this logfile, as we usually suggest some optional improvements.

Signed-off-by: Hans-Jörg Merk <hans-joerg.merk@t-online.de>
@TravisBuddy
Copy link

Travis tests were successful

Hey @hmerk,
we found no major flaws with your code. Still you might want to look at this logfile, as we usually suggest some optional improvements.

@J-N-K J-N-K merged commit c8b7bbe into openhab:2.5.x May 7, 2020
@J-N-K J-N-K added this to the 2.5.5 milestone May 7, 2020
@hmerk hmerk deleted the energenie_migration branch May 7, 2020 18:06
LoungeFlyZ pushed a commit to LoungeFlyZ/openhab2-addons that referenced this pull request Jun 8, 2020
* [energenie] oh1 migration

Signed-off-by: Hans-Jörg Merk <hans-joerg.merk@t-online.de>
Co-authored-by: Hilbrand Bouwkamp <hilbrand@h72.nl>
J-N-K pushed a commit to J-N-K/openhab-addons that referenced this pull request Jul 14, 2020
* [energenie] oh1 migration

Signed-off-by: Hans-Jörg Merk <hans-joerg.merk@t-online.de>
Co-authored-by: Hilbrand Bouwkamp <hilbrand@h72.nl>
CSchlipp pushed a commit to CSchlipp/openhab-addons that referenced this pull request Jul 26, 2020
* [energenie] oh1 migration

Signed-off-by: Hans-Jörg Merk <hans-joerg.merk@t-online.de>
Co-authored-by: Hilbrand Bouwkamp <hilbrand@h72.nl>
Signed-off-by: CSchlipp <christian@schlipp.de>
andrewfg pushed a commit to andrewfg/openhab-addons that referenced this pull request Aug 31, 2020
* [energenie] oh1 migration

Signed-off-by: Hans-Jörg Merk <hans-joerg.merk@t-online.de>
Co-authored-by: Hilbrand Bouwkamp <hilbrand@h72.nl>
andrewfg pushed a commit to andrewfg/openhab-addons that referenced this pull request Aug 31, 2020
* [energenie] oh1 migration

Signed-off-by: Hans-Jörg Merk <hans-joerg.merk@t-online.de>
Co-authored-by: Hilbrand Bouwkamp <hilbrand@h72.nl>
andrewfg pushed a commit to andrewfg/openhab-addons that referenced this pull request Aug 31, 2020
* [energenie] oh1 migration

Signed-off-by: Hans-Jörg Merk <hans-joerg.merk@t-online.de>
Co-authored-by: Hilbrand Bouwkamp <hilbrand@h72.nl>
andrewfg pushed a commit to andrewfg/openhab-addons that referenced this pull request Aug 31, 2020
* [energenie] oh1 migration

Signed-off-by: Hans-Jörg Merk <hans-joerg.merk@t-online.de>
Co-authored-by: Hilbrand Bouwkamp <hilbrand@h72.nl>
DaanMeijer pushed a commit to DaanMeijer/openhab-addons that referenced this pull request Sep 1, 2020
* [energenie] oh1 migration

Signed-off-by: Hans-Jörg Merk <hans-joerg.merk@t-online.de>
Co-authored-by: Hilbrand Bouwkamp <hilbrand@h72.nl>
Signed-off-by: Daan Meijer <daan@studioseptember.nl>
markus7017 pushed a commit to markus7017/openhab-addons that referenced this pull request Sep 19, 2020
* [energenie] oh1 migration

Signed-off-by: Hans-Jörg Merk <hans-joerg.merk@t-online.de>
Co-authored-by: Hilbrand Bouwkamp <hilbrand@h72.nl>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
new binding If someone has started to work on a binding. For a new binding PR. oh1 migration Relates to migrating an openHAB 1 addon to openHAB 2
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants