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

[opensprinkler] Offline detection does not work reliably #8942

Closed
eikowagenknecht opened this issue Nov 2, 2020 · 6 comments · Fixed by #9869
Closed

[opensprinkler] Offline detection does not work reliably #8942

eikowagenknecht opened this issue Nov 2, 2020 · 6 comments · Fixed by #9869
Assignees
Labels
bug An unexpected problem or unintended behavior of an add-on

Comments

@eikowagenknecht
Copy link
Contributor

eikowagenknecht commented Nov 2, 2020

Your Environment

  • Version used: openHAB, current version 2.5.10
  • OpenSprinkler on another Raspberry Pi (3b)

4 Things in openHAB:

  • OpenSprinkler HTTP Interface
  • Station 1
  • Station 2
  • Station 3

Expected Behavior

When the OpenSprinkler is offline (e.g. network cable on the Raspberry is pulled where OpenSprinkler is installed), openHAB should reflect this correctly in Things status (after a while).

Current Behavior

When I disconnect the OpenSprinkler Pi, the following happens:

  • Station 1 shows as offline, logged 8 times (2020-11-02 14:31:12.460 [hingStatusInfoChangedEvent] - 'opensprinkler:station:2a99e487' changed from ONLINE to OFFLINE (COMMUNICATION_ERROR): Could not get the station channel 2 current state from the OpenSprinkler thing. Error: There was a problem in the HTTP communication with the OpenSprinkler API: Request to OpenSprinkler device failed: java.net.SocketTimeoutException: Connect Timeout)
  • Station 1 shows as ONLINE again, logged 1 time
  • Station 2 shows as offline, logged 8 times
  • Station 2 shows as ONLINE again, logged 1 time
  • Station 3 shows as offline, logged 8 times
  • Station 3 shows as ONLINE again, logged 1 time
  • Then all station remain in ONLINE state

All the time the HTTP Interface is in ONLINE state

Only after disabling / reenabling the thing the HTTP interface goes to OFFLINE - COMMUNIATION_ERROR and the Stations to INITIALIZING (I would also have expected OFFLINE (BRIDGE_OFFLINE) here according to https://www.openhab.org/docs/concepts/things.html).

Possible Solution

Correctly show offline status. When The Pi is not reachable, all things should be OFFLINE.

Steps to Reproduce (for Bugs)

  1. Setup OpenSprinkler
  2. Shutdown OpenSprinkler or remove network cable

Context

I'm using the Thing state for detection when something goes wrong and with most other bindings this works fine, sending me an email after 1 Minute continuous downtime. But not here. If my OpenSprinkler Pi failed (like it did some days ago) I would not notice it and my garden would be too dry.

@eikowagenknecht eikowagenknecht added the bug An unexpected problem or unintended behavior of an add-on label Nov 2, 2020
@Skinah Skinah self-assigned this Dec 5, 2020
@Skinah
Copy link
Contributor

Skinah commented Dec 5, 2020

I can take a look into this when my unit arrives in a few weeks time.

@Skinah
Copy link
Contributor

Skinah commented Jan 12, 2021

I have the non PI version based on esp8266 and I can reproduce this here. Just need some time to get used to the API and the binding before making changes.

@eikowagenknecht
Copy link
Contributor Author

Thank you for looking into this @Skinah !

@Skinah
Copy link
Contributor

Skinah commented Jan 16, 2021

Try this build to see if it works and if any new bugs have cropped up.

http://www.pcmus.com/openhab/opensprinkler/

@eikowagenknecht
Copy link
Contributor Author

I'm not on openHAB 3 yet and currently have some hardware issues with my openSprinkler, so it will take some time before I can test this. Thank you again for the fix!

@eikowagenknecht
Copy link
Contributor Author

I just wanted to test this, but it seems it's not compatible with my OH version?

2021-05-20 20:33:32.386 [WARN ] [org.apache.felix.fileinstall        ] - Error while starting bundle: file:/usr/share/openhab/addons/org.openhab.binding.opensprinkler-3.1.0-SNAPSHOT.jar
org.osgi.framework.BundleException: Could not resolve module: org.openhab.binding.opensprinkler [82]
  Unresolved requirement: Import-Package: org.openhab.core.config.core
	at org.eclipse.osgi.container.Module.start(Module.java:444) ~[org.eclipse.osgi-3.12.100.jar:?]
	at org.eclipse.osgi.internal.framework.EquinoxBundle.start(EquinoxBundle.java:383) ~[org.eclipse.osgi-3.12.100.jar:?]
	at org.apache.felix.fileinstall.internal.DirectoryWatcher.startBundle(DirectoryWatcher.java:1260) [bundleFile:3.6.4]
	at org.apache.felix.fileinstall.internal.DirectoryWatcher.startBundles(DirectoryWatcher.java:1233) [bundleFile:3.6.4]
	at org.apache.felix.fileinstall.internal.DirectoryWatcher.doProcess(DirectoryWatcher.java:520) [bundleFile:3.6.4]
	at org.apache.felix.fileinstall.internal.DirectoryWatcher.process(DirectoryWatcher.java:365) [bundleFile:3.6.4]
	at org.apache.felix.fileinstall.internal.DirectoryWatcher.run(DirectoryWatcher.java:316) [bundleFile:3.6.4]

I'm currently on 3.0.2.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug An unexpected problem or unintended behavior of an add-on
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants