Problems to connect to Gardena cloud service with the Gardena binding

I am on openhab 3.0.2. I find this entry in openhab.log every 10 seconds (10 seconds are my timeout setting for the Gardena binding):

2021-05-13 18:21:45.342 [WARN ] [ternal.handler.GardenaAccountHandler] - Error 429 null, {"message":"Limit Exceeded"}

I discovered it today, but my logfiles show it starting from April 30th. Maybe it started earlier, but older logfiles are deleted. The binding configuration was working before with openhab 3.0.1 and since then it has been unchanged.

Additionally the “Gardena Smart Home Account” item is in state “ERROR:COMM”. What can I do to successfully connect to the Gardena cloud service again?

I found out myself:
I created a new API-Key at this website: https://developer.husqvarnagroup.cloud/
Let’s see, if that’s a temporary solution.

After 23 days I had to renew the API-Key again. It looks, that there is a limit within the Husquana cloud service, that is reached after some events and that triggers blacklisting the API key. At this point of time I couldn’t determine the limit value.

I have five Gardena devices in operation:

  • one mower
  • three water control valves
  • one smart sensor

Maybe the number of devices has an effect on reaching the limit.

After a larger number of entries “Connection Lost” in the log these entries follow, which relate to the limit:

2021-06-07 20:11:32.127 [INFO ] [ab.event.ThingStatusInfoChangedEvent] - Thing 'gardena:account:010d0959' changed from ONLINE to OFFLINE (COMMUNICATION_ERROR): Connection lost
2021-06-07 20:11:45.174 [INFO ] [ab.event.ThingStatusInfoChangedEvent] - Thing 'gardena:account:010d0959' changed from OFFLINE (COMMUNICATION_ERROR): Connection lost to OFFLINE (COMMUNICATION_ERROR): Error 400 Bad Request, {"error":"invalid_request","error_description":"Simultaneous logins detected for client[id=67515f31-aa98-4d53-b75e-4872b14c5144], user[id=***, email=x@y.org}]","error_code":"simultaneous.logins"}
2021-06-07 20:11:46.822 [INFO ] [ab.event.ThingStatusInfoChangedEvent] - Thing 'gardena:account:010d0959' changed from OFFLINE (COMMUNICATION_ERROR): Error 400 Bad Request, {"error":"invalid_request","error_description":"Simultaneous logins detected for client[id=67515f31-aa98-4d53-b75e-4872b14c5144], user[id=***, email=x@y.org}]","error_code":"simultaneous.logins"} to ONLINE
2021-06-07 20:12:11.960 [INFO ] [ab.event.ThingStatusInfoChangedEvent] - Thing 'gardena:account:010d0959' changed from ONLINE to OFFLINE (COMMUNICATION_ERROR): Connection lost
2021-06-07 20:12:16.907 [INFO ] [ab.event.ThingStatusInfoChangedEvent] - Thing 'gardena:account:010d0959' changed from OFFLINE (COMMUNICATION_ERROR): Connection lost to OFFLINE (CONFIGURATION_ERROR): Device with id e8bbe3bd-f3fe-4003-ab54-15ca58f0e863 not found
2021-06-07 20:12:16.912 [INFO ] [ab.event.ThingStatusInfoChangedEvent] - Thing 'gardena:account:010d0959' changed from OFFLINE (CONFIGURATION_ERROR): Device with id e8bbe3bd-f3fe-4003-ab54-15ca58f0e863 not found to OFFLINE (CONFIGURATION_ERROR): Device with id a965be7a-0069-48e8-9942-9f3d2d428aa8 not found
2021-06-07 20:12:16.914 [INFO ] [ab.event.ThingStatusInfoChangedEvent] - Thing 'gardena:account:010d0959' changed from OFFLINE (CONFIGURATION_ERROR): Device with id a965be7a-0069-48e8-9942-9f3d2d428aa8 not found to OFFLINE (COMMUNICATION_ERROR): Connection lost
2021-06-07 20:12:16.919 [INFO ] [ab.event.ThingStatusInfoChangedEvent] - Thing 'gardena:account:010d0959' changed from OFFLINE (COMMUNICATION_ERROR): Connection lost to OFFLINE (CONFIGURATION_ERROR): Device with id c71780c8-c982-4051-91ec-de4cd444fdd5 not found
2021-06-07 20:12:16.922 [INFO ] [ab.event.ThingStatusInfoChangedEvent] - Thing 'gardena:account:010d0959' changed from OFFLINE (CONFIGURATION_ERROR): Device with id c71780c8-c982-4051-91ec-de4cd444fdd5 not found to OFFLINE (CONFIGURATION_ERROR): Device with id 01d1e252-e394-4749-86b8-ca0e50786edc not found
2021-06-07 20:12:16.929 [INFO ] [ab.event.ThingStatusInfoChangedEvent] - Thing 'gardena:account:010d0959' changed from OFFLINE (CONFIGURATION_ERROR): Device with id 01d1e252-e394-4749-86b8-ca0e50786edc not found to OFFLINE (CONFIGURATION_ERROR): Device with id 66eb06fb-93dc-4e47-a216-885f59ff172f not found
2021-06-07 20:12:36.254 [INFO ] [ab.event.ThingStatusInfoChangedEvent] - Thing 'gardena:account:010d0959' changed from OFFLINE (CONFIGURATION_ERROR): Device with id 66eb06fb-93dc-4e47-a216-885f59ff172f not found to OFFLINE (COMMUNICATION_ERROR): Idle timeout 10000 ms
2021-06-07 20:12:38.528 [INFO ] [ab.event.ThingStatusInfoChangedEvent] - Thing 'gardena:account:010d0959' changed from OFFLINE (COMMUNICATION_ERROR): Idle timeout 10000 ms to OFFLINE (COMMUNICATION_ERROR): Error 400 Bad Request, {"error":"invalid_request","error_description":"Simultaneous logins detected for client[id=67515f31-aa98-4d53-b75e-4872b14c5144], user[id=***, email=x@y.org}]","error_code":"simultaneous.logins"}
2021-06-07 20:12:45.481 [INFO ] [ab.event.ThingStatusInfoChangedEvent] - Thing 'gardena:account:010d0959' changed from OFFLINE (COMMUNICATION_ERROR): Error 400 Bad Request, {"error":"invalid_request","error_description":"Simultaneous logins detected for client[id=67515f31-aa98-4d53-b75e-4872b14c5144], user[id=***, email=x@y.org}]","error_code":"simultaneous.logins"} to ONLINE
2021-06-07 20:12:47.281 [INFO ] [ab.event.ThingStatusInfoChangedEvent] - Thing 'gardena:account:010d0959' changed from ONLINE to OFFLINE (COMMUNICATION_ERROR): Connection lost2021-06-07 20:12:52.251 [INFO ] [ab.event.ThingStatusInfoChangedEvent] - Thing 'gardena:account:010d0959' changed from OFFLINE (COMMUNICATION_ERROR): Connection lost to OFFLINE (COMMUNICATION_ERROR): Error 400 Bad Request, {"error":"invalid_request","error_description":"Simultaneous logins detected for client[id=67515f31-aa98-4d53-b75e-4872b14c5144], user[id=***, email=x@y.org}]","error_code":"simultaneous.logins"}
2021-06-07 20:12:52.935 [INFO ] [ab.event.ThingStatusInfoChangedEvent] - Thing 'gardena:account:010d0959' changed from OFFLINE (COMMUNICATION_ERROR): Error 400 Bad Request, {"error":"invalid_request","error_description":"Simultaneous logins detected for client[id=67515f31-aa98-4d53-b75e-4872b14c5144], user[id=***, email=x@y.org}]","error_code":"simultaneous.logins"} to OFFLINE (COMMUNICATION_ERROR): Connection lost
2021-06-07 20:12:53.955 [INFO ] [ab.event.ThingStatusInfoChangedEvent] - Thing 'gardena:account:010d0959' changed from OFFLINE (COMMUNICATION_ERROR): Connection lost to ONLINE
2021-06-07 20:12:59.856 [INFO ] [ab.event.ThingStatusInfoChangedEvent] - Thing 'gardena:account:010d0959' changed from ONLINE to OFFLINE (COMMUNICATION_ERROR): Connection lost
2021-06-07 20:13:14.776 [INFO ] [ab.event.ThingStatusInfoChangedEvent] - Thing 'gardena:account:010d0959' changed from OFFLINE (COMMUNICATION_ERROR): Connection lost to OFFLINE (COMMUNICATION_ERROR): org.eclipse.jetty.websocket.api.UpgradeException: Failed to upgrade to websocket: Unexpected HTTP Response Status Code: 410 Gone
2021-06-07 20:13:16.600 [INFO ] [ab.event.ThingStatusInfoChangedEvent] - Thing 'gardena:account:010d0959' changed from OFFLINE (COMMUNICATION_ERROR): org.eclipse.jetty.websocket.api.UpgradeException: Failed to upgrade to websocket: Unexpected HTTP Response Status Code: 410 Gone to OFFLINE (COMMUNICATION_ERROR): Connection lost
2021-06-07 20:13:17.759 [INFO ] [ab.event.ThingStatusInfoChangedEvent] - Thing 'gardena:account:010d0959' changed from OFFLINE (COMMUNICATION_ERROR): Connection lost to ONLINE
2021-06-07 20:13:17.930 [INFO ] [ab.event.ThingStatusInfoChangedEvent] - Thing 'gardena:account:010d0959' changed from ONLINE to OFFLINE (COMMUNICATION_ERROR): Connection lost
2021-06-07 20:13:23.855 [INFO ] [ab.event.ThingStatusInfoChangedEvent] - Thing 'gardena:account:010d0959' changed from OFFLINE (COMMUNICATION_ERROR): Connection lost to ONLINE
2021-06-07 20:13:44.967 [INFO ] [ab.event.ThingStatusInfoChangedEvent] - Thing 'gardena:account:010d0959' changed from ONLINE to OFFLINE (COMMUNICATION_ERROR): Error 429 null, {"message":"Limit Exceeded"}
2021-06-07 20:13:55.001 [INFO ] [ab.event.ThingStatusInfoChangedEvent] - Thing 'gardena:account:010d0959' changed from OFFLINE (COMMUNICATION_ERROR): Error 429 null, {"message":"Limit Exceeded"} to OFFLINE (CONFIGURATION_ERROR): Device with id e8bbe3bd-f3fe-4003-ab54-15ca58f0e863 not found

The authentication information in these log entries is anonymized and the clientId is invalidated.

I appreciate any hint to avoid reaching this limit which stops the operation of the binding and requires manual intervention (creation of a new API key).

3,000 a month.
That’s about one every fifteen minutes.
It also says it’ll throttle you to one every 15 minutes anyway, i.e. discard or reject more frequent calls.

The binding doesn’t seem to offer you any control over that rate.

Hi,
I am experiencing the same problem. Periodically, I am loosing connection to Gardena cloud,

2021-06-13 13:06:10.907 [WARN ] [rdena.internal.GardenaSmartWebSocket] - Gardena Webservice error (home-My Garden): Broken pipe, restarting

2021-06-13 13:06:10.911 [INFO ] [ab.event.ThingStatusInfoChangedEvent] - Thing 'gardena:account:home' changed from ONLINE to OFFLINE (COMMUNICATION_ERROR): Connection lost

2021-06-13 13:06:23.312 [INFO ] [ab.event.ThingStatusInfoChangedEvent] - Thing 'gardena:account:home' changed from OFFLINE (COMMUNICATION_ERROR): Connection lost to ONLINE

2021-06-13 13:06:37.212 [WARN ] [rdena.internal.GardenaSmartWebSocket] - Gardena Webservice error (home-My Garden): Broken pipe, restarting

2021-06-13 13:06:37.216 [INFO ] [ab.event.ThingStatusInfoChangedEvent] - Thing 'gardena:account:home' changed from ONLINE to OFFLINE (COMMUNICATION_ERROR): Connection lost

2021-06-13 13:06:49.346 [INFO ] [ab.event.ThingStatusInfoChangedEvent] - Thing 'gardena:account:home' changed from OFFLINE (COMMUNICATION_ERROR): Connection lost to ONLINE

2021-06-13 13:07:12.327 [WARN ] [rdena.internal.GardenaSmartWebSocket] - Gardena Webservice error (home-My Garden): Broken pipe, restarting

2021-06-13 13:07:12.331 [INFO ] [ab.event.ThingStatusInfoChangedEvent] - Thing 'gardena:account:home' changed from ONLINE to OFFLINE (COMMUNICATION_ERROR): Connection lost

2021-06-13 13:07:24.462 [INFO ] [ab.event.ThingStatusInfoChangedEvent] - Thing 'gardena:account:home' changed from OFFLINE (COMMUNICATION_ERROR): Connection lost to ONLINE

2021-06-13 13:07:38.469 [WARN ] [rdena.internal.GardenaSmartWebSocket] - Gardena Webservice error (home-My Garden): Broken pipe, restarting

2021-06-13 13:07:38.473 [INFO ] [ab.event.ThingStatusInfoChangedEvent] - Thing 'gardena:account:home' changed from ONLINE to OFFLINE (COMMUNICATION_ERROR): Connection lost

2021-06-13 13:07:50.601 [INFO ] [ab.event.ThingStatusInfoChangedEvent] - Thing 'gardena:account:home' changed from OFFLINE (COMMUNICATION_ERROR): Connection lost to ONLINE

This behaviour started with the new binding in 2020. I am on OpenHABian 3.0.2 on Raspberry 4. After some time, Gardena blocks my access. Any idea?

Now I have the same problem. Gardena Thing is offline, “limit exceeded”.
Restart of OH does not help.
Access via Gardena app is possible without problems.

For me the creation of a new API key worked around the problem temporarily.

Anyway in the meantime I issued a GitHub ticket: [gardena] Binding shouldn't reach request limit on Husqvarna cloud service · Issue #10841 · openhab/openhab-addons · GitHub

Same issue , communication stop after around 20 days and I have to create a new API-Key.

OH-3.0.2 on Pi-4

Yes, after creating a new API-key, it works again.
Let’s see how long…

same here… openhab 3.1.0 release

That’s good then, you’re all working fine with a new key.

Hello,
Even if i renew the API, it connects but after one minute, i have “connection lost”

In the log i have :

 2021-08-01 17:31:44.449 [WARN ] [rdena.internal.GardenaSmartWebSocket] - Gardena Webservice error (gardenabridge-My Garden): java.util.concurrent.TimeoutException: Idle timeout expired: 150000/150000 ms, restarting

2021-08-01 17:31:44.451 [WARN ] [.core.thing.binding.BaseThingHandler] - Handler GardenaAccountHandler tried updating the thing status although the handler was already disposed.


Somebody have an idea ?

Thanks, this helped me as well.

There is a new github issue with a possible explanation for the connection issues. Something with the service_id could be wrong.
Link to the issue: [gardena] Error 400 Bad Request - Can not parse service ID · Issue #12481 · openhab/openhab-addons · GitHub

Hope somebody can fix this. For the meantime, downgrading to openHAB 2 and installing the “new” binding for openHAB3 (Link: Gardena API Binding | Eclipse Plugins, Bundles and Products - Eclipse Marketplace) works for me.

Hi, I had to get a new API key from the developer site. The procedure to get it has been changed and the documention of the OpenHAB Gardena binding seems to be obsolete.
Now, the site https://developer.husqvarnagroup.cloud now asks for “Redirect URLs”. I entered “http://localhost:8080” and tried some other URLs with no success. The Gardena binding cannot connect to the Husquvaran / Gardena cloud.

What can I do? Any hint greatly appreciated.

Peter

I would like to point out that due to the change (I think API version has changed to v1.1) in the developer portal now asking for Redirect URLs new users of the Gardena binding cannot use the binding as long they do not supply a proper “Redirect URL”.
In my opinion, this renders OpenHAB’s Gardena binding useless when we do not find a solution for “Redirect URL”.

Any help / hint welcome!

First of all I am not the developer of the Gardena binding and I haven’t checked its code. I am not an expert of the Gardena API either. This means, that I can only make assumptions here. The binding has been deveoped and maintained by @gerrieg and he probably can explain better.

Currently the Gardena binding works at my site. All my Gardena things are online. I haven’t entered a redirect URL when I created a new API key some weeks ago. The site https://developer.husqvarnagroup.cloud hadn’t asked me for a redirect URL at that time. When I enter this site today, the URL “http://localhost:8080” is displayed in the upper left corner of the screen. This means, thta there must be a way to make it work without a valid redirectUrl.

The Gardena API is documented here. The README doesn’t list major modifications from V1.0 to V1.1. Husqvarna writes, that they want the clients of that API to use webhooks instead of websockets. They hope to lower the load on their service with webhooks. The webhooks require a listener on the client side to receive messages. I believe, this mechanism isn’t used by the current Gardena binding and I completely agree on that for security reasons. May the redirectURL be needed for those clients of the API only, that use webhooks?

Bodo, thank you for your detailed analysis.

In fact, everything is fine for “legacy” users as for me until one week ago. Then, I had to get a new API key from the developer’s site and suddently found the new entry “Redirect URLs”. Using “http://localhost:8080” as input I was able to get the APIkey in the usual manner. However, my openHAB cannot connect to the cloud using this key, producing an error " COMMUNICATION_ERROR Error 400 Bad Request, {“error”:“invalid_client”,“error_description”:“Client not found”,“error_code”:“client.not.found”}.
For 2 years I did no encounter any problems to connect so I assume entering “http://localhost:8080” as Redirect URL could be wrong and I am stil looking for a solution.

Edit:
“When I enter this site today, the URL “http://localhost:8080” is displayed in the upper left corner of the screen.” Do you mean this is in your brower?

“This means, thta there must be a way to make it work without a valid redirectUrl.” Sorry, I do not understand that.

Regards

I’m having similar issues today. Looks like the API has changed completely:

Gardena expects: a client ID and secret whereas the binding is sending a user/pass and grant type that is not supported

Gardena documentation:

curl -X POST -d “grant_type=client_credentials&client_id=626b4ecc-9b26-4f41-991f-bfdbaf94cc12&client_secret=xxxxxxxxxxxxxxxxxxxxx” https://api.authentication.husqvarnagroup.dev/v1/oauth2/token

Whereas the binding is sending:

https://api.authentication.husqvarnagroup.dev/v1/oauth2 /token, data: {“caseSensitive”:false,“fields”:{“client_id”:{“name”:“client_id”,“values”:[“626b4ecc-9b26-4f41-991f-bfdbaf94cc12” ]},“grant_type”:{“name”:“grant_type”,“values”:[“password”]},“username”:{“name”:“username”,“values”:[“tXxxxxxxxxxxxxxxx”] },“password”:{“name”:“password”,“values”:[“xxxxxxxxx”]}}}

Husqvarna API has been changed, so for all users which need new credentials the binding is broken. Obviously, API now requires API key AND secret. @gerrieg do you have time for a look at it?