-
-
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
[energenie] oh1 migration #6461
Conversation
Travis tests were successfulHey @hmerk, |
...enie/src/main/java/org/openhab/binding/energenie/internal/config/EnergenieConfiguration.java
Outdated
Show resolved
Hide resolved
...energenie/src/main/java/org/openhab/binding/energenie/internal/handler/EnergenieHandler.java
Outdated
Show resolved
Hide resolved
...energenie/src/main/java/org/openhab/binding/energenie/internal/handler/EnergenieHandler.java
Outdated
Show resolved
Hide resolved
...rgenie/src/main/java/org/openhab/binding/energenie/internal/handler/EnergeniePWMHandler.java
Outdated
Show resolved
Hide resolved
...les/org.openhab.binding.energenie/src/main/resources/ESH-INF/i18n/energenie_xx_XX.properties
Outdated
Show resolved
Hide resolved
bundles/org.openhab.binding.energenie/src/main/resources/ESH-INF/thing/thing-types.xml
Outdated
Show resolved
Hide resolved
...rgenie/src/main/java/org/openhab/binding/energenie/internal/handler/EnergeniePWMHandler.java
Outdated
Show resolved
Hide resolved
...rgenie/src/main/java/org/openhab/binding/energenie/internal/handler/EnergeniePWMHandler.java
Outdated
Show resolved
Hide resolved
...rgenie/src/main/java/org/openhab/binding/energenie/internal/handler/EnergeniePWMHandler.java
Outdated
Show resolved
Hide resolved
...rgenie/src/main/java/org/openhab/binding/energenie/internal/handler/EnergeniePWMHandler.java
Outdated
Show resolved
Hide resolved
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've done a quick review. Didnt' catch everything. But this should you get started 😄
Thanks @Hilbrand for you first review comments. Will make the changes tomorrow. |
Travis tests were successfulHey @hmerk, |
2 similar comments
Travis tests were successfulHey @hmerk, |
Travis tests were successfulHey @hmerk, |
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.
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.
....energenie/src/main/java/org/openhab/binding/energenie/internal/EnergenieHandlerFactory.java
Outdated
Show resolved
Hide resolved
...enie/src/main/java/org/openhab/binding/energenie/internal/config/EnergenieConfiguration.java
Outdated
Show resolved
Hide resolved
bundles/org.openhab.binding.energenie/src/main/resources/ESH-INF/thing/thing-types.xml
Outdated
Show resolved
Hide resolved
bundles/org.openhab.binding.energenie/src/main/resources/ESH-INF/thing/thing-types.xml
Outdated
Show resolved
Hide resolved
...rgenie/src/main/java/org/openhab/binding/energenie/internal/handler/EnergeniePWMHandler.java
Outdated
Show resolved
Hide resolved
...energenie/src/main/java/org/openhab/binding/energenie/internal/handler/EnergenieHandler.java
Outdated
Show resolved
Hide resolved
bundles/org.openhab.binding.energenie/src/main/resources/ESH-INF/thing/thing-types.xml
Outdated
Show resolved
Hide resolved
Thanks @Hilbrand for your second review. I have included most of your change requests. |
Travis tests were successfulHey @hmerk, |
1 similar comment
Travis tests were successfulHey @hmerk, |
@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. |
Travis tests were successfulHey @hmerk, |
@Hilbrand thanks for your suggested changes, much appreciated. |
@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. I will check the code changes later today to see if I can find the issue.... |
@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] - 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. |
@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. |
Ah I see. Some leftover from my refactoring. The task should be passed to the |
Travis tests were successfulHey @hmerk, |
Signed-off-by: Hans-Jörg Merk <hans-joerg.merk@t-online.de>
Travis tests were successfulHey @hmerk, |
...ng.energenie/src/main/java/org/openhab/binding/energenie/internal/EnergenieProtocolEnum.java
Outdated
Show resolved
Hide resolved
Signed-off-by: Hans-Jörg Merk <hans-joerg.merk@t-online.de>
Travis tests were successfulHey @hmerk, |
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. Thanks for taking the time to migrate this!
@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. |
@armitagemderivitec
Should be merged soon and will be available in SNAPSHOT and 2.5.5 Release. |
@hmerk great thanks! |
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.
@hmerk, good job. Only some minor comments.
...rgenie/src/main/java/org/openhab/binding/energenie/internal/handler/EnergeniePWMHandler.java
Outdated
Show resolved
Hide resolved
Signed-off-by: Hans-Jörg Merk <hans-joerg.merk@t-online.de>
@J-N-K Thanks, but I have to give back the cudos to you, @Hilbrand and @cpmeister . |
Travis tests were successfulHey @hmerk, |
Signed-off-by: Hans-Jörg Merk <hans-joerg.merk@t-online.de>
Travis tests were successfulHey @hmerk, |
* [energenie] oh1 migration Signed-off-by: Hans-Jörg Merk <hans-joerg.merk@t-online.de> Co-authored-by: Hilbrand Bouwkamp <hilbrand@h72.nl>
* [energenie] oh1 migration Signed-off-by: Hans-Jörg Merk <hans-joerg.merk@t-online.de> Co-authored-by: Hilbrand Bouwkamp <hilbrand@h72.nl>
* [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>
* [energenie] oh1 migration Signed-off-by: Hans-Jörg Merk <hans-joerg.merk@t-online.de> Co-authored-by: Hilbrand Bouwkamp <hilbrand@h72.nl>
* [energenie] oh1 migration Signed-off-by: Hans-Jörg Merk <hans-joerg.merk@t-online.de> Co-authored-by: Hilbrand Bouwkamp <hilbrand@h72.nl>
* [energenie] oh1 migration Signed-off-by: Hans-Jörg Merk <hans-joerg.merk@t-online.de> Co-authored-by: Hilbrand Bouwkamp <hilbrand@h72.nl>
* [energenie] oh1 migration Signed-off-by: Hans-Jörg Merk <hans-joerg.merk@t-online.de> Co-authored-by: Hilbrand Bouwkamp <hilbrand@h72.nl>
* [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>
* [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: Hans-Jörg Merk hans-joerg.merk@t-online.de