openhab-addons
openhab-addons copied to clipboard
[hydrawise] Communication error
I upgraded to 4.1.2 today while i saw that there is an authorization bugfix in the hydrawise binding done, but still i got this message after the upgrade in the BASIC UI Thing setup:
COMMUNICATION_ERROR
Request failed with HTTP status code: 400 response: {"errors":{"message":"Could not resolve promise"}}_
I am running the Hydrawise Binding on openHAB 4.1.2 stable version on a Debian Buster Machine.
This failure comes up since some days, all other APP's are running as normal.
Any idea?
{"errors":{"message":"Could not resolve promise"}}_
Hmm, that's an error coming from the Hydrawise servers, seems like they have a bug, although i'm not sure why its working for me and others and not your account. You want want to try deleting the "account" and "controller" thing and add them back new.
I removed already the Binding and the account thing's. No success, still did not work
I started the DEBUG mode, here is the log entry:
org.openhab.binding.hydrawise.internal.api.HydrawiseConnectionException: Request failed with HTTP status code: 400 response: {"errors":{"message":"Could not resolve promise"}}
at org.openhab.binding.hydrawise.internal.api.graphql.HydrawiseGraphQLClient.sendGraphQLRequest(HydrawiseGraphQLClient.java:315) ~[?:?]
at org.openhab.binding.hydrawise.internal.api.graphql.HydrawiseGraphQLClient.sendGraphQLQuery(HydrawiseGraphQLClient.java:261) ~[?:?]
at org.openhab.binding.hydrawise.internal.api.graphql.HydrawiseGraphQLClient.queryControllers(HydrawiseGraphQLClient.java:115) ~[?:?]
at org.openhab.binding.hydrawise.internal.handler.HydrawiseAccountHandler.poll(HydrawiseAccountHandler.java:232) ~[?:?]
at org.openhab.binding.hydrawise.internal.handler.HydrawiseAccountHandler.poll(HydrawiseAccountHandler.java:227) ~[?:?]
at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:539) [?:?]
at java.util.concurrent.FutureTask.runAndReset(FutureTask.java:305) [?:?]
at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.run(ScheduledThreadPoolExecutor.java:305) [?:?]
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1136) [?:?]
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:635) [?:?]
at java.lang.Thread.run(Thread.java:840) [?:?]
2024-03-24 17:23:01.729 [DEBUG] [rnal.handler.HydrawiseAccountHandler] - Will try again during next poll period
org.openhab.binding.hydrawise.internal.api.HydrawiseConnectionException: Request failed with HTTP status code: 400 response: {"errors":{"message":"Could not resolve promise"}}
at org.openhab.binding.hydrawise.internal.api.graphql.HydrawiseGraphQLClient.sendGraphQLRequest(HydrawiseGraphQLClient.java:315) ~[?:?]
at org.openhab.binding.hydrawise.internal.api.graphql.HydrawiseGraphQLClient.sendGraphQLQuery(HydrawiseGraphQLClient.java:261) ~[?:?]
at org.openhab.binding.hydrawise.internal.api.graphql.HydrawiseGraphQLClient.queryControllers(HydrawiseGraphQLClient.java:115) ~[?:?]
at org.openhab.binding.hydrawise.internal.handler.HydrawiseAccountHandler.poll(HydrawiseAccountHandler.java:232) ~[?:?]
at org.openhab.binding.hydrawise.internal.handler.HydrawiseAccountHandler.poll(HydrawiseAccountHandler.java:252) ~[?:?]
at org.openhab.binding.hydrawise.internal.handler.HydrawiseAccountHandler.poll(HydrawiseAccountHandler.java:227) ~[?:?]
at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:539) [?:?]
at java.util.concurrent.FutureTask.runAndReset(FutureTask.java:305) [?:?]
at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.run(ScheduledThreadPoolExecutor.java:305) [?:?]
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1136) [?:?]
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:635) [?:?]
at java.lang.Thread.run(Thread.java:840) [?:?]
Can you turn on TRACE logging and see what we are sending? I wonder if its choking on a GraphQL variable that maybe is not supported in your region.
Ok, here is the TRACE 👍
2024-03-24 17:34:02.782 [DEBUG] [rnal.handler.HydrawiseAccountHandler] - Handler initialized.
2024-03-24 17:34:04.087 [TRACE] [l.api.graphql.HydrawiseGraphQLClient] - Sending Request: {"query":"{\n me {\n email\n lastContact\n controllers {\n id\n name\n status {\n summary\n online\n lastContact {\n timestamp\n }\n } \n location {\n coordinates {\n latitude\n longitude\n }\n forecast(days: 3) {\n time\n updateTime\n conditions\n averageWindSpeed {\n value\n unit\n }\n highTemperature {\n value\n unit\n }\n lowTemperature {\n value\n unit\n }\n probabilityOfPrecipitation\n precipitation {\n value\n unit\n }\n averageHumidity\n }\n }\n zones {\n id\n name\n status {\n suspendedUntil {\n timestamp\n } \n }\n icon {\n id\n fileName\n customImage {\n id\n url\n }\n }\n number {\n value\n label\n }\n scheduledRuns {\n summary\n currentRun{\n id\n startTime {\n timestamp\n }\n endTime {\n timestamp\n }\n duration\n status {\n value\n label\n }\n }\n nextRun {\n id\n startTime {\n timestamp\n }\n endTime {\n timestamp\n }\n duration\n }\n }\n }\n sensors {\n id\n name\n input {\n number\n label\n }\n status {\n active\n waterFlow {\n value\n unit\n }\n }\n model {\n modeType\n active\n offLevel\n offTimer\n delay\n }\n }\n }\n }\n}"}
2024-03-24 17:34:04.988 [TRACE] [l.api.graphql.HydrawiseGraphQLClient] - Received Response: {"errors":{"message":"Could not resolve promise"}}
2024-03-24 17:34:04.989 [DEBUG] [rnal.handler.HydrawiseAccountHandler] - Retrying failed poll
org.openhab.binding.hydrawise.internal.api.HydrawiseConnectionException: Request failed with HTTP status code: 400 response: {"errors":{"message":"Could not resolve promise"}}
at org.openhab.binding.hydrawise.internal.api.graphql.HydrawiseGraphQLClient.sendGraphQLRequest(HydrawiseGraphQLClient.java:315) ~[?:?]
at org.openhab.binding.hydrawise.internal.api.graphql.HydrawiseGraphQLClient.sendGraphQLQuery(HydrawiseGraphQLClient.java:261) ~[?:?]
at org.openhab.binding.hydrawise.internal.api.graphql.HydrawiseGraphQLClient.queryControllers(HydrawiseGraphQLClient.java:115) ~[?:?]
at org.openhab.binding.hydrawise.internal.handler.HydrawiseAccountHandler.poll(HydrawiseAccountHandler.java:232) ~[?:?]
at org.openhab.binding.hydrawise.internal.handler.HydrawiseAccountHandler.poll(HydrawiseAccountHandler.java:227) ~[?:?]
at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:539) [?:?]
at java.util.concurrent.FutureTask.runAndReset(FutureTask.java:305) [?:?]
at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.run(ScheduledThreadPoolExecutor.java:305) [?:?]
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1136) [?:?]
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:635) [?:?]
at java.lang.Thread.run(Thread.java:840) [?:?]
2024-03-24 17:34:04.994 [TRACE] [l.api.graphql.HydrawiseGraphQLClient] - Sending Request: {"query":"{\n me {\n email\n lastContact\n controllers {\n id\n name\n status {\n summary\n online\n lastContact {\n timestamp\n }\n } \n location {\n coordinates {\n latitude\n longitude\n }\n forecast(days: 3) {\n time\n updateTime\n conditions\n averageWindSpeed {\n value\n unit\n }\n highTemperature {\n value\n unit\n }\n lowTemperature {\n value\n unit\n }\n probabilityOfPrecipitation\n precipitation {\n value\n unit\n }\n averageHumidity\n }\n }\n zones {\n id\n name\n status {\n suspendedUntil {\n timestamp\n } \n }\n icon {\n id\n fileName\n customImage {\n id\n url\n }\n }\n number {\n value\n label\n }\n scheduledRuns {\n summary\n currentRun{\n id\n startTime {\n timestamp\n }\n endTime {\n timestamp\n }\n duration\n status {\n value\n label\n }\n }\n nextRun {\n id\n startTime {\n timestamp\n }\n endTime {\n timestamp\n }\n duration\n }\n }\n }\n sensors {\n id\n name\n input {\n number\n label\n }\n status {\n active\n waterFlow {\n value\n unit\n }\n }\n model {\n modeType\n active\n offLevel\n offTimer\n delay\n }\n }\n }\n }\n}"}
2024-03-24 17:34:05.272 [TRACE] [l.api.graphql.HydrawiseGraphQLClient] - Received Response: {"errors":{"message":"Could not resolve promise"}}
2024-03-24 17:34:05.273 [DEBUG] [rnal.handler.HydrawiseAccountHandler] - Will try again during next poll period
org.openhab.binding.hydrawise.internal.api.HydrawiseConnectionException: Request failed with HTTP status code: 400 response: {"errors":{"message":"Could not resolve promise"}}
at org.openhab.binding.hydrawise.internal.api.graphql.HydrawiseGraphQLClient.sendGraphQLRequest(HydrawiseGraphQLClient.java:315) ~[?:?]
at org.openhab.binding.hydrawise.internal.api.graphql.HydrawiseGraphQLClient.sendGraphQLQuery(HydrawiseGraphQLClient.java:261) ~[?:?]
at org.openhab.binding.hydrawise.internal.api.graphql.HydrawiseGraphQLClient.queryControllers(HydrawiseGraphQLClient.java:115) ~[?:?]
at org.openhab.binding.hydrawise.internal.handler.HydrawiseAccountHandler.poll(HydrawiseAccountHandler.java:232) ~[?:?]
at org.openhab.binding.hydrawise.internal.handler.HydrawiseAccountHandler.poll(HydrawiseAccountHandler.java:252) ~[?:?]
at org.openhab.binding.hydrawise.internal.handler.HydrawiseAccountHandler.poll(HydrawiseAccountHandler.java:227) ~[?:?]
at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:539) [?:?]
at java.util.concurrent.FutureTask.runAndReset(FutureTask.java:305) [?:?]
at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.run(ScheduledThreadPoolExecutor.java:305) [?:?]
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1136) [?:?]
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:635) [?:?]
at java.lang.Thread.run(Thread.java:840) [?:?]
Can you try something for me?
- Login to the web hydrawise app at https://app.hydrawise.com/
- After you successfully log in, go to https://app.hydrawise.com/api/v2/graph/explore
- Enter the following in the pane on the left, then click the Play button at the top, and report back the result in the right pane. I have a screenshot below of what it looks like for me.
{
me {
email
lastContact
controllers {
id
name
status {
summary
online
lastContact {
timestamp
}
}
location {
coordinates {
latitude
longitude
}
forecast(days: 3) {
time
updateTime
conditions
averageWindSpeed {
value
unit
}
highTemperature {
value
unit
}
lowTemperature {
value
unit
}
probabilityOfPrecipitation
precipitation {
value
unit
}
averageHumidity
}
}
zones {
id
name
status {
suspendedUntil {
timestamp
}
}
icon {
id
fileName
customImage {
id
url
}
}
number {
value
label
}
scheduledRuns {
summary
currentRun{
id
startTime {
timestamp
}
endTime {
timestamp
}
duration
status {
value
label
}
}
nextRun {
id
startTime {
timestamp
}
endTime {
timestamp
}
duration
}
}
}
sensors {
id
name
input {
number
label
}
status {
active
waterFlow {
value
unit
}
}
model {
modeType
active
offLevel
offTimer
delay
}
}
}
}
}
Ok Dan, here is the result of the query:
{ "errors": [ { "message": "Schema does not define the required query root type.", "extensions": { "category": "graphql" }, "locations": [ { "line": 1, "column": 1 } ] } ] }
can you post a screen shot ? Does the left panel show any red, like its malformed ?
also make sure these are selected
Ok, here is what you want, no red on the left side
hmm, so odd, does your system show online when you login to the webportal?
Yes both Hydrawise Controller are online and attached to the WLAN
can you try removing sections in the GraphQL query and run again? I would start by removing forecast first
forecast(days: 3) {
...
}
then if that still breaks, remove zones, then sensors? I'm trying to isolate this to a specific part of the query thats breaking it for your account, I'm not sure what they don't like in it.
I reduced the forecast up to this
forecast(days: 3) { time }
Still errors, only if i take it completly out, then it works
Ahhh, ok , thanks for doing that. i figured the broken promise on their end was trying to hit some 3rd party service. Let me think how i can fix this and still keep weather for the users where it works.
Does the forecast works on your implementation? Where could i find the docu, on the hunter site is only an email address to ask questions?
It does, and it works for others, but the API is not supported by them for 3rd party use, so i would not go asking questions and bringing attention to our binding
out of curiosity, if you go back to the original query and replace the forecast(days: 3)
with forecast(days: 0)
, and leave the rest of the body intact, does it work ?
Dan, it give an error but the rest of the information seems to be ok.
Gotcha, thanks. If i have to i might make the weather part an option of the controller thing, so it can be disabled, although i think its still odd the query causes their backend to generate an error like that. If this was a public API i would open a bug ticket up, but since its not, will just have to work around it.
May be they do not offer the forecast feature for germany/europe? In your old version the forecast did not have values and i did not set them up, but it does not give me an error (just for your info). I do not really need the informations, i have a private weather station and send these data to weather underground and wu send the data to Hydrawise, so my data will end in my controller at the end.
May be they do not offer the forecast feature for germany/europe?
Thats my suspicion too, but a GraphQL service should be returning an empty result when no results are available, not an internal error (looks like nodejs maybe?) which is definitely a bug on their end . I'm going to probably send a test GraphQL request to test if weather is supported and drop it if its not. Hopefully its not too much work.
Thanks for your support i really appreciate your work.
If you need someone fpr testing, don't hesitate to ask, i am interested in your solution and using the software.
Same problem on Account thing - Request failed with HTTP status code: 400 response: {"errors":{"message":"Could not resolve promise"}}
Where do you live? We think that Hydrawise did not offer the "forecast" in all countries, the problem seems to be, that Hydrawise answer this by an error message.
Ukraine, forecast always work for me, so I dont know why its broken now... At HydraWise.com web-ui I see forecast and everything seems ok
@digitaldan Can you add to Binding configuration option "Do not load forecasts" if this solves issue? At least we will have working zone triggers....