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

[orbitbhyve] Initial contribution #10426

Merged
merged 4 commits into from
Jul 31, 2021
Merged

Conversation

octa22
Copy link
Contributor

@octa22 octa22 commented Apr 1, 2021

This is the binding for Orbit Bhyve irrrigation systems.

Signed-off-by: Ondrej Pecta opecta@gmail.com

@octa22 octa22 added the new binding If someone has started to work on a binding. For a new binding PR. label Apr 1, 2021
@octa22 octa22 requested a review from a team as a code owner April 1, 2021 20:05
@octa22 octa22 force-pushed the orbitbhyve-binding branch 2 times, most recently from 0d212af to 049e457 Compare April 1, 2021 20:23
@octa22 octa22 added the rebuild Triggers Jenkins PR build label Apr 14, 2021
@Skinah Skinah removed the rebuild Triggers Jenkins PR build label Apr 24, 2021
@wborn wborn added the work in progress A PR that is not yet ready to be merged label Apr 24, 2021
@kubawolanin
Copy link

hey @octa22 do you happen to have a JAR for this binding for latest milestone build?
I do have a B-Hyve indoor sprinkler system and I'm willing to test your work on a real device if ready :)
Cheers

@octa22
Copy link
Contributor Author

octa22 commented Jun 27, 2021

Hi, here is the latest 3.2.0 SNAPSHOT. I'd be happy if you can test it.
https://www.dropbox.com/s/hpdxn1cjtn9xj0v/org.openhab.binding.orbitbhyve-3.2.0-SNAPSHOT.jar?dl=1
Ondrej

@kubawolanin
Copy link

kubawolanin commented Jun 29, 2021

Hi @octa22!

I've placed the JAR in my addons folder and added a Bridge manually.
For some reason the discovery did not kick in.

After adding a Bridge and immediately after a Sprinkler, I realized that I had a typo in the password field.
This resulted in the following errors after authentication:

 events.log - 2021-06-29 16:03:42.587 [INFO ] [ab.event.ThingStatusInfoChangedEvent] - Thing 'orbitbhyve:bridge:sprinklers' changed from OFFLINE (COMMUNICATION_ERROR) to OFFLINE (COMMUNICATION_ERROR): Cannot create websocket session
 events.log - 2021-06-29 16:03:42.587 [INFO ] [ab.event.ThingStatusInfoChangedEvent] - Thing 'orbitbhyve:bridge:sprinklers' changed from OFFLINE (COMMUNICATION_ERROR): Cannot create websocket session to ONLINE
 events.log - 2021-06-29 16:03:42.587 [INFO ] [ab.event.ThingStatusInfoChangedEvent] - Thing 'orbitbhyve:sprinkler:sprinklers:ddcd8f8b63' changed from OFFLINE (BRIDGE_OFFLINE) to ONLINE
 events.log - 2021-06-29 16:03:43.334 [INFO ] [ab.event.ThingStatusInfoChangedEvent] - Thing 'orbitbhyve:bridge:sprinklers' changed from ONLINE to OFFLINE (COMMUNICATION_ERROR): Cannot create websocket session
 events.log - 2021-06-29 16:03:43.334 [INFO ] [ab.event.ThingStatusInfoChangedEvent] - Thing 'orbitbhyve:bridge:sprinklers' changed from OFFLINE (COMMUNICATION_ERROR): Cannot create websocket session to OFFLINE (COMMUNICATION_ERROR): web socket creation error
 events.log - 2021-06-29 16:03:43.334 [INFO ] [ab.event.ThingStatusInfoChangedEvent] - Thing 'orbitbhyve:bridge:sprinklers' changed from OFFLINE (COMMUNICATION_ERROR): web socket creation error to OFFLINE (COMMUNICATION_ERROR): Returned status: 400
 events.log - 2021-06-29 16:03:43.506 [INFO ] [ab.event.ThingStatusInfoChangedEvent] - Thing 'orbitbhyve:bridge:sprinklers' changed from OFFLINE (COMMUNICATION_ERROR): Returned status: 400 to OFFLINE
 events.log - 2021-06-29 16:03:43.506 [INFO ] [ab.event.ThingStatusInfoChangedEvent] - Thing 'orbitbhyve:sprinkler:sprinklers:ddcd8f8b63' changed from ONLINE to OFFLINE (BRIDGE_OFFLINE)

Then every 30 seconds it returns 400 HTTP status:

 events.log - 2021-06-29 16:05:17.203 [INFO ] [ab.event.ThingStatusInfoChangedEvent] - Thing 'orbitbhyve:bridge:sprinklers' changed from OFFLINE (COMMUNICATION_ERROR): Returned status: 400 to ONLINE
 events.log - 2021-06-29 16:05:17.203 [INFO ] [ab.event.ThingStatusInfoChangedEvent] - Thing 'orbitbhyve:sprinkler:sprinklers:ddcd8f8b63' changed from OFFLINE (BRIDGE_OFFLINE) to ONLINE
 events.log - 2021-06-29 16:05:17.378 [INFO ] [ab.event.ThingStatusInfoChangedEvent] - Thing 'orbitbhyve:bridge:sprinklers' changed from ONLINE to OFFLINE (COMMUNICATION_ERROR): Returned status: 400
 events.log - 2021-06-29 16:05:17.746 [INFO ] [ab.event.ThingStatusInfoChangedEvent] - Thing 'orbitbhyve:sprinkler:sprinklers:ddcd8f8b63' changed from ONLINE to OFFLINE (BRIDGE_OFFLINE)

What I did after that was I completely removed all the created things and started over - this time making sure that my password was correct before I hit Save in the UI during Bridge thing creation.
Turned out to be successful:
image

After I waited for the bridge to become Online, I navigated to Inbox and then saw that discovery indeed works:
image

 events.log - 2021-06-29 16:10:20.746 [INFO ] [openhab.event.InboxRemovedEvent     ] - Discovery Result with UID 'orbitbhyve:sprinkler:16f92e4ed5:5f7759994f0c62a04bd24722' has been removed.
 events.log - 2021-06-29 16:10:20.747 [INFO ] [ab.event.ThingStatusInfoChangedEvent] - Thing 'orbitbhyve:sprinkler:16f92e4ed5:5f7759994f0c62a04bd24722' changed from UNINITIALIZED to INITIALIZING
 events.log - 2021-06-29 16:10:21.445 [INFO ] [ab.event.ThingStatusInfoChangedEvent] - Thing 'orbitbhyve:sprinkler:16f92e4ed5:5f7759994f0c62a04bd24722' changed from INITIALIZING to ONLINE

Controlling Smart Watering seem to work:

 events.log - 2021-06-29 16:11:54.528 [INFO ] [openhab.event.ItemStateChangedEvent ] - Item 'Sprinklers_IrrigationMode' changed from NULL to auto
 events.log - 2021-06-29 16:11:54.528 [INFO ] [openhab.event.ItemStateChangedEvent ] - Item 'Sprinklers_SprinklerStateControl' changed from NULL to ON
 events.log - 2021-06-29 16:11:54.529 [INFO ] [openhab.event.ItemStateChangedEvent ] - Item 'Sprinklers_NextWateringStartTime' changed from NULL to 1970-01-01T00:00:00.000-0400

I couldn't find a way to trigger manual watering yet.

Thank you Ondrej for your great work! 🎉

@octa22
Copy link
Contributor Author

octa22 commented Jun 29, 2021 via email

@octa22 octa22 force-pushed the orbitbhyve-binding branch 2 times, most recently from 0b0bc24 to e3d3fd1 Compare July 1, 2021 20:10
@octa22
Copy link
Contributor Author

octa22 commented Jul 1, 2021

Hello @kubawolanin,
indeed there were some compatibility issues with the OH3.
It should be fixed now. Please, can you download the jar again and let me know?
https://www.dropbox.com/s/hpdxn1cjtn9xj0v/org.openhab.binding.orbitbhyve-3.2.0-SNAPSHOT.jar?dl=1
All zones and programs should appear as new channels and you will be able to trigger the watering (a zone or a program)
Thanks.
Ondrej

@kubawolanin
Copy link

Hi @octa22

Re-added the things after installing the latest binding and it immediately found all my zones!
image

Manual watering works perfectly - here's a proof ;-)

image
image

Unfortunately I forgot to switch to TRACE when adding things but will test the binding for a few days.

Thank you for the great work!

@octa22 octa22 force-pushed the orbitbhyve-binding branch 2 times, most recently from f03fd38 to 905bec4 Compare July 9, 2021 16:46
@octa22
Copy link
Contributor Author

octa22 commented Jul 9, 2021

Hi @kubawolanin, thanks again for the testing. Very glad it works! May I ask what device are you using? I am finishing the documentation and I would like to include a list of tested devices so far.
Thank you!

@octa22 octa22 force-pushed the orbitbhyve-binding branch 4 times, most recently from 5023afe to 69399ef Compare July 9, 2021 22:24
Signed-off-by: Ondrej Pecta <opecta@gmail.com>
@kubawolanin
Copy link

It's B-Hyve Smart Indoor Timer @octa22

@octa22 octa22 changed the title [orbitbhyve][WIP] Initial contribution [orbitbhyve] Initial contribution Jul 12, 2021
@octa22
Copy link
Contributor Author

octa22 commented Jul 12, 2021

It's B-Hyve Smart Indoor Timer @octa22

Thanks. The same as mine. I guess the binding is ready for a review. @kubawolanin

@octa22 octa22 removed the work in progress A PR that is not yet ready to be merged label Jul 12, 2021
@fwolter fwolter removed the rebuild Triggers Jenkins PR build label Jul 17, 2021
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.

Thanks for your contribution! I reviewed your code and here is my feedback.

You need to add your binding to bom\openhab-addons\pom.xml.

Your binding doesn't build as it contains checkstyle errors. You could take a look at target/code-analysis/report.html after building it with mvn clean install.

There is also one compiler warning about a null value left.

@octa22 octa22 force-pushed the orbitbhyve-binding branch 3 times, most recently from 31b2dc1 to fa564bd Compare July 18, 2021 18:17
@octa22
Copy link
Contributor Author

octa22 commented Jul 18, 2021

Hi @fwolter,
thanks for the review. I guess I have addressed all your comments.
Checkstyle errors have been fixed and I have added the entry to bom\openhab-addons\pom.xml as well

@octa22 octa22 added rebuild Triggers Jenkins PR build and removed rebuild Triggers Jenkins PR build labels Jul 18, 2021
@octa22 octa22 force-pushed the orbitbhyve-binding branch 3 times, most recently from aac2ed9 to a5a6921 Compare July 18, 2021 21:20
Signed-off-by: Ondrej Pecta <opecta@gmail.com>
@octa22 octa22 added rebuild Triggers Jenkins PR build and removed rebuild Triggers Jenkins PR build labels Jul 27, 2021
Signed-off-by: Ondrej Pecta <opecta@gmail.com>
…ab/binding/orbitbhyve/internal/OrbitBhyveHandlerFactory.java


Signed-off-by: Fabian Wolter <github@fabian-wolter.de>
@fwolter fwolter merged commit 677804c into openhab:main Jul 31, 2021
@fwolter fwolter added this to the 3.2 milestone Jul 31, 2021
@fwolter
Copy link
Member

fwolter commented Jul 31, 2021

Congratulation! Now, you could add your binding's logo to the openHAB website. See https://next.openhab.org/docs/developer/bindings/#add-your-binding-s-logo-to-the-openhab-website

frederictobiasc pushed a commit to frederictobiasc/openhab-addons that referenced this pull request Oct 26, 2021
* [orbitbhyve] initial contribution

Signed-off-by: Ondrej Pecta <opecta@gmail.com>

* [orbitbhyve] improvements based on code review

Signed-off-by: Ondrej Pecta <opecta@gmail.com>

* [orbitbhyve] next bunch of fixes related to code review

Signed-off-by: Ondrej Pecta <opecta@gmail.com>

* Update bundles/org.openhab.binding.orbitbhyve/src/main/java/org/openhab/binding/orbitbhyve/internal/OrbitBhyveHandlerFactory.java

Signed-off-by: Fabian Wolter <github@fabian-wolter.de>

Co-authored-by: Fabian Wolter <github@fabian-wolter.de>
thinkingstone pushed a commit to thinkingstone/openhab-addons that referenced this pull request Nov 7, 2021
* [orbitbhyve] initial contribution

Signed-off-by: Ondrej Pecta <opecta@gmail.com>

* [orbitbhyve] improvements based on code review

Signed-off-by: Ondrej Pecta <opecta@gmail.com>

* [orbitbhyve] next bunch of fixes related to code review

Signed-off-by: Ondrej Pecta <opecta@gmail.com>

* Update bundles/org.openhab.binding.orbitbhyve/src/main/java/org/openhab/binding/orbitbhyve/internal/OrbitBhyveHandlerFactory.java

Signed-off-by: Fabian Wolter <github@fabian-wolter.de>

Co-authored-by: Fabian Wolter <github@fabian-wolter.de>
dschoepel pushed a commit to dschoepel/openhab-addons that referenced this pull request Nov 9, 2021
* [orbitbhyve] initial contribution

Signed-off-by: Ondrej Pecta <opecta@gmail.com>

* [orbitbhyve] improvements based on code review

Signed-off-by: Ondrej Pecta <opecta@gmail.com>

* [orbitbhyve] next bunch of fixes related to code review

Signed-off-by: Ondrej Pecta <opecta@gmail.com>

* Update bundles/org.openhab.binding.orbitbhyve/src/main/java/org/openhab/binding/orbitbhyve/internal/OrbitBhyveHandlerFactory.java

Signed-off-by: Fabian Wolter <github@fabian-wolter.de>

Co-authored-by: Fabian Wolter <github@fabian-wolter.de>
Signed-off-by: Dave J Schoepel <dave@theschoepels.com>
marcfischerboschio pushed a commit to bosch-io/openhab-addons that referenced this pull request May 5, 2022
* [orbitbhyve] initial contribution

Signed-off-by: Ondrej Pecta <opecta@gmail.com>

* [orbitbhyve] improvements based on code review

Signed-off-by: Ondrej Pecta <opecta@gmail.com>

* [orbitbhyve] next bunch of fixes related to code review

Signed-off-by: Ondrej Pecta <opecta@gmail.com>

* Update bundles/org.openhab.binding.orbitbhyve/src/main/java/org/openhab/binding/orbitbhyve/internal/OrbitBhyveHandlerFactory.java

Signed-off-by: Fabian Wolter <github@fabian-wolter.de>

Co-authored-by: Fabian Wolter <github@fabian-wolter.de>
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.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

5 participants