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

[hydrawise] Stuck in Initializing phase #7261

Closed
petervargait opened this issue Mar 31, 2020 · 109 comments · Fixed by #10947
Closed

[hydrawise] Stuck in Initializing phase #7261

petervargait opened this issue Mar 31, 2020 · 109 comments · Fixed by #10947
Assignees
Labels
bug An unexpected problem or unintended behavior of an add-on

Comments

@petervargait
Copy link

HI, I have openHAB 2.5 on Raspbian, my hydrawise binding added successfully, however when I add a Thing HydraWise Cloud it stucks in Initializing status. I have checked the API key and it works, nothing shows up in the logs

@petervargait petervargait added the bug An unexpected problem or unintended behavior of an add-on label Mar 31, 2020
@petervargait
Copy link
Author

petervargait commented Mar 31, 2020

I have found the error in the log it only appears when I restart the bundle

19:25:46.440 [WARN ] [ommon.WrappedScheduledExecutorService] - Scheduled runnable ended with an exception: 
java.lang.NullPointerException: null
	at org.openhab.binding.hydrawise.internal.HydrawiseCloudHandler.pollController(HydrawiseCloudHandler.java:130) ~[?:?]
	at org.openhab.binding.hydrawise.internal.HydrawiseHandler.pollControllerInternal(HydrawiseHandler.java:311) ~[?:?]
	at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511) ~[?:1.8.0_152]
	at java.util.concurrent.FutureTask.runAndReset(FutureTask.java:308) ~[?:1.8.0_152]
	at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.access$301(ScheduledThreadPoolExecutor.java:180) ~[?:1.8.0_152]
	at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.run(ScheduledThreadPoolExecutor.java:294) ~[?:1.8.0_152]
	at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149) [?:1.8.0_152]
	at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624) [?:1.8.0_152]
	at java.lang.Thread.run(Thread.java:748) [?:1.8.0_152]

It looks to me that customerdetails gives back the info but some items are not in the expected format might be status. Here is my response from API ( https://app.hydrawise.com/api/v1/customerdetails.php?api_key=myAPIKey&type=controllers) )

{"controller_id":111297,"customer_id":98556,"current_controller":"Hunter Hydreawise","controllers":[{"name":"Hunter Hydreawise","last_contact":1585666199,"serial_number":"05fbb717","controller_id":111297,"status":"All good!"}]}

@digitaldan
Copy link
Contributor

Hi, thanks for the report and the sample response, that helps confirm the issue. I have noticed too, it looks like they slightly changed the api, i have a fix i have been testing locally, but totally forgot to get this committed. I'll do that soon.

@digitaldan digitaldan self-assigned this Mar 31, 2020
digitaldan added a commit to digitaldan/openhab-addons that referenced this issue Mar 31, 2020
Fixes a NPE due to a change in the Hydrawise API, adds additional controller statuses as a channles.

Signed-off-by: digitaldan <dan@digitaldan.com>
@cpmeister cpmeister linked a pull request Apr 2, 2020 that will close this issue
@DenDeXTeR51
Copy link

Hi!

  1. HydraWise binding is not working in 2.5.3(same error @petervargait )

  2. They changed API(last year's API was better…) As i understand some information now is only available via GraphQL & OAuth2.0 and limited data via REST.

URL for new api - https://support.hydrawise.com/hc/en-us/articles/360008965753-Hydrawise-API-Information

  1. Also they implement "refresh windows", now you cannot just update every 30 second. There is parameter in json (time for next request)

"Rate Limiting
Access to this API is rate limited. The statusschedule.php request has a field called nextpoll that indicates when the next API query should be made. Queries over this rate may be rejected with an HTTP 429 status code."

@Clifford-Foster
Copy link

Clifford-Foster commented Apr 22, 2020

I can confirm that this error persists.

21:08:45.665 [WARN ] [mmon.WrappedScheduledExecutorService] - Scheduled runnable ended with an exception:
java.lang.NullPointerException: null
	at org.openhab.binding.hydrawise.internal.HydrawiseCloudHandler.pollController(HydrawiseCloudHandler.java:127) ~[?:?]
	at org.openhab.binding.hydrawise.internal.HydrawiseHandler.pollControllerInternal(HydrawiseHandler.java:310) ~[?:?]
	at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511) ~[?:1.8.0_232]
	at java.util.concurrent.FutureTask.runAndReset(FutureTask.java:308) ~[?:1.8.0_232]
	at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.access$301(ScheduledThreadPoolExecutor.java:180) ~[?:1.8.0_232]
	at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.run(ScheduledThreadPoolExecutor.java:294) ~[?:1.8.0_232]
	at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149) [?:1.8.0_232]
	at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624) [?:1.8.0_232]
	at java.lang.Thread.run(Thread.java:748) [?:1.8.0_232]

@digitaldan
Copy link
Contributor

I will no longer be using the API listed above, they ended up removing quite a bit of functionality.

I have a working version based on their GraphQL api, which is what the mobile and web clients use.

There will be some changes to how you long in, the API key will no longer be used, instead you will enter your user name and password, and the binding will retrieve a OAuth access and refresh token to log in with, it will then delete your password so we do not need to store that beyond the first login.

The other change will be the thing structure will now include an "account" bridge, so items will have a different structure which will include the bridge type , but channels will remain the same, so hopefully this will be a search and replace operation to migrate

Normally i would try to maintain backwards compatibility, but my guess is there are less than a dozen people using the binding, so i think now is the right time to make clean break and do this the right way.

@digitaldan
Copy link
Contributor

Update: I have a version of this working against the new API, I just need to clean up a few things and update documentation. I'm hoping to have a test version today or tomorrow if anyone wants to help test it.

@petervargait
Copy link
Author

petervargait commented May 5, 2020 via email

@giterest
Copy link

giterest commented May 5, 2020

Hi Dan,
if you need testing, drop me a line!

Chris

@DenDeXTeR51
Copy link

DenDeXTeR51 commented May 5, 2020 via email

@dgebhardt
Copy link

HI @digitaldan, would also be happy to help testing!

Best,
David

@digitaldan
Copy link
Contributor

Hi guys, i have a new jar at
https://github.com/digitaldan/openhab2-addons/releases/tag/2.5.x-hydrawise-1.0

I crudely updated the readme with the new "Account bridge" section, see

https://github.com/digitaldan/openhab2-addons/blob/hydrawise-api-change/bundles/org.openhab.binding.hydrawise/README.md

I still have a bunch of clean up work todo and testing, not to mention documentation, but the binding seems to be working and stable.

I'm listing detailed install instructions, but the short version is you will

  1. Delete your existing Cloud thing
  2. Remove the existing binding
  3. Install the new binding
  4. In the paperUI install the "account" thing and configure it with your user name and password
  5. In the paperUI add the auto discovered controller thing from the inbox
  6. Updated your items file by doing a single find and replace (if using a items file)

For this new binding you will want to delete your cloud controller thing FIRST, then uninstall the current binding. Then install this new Jar (drop into your addons folder, or use the karaf console to install)

Once installed, in the PaperUI under the "Things" section add a new thing:
image

Then select the Hydrawise binding:

image

Then select "Add Manually" and select "Account Thing"

In the next screen, name the account thing, in the readme i use "myaccount" , but name it anything you want:

image

also enter your account username and password. The password will only be retained while the binding attempts to connect, unless the option to save it is enabled. One a successful connection is made we store an oAuth token for future use.

Your Inbox should now have your controller listed, or multiple controllers if you have more then one on your account. Go ahead and add it. Take a look at its ID (also shown under its channels). You will need it to update your items file below.

To use existing items you have in a file , it's a simple find and replace job. For example:

{channel="hydrawise:cloud:home:forecast1#temperaturehigh}

becomes

{channel="hydrawise:controller:myaccount:123456:forecast1#temperaturehigh"}

where 123456 is the id of the controller (look in the paperUI) and "myaccount" is whatever you name your account thing. All i did was find hydrawise:cloud:home and replaced with hydrawise:controller:myaccount:123456

@giterest
Copy link

giterest commented May 6, 2020

Hi @digitaldan,

I've got two different systems;
LIVE - Debian Buster, Zulu-8, openHAB latest stable, various bindings, other services
TEST - Debian Buster, Zulu-8, openHAB latest stable, ONLY(!) Hydrawise binding

Edit 1 (TEST/LIVE):
Task: testing your binding in both LIVE and TEST system.
Result: unfortunately I got an error in both my live-system and test environment.

openhab.log of TEST:

2020-05-06 08:05:27.203 [WARN ] [mmon.WrappedScheduledExecutorService] - Scheduled runnable ended with an exception: 
java.lang.NullPointerException: null
        at org.openhab.binding.hydrawise.internal.HydrawiseAccountHandler.authTokenUpdated(HydrawiseAccountHandler.java:164) ~[?:?]
        at org.openhab.binding.hydrawise.internal.HydrawiseAccountHandler.configure(HydrawiseAccountHandler.java:96) ~[?:?]
        at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511) ~[?:1.8.0_252]
        at java.util.concurrent.FutureTask.run(FutureTask.java:266) ~[?:1.8.0_252]
        at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.access$201(ScheduledThreadPoolExecutor.java:180) ~[?:1.8.0_252]
        at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.run(ScheduledThreadPoolExecutor.java:293) ~[?:1.8.0_252]
        at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149) [?:1.8.0_252]
        at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624) [?:1.8.0_252]
        at java.lang.Thread.run(Thread.java:748) [?:1.8.0_252]

Edit 2 (TEST):
Task: trying different passwords (varying in different lenghts, w/o symbols, ...)
Result: got it working after removing a special char from the password "^"

Edit 3 (LIVE):
Task: now trying to "migrate" to LIVE
Result: unfortunately I got an error.

openhab.log of LIVE:

2020-05-06 08:34:28.016 [ERROR] [core.thing.internal.ThingManagerImpl] - Exception occurred while initializing handler of thing 'hydrawise:account:8f633696': Task java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask@5bd37477 rejected from org.eclipse.smarthome.core.internal.common.WrappedScheduledExecutorService@762f8bd7[Shutting down, pool size = 1, active threads = 0, queued tasks = 19, completed tasks = 39324]
java.util.concurrent.RejectedExecutionException: Task java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask@5bd37477 rejected from org.eclipse.smarthome.core.internal.common.WrappedScheduledExecutorService@762f8bd7[Shutting down, pool size = 1, active threads = 0, queued tasks = 19, completed tasks = 39324]
        at java.util.concurrent.ThreadPoolExecutor$AbortPolicy.rejectedExecution(ThreadPoolExecutor.java:2063) ~[?:1.8.0_252]
        at java.util.concurrent.ThreadPoolExecutor.reject(ThreadPoolExecutor.java:830) ~[?:1.8.0_252]
        at java.util.concurrent.ScheduledThreadPoolExecutor.delayedExecute(ScheduledThreadPoolExecutor.java:326) ~[?:1.8.0_252]
        at java.util.concurrent.ScheduledThreadPoolExecutor.schedule(ScheduledThreadPoolExecutor.java:533) ~[?:1.8.0_252]
        at org.openhab.binding.hydrawise.internal.HydrawiseAccountHandler.initialize(HydrawiseAccountHandler.java:57) ~[?:?]
        at sun.reflect.GeneratedMethodAccessor76.invoke(Unknown Source) ~[?:?]
        at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) ~[?:1.8.0_252]
        at java.lang.reflect.Method.invoke(Method.java:498) ~[?:1.8.0_252]
        at org.eclipse.smarthome.core.internal.common.AbstractInvocationHandler.invokeDirect(AbstractInvocationHandler.java:152) [bundleFile:?]
        at org.eclipse.smarthome.core.internal.common.Invocation.call(Invocation.java:52) [bundleFile:?]
        at java.util.concurrent.FutureTask.run(FutureTask.java:266) [?:1.8.0_252]
        at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149) [?:1.8.0_252]
        at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624) [?:1.8.0_252]
        at java.lang.Thread.run(Thread.java:748) [?:1.8.0_252]

Edit 4 (LIVE):
Task: restarting openHAB2 on LIVE
Result: After an openHAB service restart the Hydrawise binding is listed in the thing configuration, but there are no further options (account, cloud, local).

According to KARAF, the Hydrawise-binding is running;
290 │ Active │ 80 │ 2.5.4.202005060354 │ openHAB Add-ons :: Bundles :: Hydrawise Binding

Edit 5 (LIVE):
Task: change owner of org.openhab.binding.hydrawise-2.5.4-SNAPSHOT.jar to obenhab / restarting binding out of KARAF afterwards
Result: after a "bundle:restart 290" in KARAF, the manual thing configuration showed further options again (account, cloud, local).

Edit 6 (LIVE):
Task: trying to add the Hydrawise Account thing and finish thing configuration
Result: successfully added the account without any errors, but when adding the controller from the inbox there is a DateTimeParseException thrown;

First off, the inbox log;
2020-05-06 09:12:19.550 [INFO ] [g.discovery.internal.PersistentInbox] - Added new thing 'hydrawise:controller:4466de28:XXXXXX' to inbox.

After adding from inbox;

2020-05-06 09:13:18.913 [ERROR] [nal.common.AbstractInvocationHandler] - An error occurred while calling method 'ThingHandler.initialize()' on 'org.openhab.binding.hydrawise.internal.HydrawiseControllerHandler@1a1f57a5': Text 'Wed, 06 May 20 00:00:00 +0200' could not be parsed at index 0
java.time.format.DateTimeParseException: Text 'Wed, 06 May 20 00:00:00 +0200' could not be parsed at index 0
        at java.time.format.DateTimeFormatter.parseResolved0(DateTimeFormatter.java:1949) ~[?:1.8.0_252]
        at java.time.format.DateTimeFormatter.parse(DateTimeFormatter.java:1851) ~[?:1.8.0_252]
        at java.time.ZonedDateTime.parse(ZonedDateTime.java:597) ~[?:1.8.0_252]
        at org.openhab.binding.hydrawise.internal.HydrawiseControllerHandler.stringToDateTime(HydrawiseControllerHandler.java:360) ~[?:?]
        at org.openhab.binding.hydrawise.internal.HydrawiseControllerHandler.updateForecast(HydrawiseControllerHandler.java:308) ~[?:?]
        at org.openhab.binding.hydrawise.internal.HydrawiseControllerHandler.lambda$1(HydrawiseControllerHandler.java:226) ~[?:?]
        at java.util.Optional.ifPresent(Optional.java:159) ~[?:1.8.0_252]
        at org.openhab.binding.hydrawise.internal.HydrawiseControllerHandler.onData(HydrawiseControllerHandler.java:219) ~[?:?]
        at org.openhab.binding.hydrawise.internal.HydrawiseAccountHandler.addControllerListeners(HydrawiseAccountHandler.java:70) ~[?:?]
        at org.openhab.binding.hydrawise.internal.HydrawiseControllerHandler.initialize(HydrawiseControllerHandler.java:97) ~[?:?]
        at sun.reflect.GeneratedMethodAccessor76.invoke(Unknown Source) ~[?:?]
        at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) ~[?:1.8.0_252]
        at java.lang.reflect.Method.invoke(Method.java:498) ~[?:1.8.0_252]
        at org.eclipse.smarthome.core.internal.common.AbstractInvocationHandler.invokeDirect(AbstractInvocationHandler.java:152) [bundleFile:?]
        at org.eclipse.smarthome.core.internal.common.Invocation.call(Invocation.java:52) [bundleFile:?]
        at java.util.concurrent.FutureTask.run(FutureTask.java:266) [?:1.8.0_252]
        at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149) [?:1.8.0_252]
        at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624) [?:1.8.0_252]
        at java.lang.Thread.run(Thread.java:748) [?:1.8.0_252]
2020-05-06 09:13:18.931 [ERROR] [core.thing.internal.ThingManagerImpl] - Exception occurred while initializing handler of thing 'hydrawise:controller:4466de28:XXXXXX': Text 'Wed, 06 May 20 00:00:00 +0200' could not be parsed at index 0
java.time.format.DateTimeParseException: Text 'Wed, 06 May 20 00:00:00 +0200' could not be parsed at index 0
        at java.time.format.DateTimeFormatter.parseResolved0(DateTimeFormatter.java:1949) ~[?:1.8.0_252]
        at java.time.format.DateTimeFormatter.parse(DateTimeFormatter.java:1851) ~[?:1.8.0_252]
        at java.time.ZonedDateTime.parse(ZonedDateTime.java:597) ~[?:1.8.0_252]
        at org.openhab.binding.hydrawise.internal.HydrawiseControllerHandler.stringToDateTime(HydrawiseControllerHandler.java:360) ~[?:?]
        at org.openhab.binding.hydrawise.internal.HydrawiseControllerHandler.updateForecast(HydrawiseControllerHandler.java:308) ~[?:?]
        at org.openhab.binding.hydrawise.internal.HydrawiseControllerHandler.lambda$1(HydrawiseControllerHandler.java:226) ~[?:?]
        at java.util.Optional.ifPresent(Optional.java:159) ~[?:1.8.0_252]
        at org.openhab.binding.hydrawise.internal.HydrawiseControllerHandler.onData(HydrawiseControllerHandler.java:219) ~[?:?]
        at org.openhab.binding.hydrawise.internal.HydrawiseAccountHandler.addControllerListeners(HydrawiseAccountHandler.java:70) ~[?:?]
        at org.openhab.binding.hydrawise.internal.HydrawiseControllerHandler.initialize(HydrawiseControllerHandler.java:97) ~[?:?]
        at sun.reflect.GeneratedMethodAccessor76.invoke(Unknown Source) ~[?:?]
        at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) ~[?:1.8.0_252]
        at java.lang.reflect.Method.invoke(Method.java:498) ~[?:1.8.0_252]
        at org.eclipse.smarthome.core.internal.common.AbstractInvocationHandler.invokeDirect(AbstractInvocationHandler.java:152) [bundleFile:?]
        at org.eclipse.smarthome.core.internal.common.Invocation.call(Invocation.java:52) [bundleFile:?]
        at java.util.concurrent.FutureTask.run(FutureTask.java:266) [?:1.8.0_252]
        at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149) [?:1.8.0_252]
        at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624) [?:1.8.0_252]
        at java.lang.Thread.run(Thread.java:748) [?:1.8.0_252]

@digitaldan
Copy link
Contributor

Thanks @giterest ! i'll take a look. Your last error is strange, its breaking on trying to parse the time string for the weather forecast, what is strange is that it works on my system, the only difference is that my offset is -7 where yours is +2 , I'll try and reproduce that today.

The other errors look like they stem from an issue with handling the passcode? possibly b/c a symbol in it ? Let me see if i need to be escaping that string before sending to the http client, although we should never be allowing a null pointer error, so that is also a bug.

@dgebhardt
Copy link

Hi @digitaldan !
Thanks for sharing the snapshot. I installed it, restarted the openHAB service and then added account thing and also a controller (which was discovered automatically). I also checked to add an item to items file and the sitemap and was able to start and stop a "run" of zone1.

So initial feedback: works well!

Will start now to integrate it more into my home automation setup (all zones, ...) and let you know once I have additional feedback.

Once again, so thankful for you work!

David

@dgebhardt
Copy link

First addition:
Seems like the connection to the Hydrawise servers is shaky. The bridge is switching between online and offline quite a bit.

2020-05-06 16:25:22.445 [hingStatusInfoChangedEvent] - 'hydrawise:account:ff94af04' changed from ONLINE to OFFLINE (COMMUNICATION_ERROR): java.util.concurrent.ExecutionException: java.io.EOFException: HttpConnectionOverHTTP@195fac0::DecryptedEndPoint@1a56a22{app.hydrawise.com/52.41.248.73:443<->/192.168.1.39:52810,OPEN,fill=-,flush=-,to=60216/0}

2020-05-06 16:25:22.448 [hingStatusInfoChangedEvent] - 'hydrawise:controller:ff94af04:307177' changed from ONLINE to OFFLINE (BRIDGE_OFFLINE)

2020-05-06 16:26:23.560 [hingStatusInfoChangedEvent] - 'hydrawise:account:ff94af04' changed from OFFLINE (COMMUNICATION_ERROR): java.util.concurrent.ExecutionException: java.io.EOFException: HttpConnectionOverHTTP@195fac0::DecryptedEndPoint@1a56a22{app.hydrawise.com/52.41.248.73:443<->/192.168.1.39:52810,OPEN,fill=-,flush=-,to=60216/0} to ONLINE

2020-05-06 16:26:23.564 [hingStatusInfoChangedEvent] - 'hydrawise:controller:ff94af04:307177' changed from OFFLINE (BRIDGE_OFFLINE) to ONLINE

2020-05-06 16:31:52.554 [.ItemChannelLinkAddedEvent] - Link 'Zone1_Summary-hydrawise:controller:ff94af04:307177:zone1#summary' has been added.

2020-05-06 16:34:26.432 [hingStatusInfoChangedEvent] - 'hydrawise:account:ff94af04' changed from ONLINE to OFFLINE (COMMUNICATION_ERROR): java.util.concurrent.ExecutionException: java.io.EOFException: HttpConnectionOverHTTP@50a5bd::DecryptedEndPoint@1e3b0d{app.hydrawise.com/52.41.248.73:443<->/192.168.1.39:52926,OPEN,fill=-,flush=-,to=60245/0}

2020-05-06 16:34:26.439 [hingStatusInfoChangedEvent] - 'hydrawise:controller:ff94af04:307177' changed from ONLINE to OFFLINE (BRIDGE_OFFLINE)

2020-05-06 16:35:27.584 [hingStatusInfoChangedEvent] - 'hydrawise:account:ff94af04' changed from OFFLINE (COMMUNICATION_ERROR): java.util.concurrent.ExecutionException: java.io.EOFException: HttpConnectionOverHTTP@50a5bd::DecryptedEndPoint@1e3b0d{app.hydrawise.com/52.41.248.73:443<->/192.168.1.39:52926,OPEN,fill=-,flush=-,to=60245/0} to ONLINE

2020-05-06 16:35:27.586 [hingStatusInfoChangedEvent] - 'hydrawise:controller:ff94af04:307177' changed from OFFLINE (BRIDGE_OFFLINE) to ONLINE

2020-05-06 16:35:35.929 [.ItemChannelLinkAddedEvent] - Link 'Zone1_NextRun-hydrawise:controller:ff94af04:307177:zone1#nextruntime' has been added.

2020-05-06 16:36:27.719 [hingStatusInfoChangedEvent] - 'hydrawise:account:ff94af04' changed from ONLINE to OFFLINE (COMMUNICATION_ERROR): java.util.concurrent.ExecutionException: java.io.EOFException: HttpConnectionOverHTTP@125cae0::DecryptedEndPoint@6b467{app.hydrawise.com/35.165.155.138:443<->/192.168.1.39:33456,OPEN,fill=-,flush=-,to=60144/0}

2020-05-06 16:36:27.724 [hingStatusInfoChangedEvent] - 'hydrawise:controller:ff94af04:307177' changed from ONLINE to OFFLINE (BRIDGE_OFFLINE)

2020-05-06 16:37:28.835 [hingStatusInfoChangedEvent] - 'hydrawise:account:ff94af04' changed from OFFLINE (COMMUNICATION_ERROR): java.util.concurrent.ExecutionException: java.io.EOFException: HttpConnectionOverHTTP@125cae0::DecryptedEndPoint@6b467{app.hydrawise.com/35.165.155.138:443<->/192.168.1.39:33456,OPEN,fill=-,flush=-,to=60144/0} to ONLINE

2020-05-06 16:37:28.837 [hingStatusInfoChangedEvent] - 'hydrawise:controller:ff94af04:307177' changed from OFFLINE (BRIDGE_OFFLINE) to ONLINE

2020-05-06 16:44:31.430 [hingStatusInfoChangedEvent] - 'hydrawise:account:ff94af04' changed from ONLINE to OFFLINE (COMMUNICATION_ERROR): java.util.concurrent.ExecutionException: java.io.EOFException: HttpConnectionOverHTTP@1174b00::DecryptedEndPoint@fb4837{app.hydrawise.com/52.41.248.73:443<->/192.168.1.39:53164,OPEN,fill=-,flush=-,to=60237/0}

2020-05-06 16:44:31.432 [hingStatusInfoChangedEvent] - 'hydrawise:controller:ff94af04:307177' changed from ONLINE to OFFLINE (BRIDGE_OFFLINE)

2020-05-06 16:45:32.527 [hingStatusInfoChangedEvent] - 'hydrawise:account:ff94af04' changed from OFFLINE (COMMUNICATION_ERROR): java.util.concurrent.ExecutionException: java.io.EOFException: HttpConnectionOverHTTP@1174b00::DecryptedEndPoint@fb4837{app.hydrawise.com/52.41.248.73:443<->/192.168.1.39:53164,OPEN,fill=-,flush=-,to=60237/0} to ONLINE

2020-05-06 16:45:32.529 [hingStatusInfoChangedEvent] - 'hydrawise:controller:ff94af04:307177' changed from OFFLINE (BRIDGE_OFFLINE) to ONLINE

2020-05-06 16:45:36.395 [temChannelLinkRemovedEvent] - Link 'Zone1_Summary => hydrawise:controller:ff94af04:307177:zone1#summary' has been removed.

2020-05-06 16:48:33.437 [hingStatusInfoChangedEvent] - 'hydrawise:account:ff94af04' changed from ONLINE to OFFLINE (COMMUNICATION_ERROR): java.util.concurrent.ExecutionException: java.io.EOFException: HttpConnectionOverHTTP@998ef::DecryptedEndPoint@1fbc082{app.hydrawise.com/52.41.248.73:443<->/192.168.1.39:53330,OPEN,fill=-,flush=-,to=60146/0}

2020-05-06 16:48:33.440 [hingStatusInfoChangedEvent] - 'hydrawise:controller:ff94af04:307177' changed from ONLINE to OFFLINE (BRIDGE_OFFLINE)

2020-05-06 16:49:34.586 [hingStatusInfoChangedEvent] - 'hydrawise:account:ff94af04' changed from OFFLINE (COMMUNICATION_ERROR): java.util.concurrent.ExecutionException: java.io.EOFException: HttpConnectionOverHTTP@998ef::DecryptedEndPoint@1fbc082{app.hydrawise.com/52.41.248.73:443<->/192.168.1.39:53330,OPEN,fill=-,flush=-,to=60146/0} to ONLINE

2020-05-06 16:49:34.589 [hingStatusInfoChangedEvent] - 'hydrawise:controller:ff94af04:307177' changed from OFFLINE (BRIDGE_OFFLINE) to ONLINE

2020-05-06 16:50:34.712 [hingStatusInfoChangedEvent] - 'hydrawise:account:ff94af04' changed from ONLINE to OFFLINE (COMMUNICATION_ERROR): java.util.concurrent.ExecutionException: java.io.EOFException: HttpConnectionOverHTTP@7c0dcd::DecryptedEndPoint@11aa0fe{app.hydrawise.com/35.165.155.138:443<->/192.168.1.39:33754,OPEN,fill=-,flush=-,to=60136/0}

2020-05-06 16:50:34.713 [hingStatusInfoChangedEvent] - 'hydrawise:controller:ff94af04:307177' changed from ONLINE to OFFLINE (BRIDGE_OFFLINE)

Further I tested some of the channels, e.g. Zone #summary and Zone #nextruntime and did not receive any feedback for "summary" and only got feedback once for nextruntime, but then the information was gone and did not reload.

@digitaldan
Copy link
Contributor

@dgebhardt is the refresh time still 60 seconds or did you set it to a lower value ? I'm wondering if you are being rate limited by the service.

@digitaldan
Copy link
Contributor

Nm, i can see its still 60 seconds

@dgebhardt
Copy link

@digitaldan it's still 60s. But I am not sure, if it's contradicted by the fact, that I am adding new items/ sitemap entries and save that back to openHAB and then openHAB is trying to query the information from Hydrawise? (so probably more often than every 60s)?

@digitaldan
Copy link
Contributor

maybe, although i have seen this as well, but far less frequently , doing a little googling shows there might be a bug in the Jetty client with certain SSL servers, i will investigate, let me know if the problem gets better, worse or stays the same.

@digitaldan
Copy link
Contributor

Further I tested some of the channels, e.g. Zone #summary and Zone #nextruntime a

I'll take a look, i have not actually tested those yet :-)

@dgebhardt
Copy link

@digitaldan Thanks!

Regarding the channels:

Tested and working:
zoneX#run
zoneX#name
zoneX#nextruntime

Tested and not working:
allzones#run
system#online
system#name
system#summary
zoneX#summary

I could not test sensor related stuff, as I don't have any.

@dgebhardt
Copy link

maybe, although i have seen this as well, but far less frequently , doing a little googling shows there might be a bug in the Jetty client with certain SSL servers, i will investigate, let me know if the problem gets better, worse or stays the same.

Will stop working on items/ sitemaps for a while and monitor the logs for a bit and let you know.

@giterest
Copy link

giterest commented May 6, 2020

@digitaldan in regards to the timezone - yes, realls strange as it shouldn't make any difference parsing these. the fault symbol was a "^" - independent on the password length, so yes - I guess if you're escaping any special chars it should work.

What I can't reproduce is what @dgebhardt is reporting - I've got a stable (account) thing connection with not a single status change since my initial comment on this issue.

Can't test any more stuff until I can get my controller working.

@giterest
Copy link

giterest commented May 6, 2020

I gave it another try (because.. you never know) with adding the controller thing, but same error is popping up again;

2020-05-06 17:44:28.018 [ERROR] [core.thing.internal.ThingManagerImpl] - Exception occurred while initializing handler of thing 'hydrawise:controller:4466de28:XXXXXX': Text 'Wed, 06 May 20 00:00:00 +0200' could not be parsed at index 0
java.time.format.DateTimeParseException: Text 'Wed, 06 May 20 00:00:00 +0200' could not be parsed at index 0
        at java.time.format.DateTimeFormatter.parseResolved0(DateTimeFormatter.java:1949) ~[?:1.8.0_252]
        at java.time.format.DateTimeFormatter.parse(DateTimeFormatter.java:1851) ~[?:1.8.0_252]
        at java.time.ZonedDateTime.parse(ZonedDateTime.java:597) ~[?:1.8.0_252]
        at org.openhab.binding.hydrawise.internal.HydrawiseControllerHandler.stringToDateTime(HydrawiseControllerHandler.java:360) ~[?:?]
        at org.openhab.binding.hydrawise.internal.HydrawiseControllerHandler.updateForecast(HydrawiseControllerHandler.java:308) ~[?:?]
        at org.openhab.binding.hydrawise.internal.HydrawiseControllerHandler.lambda$1(HydrawiseControllerHandler.java:226) ~[?:?]
        at java.util.Optional.ifPresent(Optional.java:159) ~[?:1.8.0_252]
        at org.openhab.binding.hydrawise.internal.HydrawiseControllerHandler.onData(HydrawiseControllerHandler.java:219) ~[?:?]
        at org.openhab.binding.hydrawise.internal.HydrawiseAccountHandler.addControllerListeners(HydrawiseAccountHandler.java:70) ~[?:?]
        at org.openhab.binding.hydrawise.internal.HydrawiseControllerHandler.initialize(HydrawiseControllerHandler.java:97) ~[?:?]
        at sun.reflect.GeneratedMethodAccessor76.invoke(Unknown Source) ~[?:?]
        at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) ~[?:1.8.0_252]
        at java.lang.reflect.Method.invoke(Method.java:498) ~[?:1.8.0_252]
        at org.eclipse.smarthome.core.internal.common.AbstractInvocationHandler.invokeDirect(AbstractInvocationHandler.java:152) [bundleFile:?]
        at org.eclipse.smarthome.core.internal.common.Invocation.call(Invocation.java:52) [bundleFile:?]
        at java.util.concurrent.FutureTask.run(FutureTask.java:266) [?:1.8.0_252]
        at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149) [?:1.8.0_252]
        at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624) [?:1.8.0_252]
        at java.lang.Thread.run(Thread.java:748) [?:1.8.0_252]

@dgebhardt - do you have any other offset than +2 like me?

@digitaldan
Copy link
Contributor

its strange, i just tried hardcoding your time stamp in the code and it parses it correctly:

hydrawise:controller:account:96158:forecast1#time 2020-05-06T00:00:00.000+0200

@digitaldan
Copy link
Contributor

@giterest i just made a small change, can you download the jar again and try it out?

@dgebhardt
Copy link

Thanks!
Apart from that small copy & paste error, I do not have any other issue to report. The new jar is running for 8 hours now and everything is nice and stable! :)

@giterest
Copy link

hi @digitaldan - as the JAR running smoothly for months now, is there already a PR?

@digitaldan
Copy link
Contributor

Sorry for letting this rot for so long. I have an updated version of this jar for OH3 at https://github.com/digitaldan/openhab-addons/releases/tag/3.x , its about time i get this over the line!

@HarriPinter
Copy link

HarriPinter commented Apr 4, 2021

Hi @digitaldan ,
I am enjoying your binding! :-)
I updated my OH3.1M1 to OH3.1M3 - and now the Binding won't run anymore.
Do you have an idea why?

Log:
2021-04-04 13:25:16.708 [WARN ] [org.apache.felix.fileinstall ] - Error while starting bundle: file:/openhab/addons/org.openhab.binding.hydrawise-3.1.0-SNAPSHOT.jar org.osgi.framework.BundleException: Could not resolve module: org.openhab.binding.hydrawise [258] Unresolved requirement: Import-Package: org.apache.commons.lang; version="[2.6.0,3.0.0)" 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]

@digitaldan
Copy link
Contributor

Yeah, there was a Karaf upgrade , openhab/openhab-core#2264 that will require addons to be compiled against the new dependencies , I'll post an updated jar as soon as I'm back at my computer .

@digitaldan
Copy link
Contributor

New jar has been updated against the latest upstream changes

@HarriPinter
Copy link

New jar has been updated against the latest upstream changes

Thanks! I downloaded it, removed the old one, rebooted OH, installed the new JAR, but there is a (new) error in the log:

2021-04-08 12:07:22.375 [WARN ] [org.apache.felix.fileinstall ] - Error while starting bundle: file:/openhab/addons/org.openhab.binding.hydrawise-3.1.0-SNAPSHOT.jar org.osgi.framework.BundleException: Could not resolve module: org.openhab.binding.hydrawise [258] Unresolved requirement: Import-Package: org.osgi.framework; version="[1.9.0,2.0.0)"

@digitaldan
Copy link
Contributor

oof, sorry , i realized i misread your stack trace, this version will only work against the nightly builds, which i would not recommend just yet (there is a cloud connector issue i'm working on right now) , let me see if i can build against a previous version. Are you on a milestone release , if so which one?

@HarriPinter
Copy link

thanks for your fast answer.
I am on OH3.1M3

@thefathefa
Copy link

Hello @digitaldan thanks a lot for this binding. I too am on OH3.1M3. Where should I get the hydrawise add-on build that goes with it, please?

@giterest
Copy link

Sorry for letting this rot for so long. I have an updated version of this jar for OH3 at https://github.com/digitaldan/openhab-addons/releases/tag/3.x , its about time i get this over the line!

@thefathefa
Copy link

Yes, thanks. I tried that one, and I get the same error as HarriPinter above, and thought this would apply as well:

oof, sorry , i realized i misread your stack trace, this version will only work against the nightly builds, which i would not recommend just yet (there is a cloud connector issue i'm working on right now) , let me see if i can build against a previous version. Are you on a milestone release , if so which one?

@HarriPinter
Copy link

Yes, thanks. I tried that one, and I get the same error as HarriPinter above, and thought this would apply as well:

same here, I do have still the error message described above :-)
Summer is coming and it would be nice if Hydrawise Binding would working again with OH3.1M3 :-D :-P

@digitaldan
Copy link
Contributor

Hi sorry, I was having trouble building for the last milestone release, my build can't find the dependencies needed as they are probably no longer in our artifact repo. The binding i have posted works only with the nightlies right now due to the karaf change, but will work with the next milestone release. I'm not sure when that will be, but we are probably due for another release soon!

@digitaldan
Copy link
Contributor

Actually, i was able to build against 3.0.3, can you try that one, its at the same location:
https://github.com/digitaldan/openhab-addons/releases/tag/3.x

@HarriPinter
Copy link

I tried the 3.0.3 and it is working again!
Thank you so much!! 👍 <3 :-)

2021-04-26 12:40:17.551 [INFO ] [ab.event.ThingStatusInfoChangedEvent] - Thing 'hydrawise:account:ff257xxx' changed from UNINITIALIZED to INITIALIZING
2021-04-26 12:40:17.564 [INFO ] [ab.event.ThingStatusInfoChangedEvent] - Thing 'hydrawise:controller:ff257xxx:312yyy' changed from UNINITIALIZED to UNINITIALIZED (BRIDGE_UNINITIALIZED)
2021-04-26 12:40:20.140 [INFO ] [ab.event.ThingStatusInfoChangedEvent] - Thing 'hydrawise:account:ff257xxx' changed from INITIALIZING to ONLINE
2021-04-26 12:40:20.154 [INFO ] [ab.event.ThingStatusInfoChangedEvent] - Thing 'hydrawise:controller:ff257xxx:312yyy' changed from UNINITIALIZED (BRIDGE_UNINITIALIZED) to INITIALIZING
2021-04-26 12:40:20.559 [INFO ] [ab.event.ThingStatusInfoChangedEvent] - Thing 'hydrawise:controller:ff257xxx:312yyy' changed from INITIALIZING to ONLINE

Yeah, I can water my garden again with OpenHAB!
I am so happy :-)

@thefathefa
Copy link

Ah, yes, after trying once more, I was able to get the 3.0.3 jar file in and to get to an online hydrawise bridge on my OH3.1.M3 setup:-) So that is good, thank you @digitaldan and @HarriPinter.

But, when I create a controller thing, i get a bunch of java error as follows:
2021-04-26 15:09:49.023 [WARN ] [ache.cxf.phase.PhaseInterceptorChain] - Application {http://internal.id.core.openhab.org/}UUIDResource has thrown exception, unwinding now
with many more lines that I can paste here if it can help... Not sure of what I should do next...

Thanks in advance for any help.

@thefathefa
Copy link

thefathefa commented Apr 26, 2021

Ok, never mind, I restarted OH and it seems to be working:-) Thank you very much guys. I look forward using this.

@HarriPinter
Copy link

Hi @digitaldan,

sorry bothering you again... :-)
There was a new Milestone release of OH: it is version 3.1M5.
In previous milestone M4 the org.openhab.binding.hydrawise-3.0.3-SNAPSHOT.jar (you created for us) was working, but now with M5 there is that error again:

2021-06-07 10:37:18.317 [WARN ] [org.apache.felix.fileinstall ] - Error while starting bundle: file:/openhab/addons/org.openhab.binding.hydrawise-3.0.3-SNAPSHOT.jar org.osgi.framework.BundleException: Could not resolve module: org.openhab.binding.hydrawise [292] Unresolved requirement: Import-Package: javax.measure; version="[1.0.0,2.0.0)" at org.eclipse.osgi.container.Module.start(Module.java:463) ~[org.eclipse.osgi-3.16.200.jar:?] at org.eclipse.osgi.internal.framework.EquinoxBundle.start(EquinoxBundle.java:440) ~[org.eclipse.osgi-3.16.200.jar:?] at org.apache.felix.fileinstall.internal.DirectoryWatcher.startBundle(DirectoryWatcher.java:1260) [bundleFile:3.6.8] at org.apache.felix.fileinstall.internal.DirectoryWatcher.startBundles(DirectoryWatcher.java:1233) [bundleFile:3.6.8] at org.apache.felix.fileinstall.internal.DirectoryWatcher.doProcess(DirectoryWatcher.java:520) [bundleFile:3.6.8] at org.apache.felix.fileinstall.internal.DirectoryWatcher.process(DirectoryWatcher.java:365) [bundleFile:3.6.8] at org.apache.felix.fileinstall.internal.DirectoryWatcher.run(DirectoryWatcher.java:316) [bundleFile:3.6.8]

I tried the older org.openhab.binding.hydrawise-3.1.0-SNAPSHOT.jar as well - but got that error too:

Error while starting bundle: file:/openhab/addons/org.openhab.binding.hydrawise-3.1.0-SNAPSHOT.jar org.osgi.framework.BundleException: Could not resolve module: org.openhab.binding.hydrawise [291] Unresolved requirement: Import-Package: javax.measure; version="[1.0.0,2.0.0)"

Could you please have a look? :-) It is getting warm outside and we need to water the garden. LOL :-)
Thanks in advance!!

@HarriPinter
Copy link

I just want to confirm that the latest release from you, @digitaldan, is working fine with OH3.1 release.
Thanks for that, Dan.

May I ask, if there plans that this binding will be a part of future OH-releases?

digitaldan added a commit to digitaldan/openhab-addons that referenced this issue Jul 5, 2021
Fixes openhab#7261

Signed-off-by: Dan Cunningham <dan@digitaldan.com>
@digitaldan
Copy link
Contributor

I finally submitted a PR for this , so hopefully it gets approved and merged soon.

fwolter pushed a commit that referenced this issue Aug 1, 2021
* [hydrawise] Migrated to new GraphQL based API

Fixes #7261

Signed-off-by: Dan Cunningham <dan@digitaldan.com>

* Addressed PR comments.

Signed-off-by: Dan Cunningham <dan@digitaldan.com>

* Address PR review comments.

Signed-off-by: Dan Cunningham <dan@digitaldan.com>
frederictobiasc pushed a commit to frederictobiasc/openhab-addons that referenced this issue Oct 26, 2021
* [hydrawise] Migrated to new GraphQL based API

Fixes openhab#7261

Signed-off-by: Dan Cunningham <dan@digitaldan.com>

* Addressed PR comments.

Signed-off-by: Dan Cunningham <dan@digitaldan.com>

* Address PR review comments.

Signed-off-by: Dan Cunningham <dan@digitaldan.com>
thinkingstone pushed a commit to thinkingstone/openhab-addons that referenced this issue Nov 7, 2021
* [hydrawise] Migrated to new GraphQL based API

Fixes openhab#7261

Signed-off-by: Dan Cunningham <dan@digitaldan.com>

* Addressed PR comments.

Signed-off-by: Dan Cunningham <dan@digitaldan.com>

* Address PR review comments.

Signed-off-by: Dan Cunningham <dan@digitaldan.com>
dschoepel pushed a commit to dschoepel/openhab-addons that referenced this issue Nov 9, 2021
* [hydrawise] Migrated to new GraphQL based API

Fixes openhab#7261

Signed-off-by: Dan Cunningham <dan@digitaldan.com>

* Addressed PR comments.

Signed-off-by: Dan Cunningham <dan@digitaldan.com>

* Address PR review comments.

Signed-off-by: Dan Cunningham <dan@digitaldan.com>
Signed-off-by: Dave J Schoepel <dave@theschoepels.com>
marcfischerboschio pushed a commit to bosch-io/openhab-addons that referenced this issue May 5, 2022
* [hydrawise] Migrated to new GraphQL based API

Fixes openhab#7261

Signed-off-by: Dan Cunningham <dan@digitaldan.com>

* Addressed PR comments.

Signed-off-by: Dan Cunningham <dan@digitaldan.com>

* Address PR review comments.

Signed-off-by: Dan Cunningham <dan@digitaldan.com>
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
8 participants