Gardena: Error 429 Limit Exceeded

Interesting. The normal communication is via callbacks in ssl web sockets. So I wonder if these websockets are somehow lingering open, and only eliminated on a full restart. ??

Just a small observation after having a look at recent PR’s (for 3.3):

This was introduced in:

So perhaps would explain why it doesn’t recover from 429, at least not immediately?

Hi,
follow log I got before the issue happened, maybe is helpful.

2022-07-22 15:24:23.554 [DEBUG] [rdena.internal.GardenaSmartWebSocket] - Connected to Gardena Webservice (f1990b03c8-My Garden)
2022-07-22 15:24:23.558 [DEBUG] [rdena.internal.GardenaSmartWebSocket] - Connecting to Gardena Webservice (f1990b03c8-My Garden)
2022-07-22 15:24:23.560 [DEBUG] [covery.GardenaDeviceDiscoveryService] - Stopping Gardena discovery scan
2022-07-22 15:24:23.564 [DEBUG] [covery.GardenaDeviceDiscoveryService] - Starting Gardena discovery scan
2022-07-22 15:24:23.566 [DEBUG] [covery.GardenaDeviceDiscoveryService] - Waiting for finishing Gardena device discovery scan
2022-07-22 15:24:23.591 [DEBUG] [covery.GardenaDeviceDiscoveryService] - Finished Gardena device discovery scan on gateway 'f1990b03c8'
2022-07-22 15:24:23.593 [DEBUG] [covery.GardenaDeviceDiscoveryService] - Gardena device discovery scan finished
2022-07-22 15:24:28.563 [DEBUG] [covery.GardenaDeviceDiscoveryService] - Stopping Gardena discovery scan
2022-07-22 17:24:23.524 [DEBUG] [rdena.internal.GardenaSmartWebSocket] - Connection to Gardena Webservice was closed (f1990b03c8-My Garden): code: 1001, reason: Going away
2022-07-22 17:24:23.527 [INFO ] [ng.gardena.internal.GardenaSmartImpl] - Restarting GardenaSmart Webservice (f1990b03c8-My Garden)
2022-07-22 17:24:23.529 [DEBUG] [rdena.internal.GardenaSmartWebSocket] - Closing Gardena Webservice (f1990b03c8-My Garden)
2022-07-22 17:24:26.533 [DEBUG] [ng.gardena.internal.GardenaSmartImpl] - Gardena API token valid
2022-07-22 17:24:26.536 [DEBUG] [ng.gardena.internal.GardenaSmartImpl] - Token expiration: accessToken: 2022-07-23T15:24:10.252977+02:00[Europe/Berlin], refreshToken: 2022-08-01T15:23:21.252875+02:00[Europe/Berlin]
2022-07-22 17:24:26.798 [WARN ] [ng.gardena.internal.GardenaSmartImpl] - Restarting GardenaSmart Webservice failed (f1990b03c8-My Garden): Error 429 null, {"message":"Limit Exceeded"}, restarting binding
2022-07-22 17:24:26.806 [DEBUG] [ternal.handler.GardenaAccountHandler] - Disposing Gardena account 'f1990b03c8'
2022-07-22 17:24:26.808 [DEBUG] [covery.GardenaDeviceDiscoveryService] - Stopping Gardena discovery scan
2022-07-22 17:24:26.810 [DEBUG] [ng.gardena.internal.GardenaSmartImpl] - Disposing GardenaSmart
2022-07-22 17:24:26.811 [DEBUG] [rdena.internal.GardenaSmartWebSocket] - Closing Gardena Webservice (f1990b03c8-My Garden)
2022-07-22 17:26:29.820 [DEBUG] [ternal.handler.GardenaAccountHandler] - GardenaConfig[connectionTimeout: 10, apiKey: d1a2aeaa-6413-48d5-8900-8d581789nnn]
2022-07-22 17:26:29.823 [DEBUG] [ng.gardena.internal.GardenaSmartImpl] - Starting GardenaSmart
2022-07-22 17:26:29.853 [DEBUG] [ng.gardena.internal.GardenaSmartImpl] - Gardena API login using apiSecret, reason: no token available
2022-07-22 17:26:30.136 [DEBUG] [ng.gardena.internal.GardenaSmartImpl] - Token expiration: accessToken: 2022-07-23T17:26:19.136266+02:00[Europe/Berlin], refreshToken: 2022-08-01T17:25:30.136073+02:00[Europe/Berlin]
2022-07-22 17:26:30.139 [DEBUG] [ng.gardena.internal.GardenaSmartImpl] - Gardena API token valid
2022-07-22 17:26:30.141 [DEBUG] [ng.gardena.internal.GardenaSmartImpl] - Token expiration: accessToken: 
2022-07-23T17:26:19.136266+02:00[Europe/Berlin], refreshToken: 022-08-01T17:25:30.136073+02:00[Europe/Berlin]
2022-07-22 17:26:30.606 [DEBUG] [ng.gardena.internal.GardenaSmartImpl] - Gardena API token valid
2022-07-22 17:26:30.609 [DEBUG] [ng.gardena.internal.GardenaSmartImpl] - Token expiration: accessToken: 
2022-07-23T17:26:19.136266+02:00[Europe/Berlin], refreshToken: 2022-08-01T17:25:30.136073+02:00[Europe/Berlin]
2022-07-22 17:26:30.745 [DEBUG] [ng.gardena.internal.GardenaSmartImpl] - Disposing GardenaSmart
2022-07-22 17:26:30.787 [DEBUG] [ternal.handler.GardenaAccountHandler] - Disposing Gardena account 'f1990b03c8'
2022-07-22 17:26:30.789 [DEBUG] [covery.GardenaDeviceDiscoveryService] - Stopping Gardena discovery scan
2022-07-22 17:26:30.790 [DEBUG] [ng.gardena.internal.GardenaSmartImpl] - Disposing GardenaSmart
2022-07-22 17:26:30.791 [WARN ] [ternal.handler.GardenaAccountHandler] - Error 429 null, {"message":"Limit Exceeded"}

@laursen many thanks for the insights. But the issue is actually not ‘how to recover from 429 errors’, but rather ‘how to prevent 429 errors’.

The 429 error comes when the server rejects an API call because it thinks you have made too many calls already. See log below. And you can only recover from this error when the server decides to once more accept calls. (Apparently sometimes it decides rather soon to accept calls again, and sometimes it takes longer before the server will decide to accept calls again…)

2022-07-22 11:30:10.637 [TRACE] [ng.gardena.internal.GardenaSmartImpl] - >>> GET https://api.smart.gardena.dev/v1/locations, data: null
..
2022-07-22 11:30:10.867 [TRACE] [ng.gardena.internal.GardenaSmartImpl] - <<< status:429, {"message":"Limit Exceeded"}

So, as I said before, the issue is why do we get 429 errors? And how to prevent that?

The binding normally makes a couple of API calls on start-up to get the locations and initialize the web socket. Then during normal operation no further calls are made. Instead the binding relies on the server to make call-back notifications over the already established web socket. Normally the web socket should stay open so long as the token remains valid (which should be 24 hours), however in fact the server invalidates the token and drops the web socket every 2 hours. Which requires a couple of API calls again to get a new token and open a new web socket. In total therefore, the binding is making around 50 API calls per 24 hours. And we have seen over many weeks of operation that the server does not complain about that number of calls. However since the last few days, the server IS now complaining about too many API calls. Why?

Many thanks for the log. It is more or less the same as what I have. So my question is 'do you have anything in the logs during the 24 hours prior to this 429 error that would indicate some reason why the server would suddenly report such 429 error? i.e. is there a lot of other Gardena related traffic in your log (indeed is there ANY traffic) prior to the part you quoted just now?

There are no indications in the log since I created this new API-Key today at 14:00.

  • only one command send during this time (15:22) the other messages are same as in the log.
  • no traffic

Yes, I know you are hunting the root cause. I shared because of the original question why it was needed to disable and enable the account manually instead of the binding automatically coming back online. This change might explain part of that, as it will take 24 hours for it to (possibly) recover once it hits the 429.

Ah. Ok. It is probably a timing issue with the dis/re-abling etc. The 24 hour auto- re-enable delay in the binding starts from the time of encountering the first 429 error, or the time of enabling in the UI (which may cause a new 429 error / timer). So it is possible that dis/re-abling could – if you are lucky – shortcut that auto- re-enable process. Or something like that.

Dear All, The chapter “Rate Limits” in the Gardena/Husqvarna developer portal explains the issue; (but it gives no clue about why we are suddenly now starting to violate those limits).

https://developer.husqvarnagroup.cloud/apis/gardena-smart-system-api#readme

I have my Gardena system up and running again, with full logging, so let’s see what comes through…

1 Like

Same problem here, let me know in case I can help…

Same problem here and I cannot really contribute to the root cause finding, unfortunately.

Yesterday, I wrote a rule that re-enables the Gardena Account Thing if it goes offline, after 30 minutes. Sometimes it works, sometimes it runs into the “limit exceeded” still. Funny thing is, however, that it seems like the behavior seems to change again a bit over time. Maybe Gardena is messing around with the mechanism as well, which would make it a moving target. Has someone any means to contact Gardena / Husqvarna to check if they are aware and if they are working on it, or if it needs to be solved in the Binding?

In any case, a big thank you to the experts who are spending the time on the resolution of these issues!!

2022-07-22 15:28:31.968 [WARN ] [ternal.handler.GardenaAccountHandler] - Error 429 null, {"message":"Limit Exceeded"}
2022-07-22 15:31:20.634 [INFO ] [org.openhab.core.model.script.test  ] - Gardena Account Offline, re-enabling in 30 minutes
2022-07-22 16:01:21.378 [INFO ] [org.openhab.core.model.script.test  ] - Gardena Account re-enabled
2022-07-22 16:01:21.879 [WARN ] [ternal.handler.GardenaAccountHandler] - Error 429 null, {"message":"Limit Exceeded"}
2022-07-22 16:06:20.634 [INFO ] [org.openhab.core.model.script.test  ] - Gardena Account Offline, re-enabling in 30 minutes
2022-07-22 16:36:21.133 [INFO ] [org.openhab.core.model.script.test  ] - Gardena Account re-enabled
2022-07-22 16:36:27.679 [WARN ] [.core.thing.binding.BaseThingHandler] - Handler GardenaAccountHandler tried updating the thing status although the handler was already disposed.
2022-07-22 16:36:27.679 [WARN ] [ternal.handler.GardenaAccountHandler] - Error 429 null, {"message":"Limit Exceeded"}
2022-07-22 18:36:22.498 [INFO ] [ng.gardena.internal.GardenaSmartImpl] - Restarting GardenaSmart Webservice (home-My Garden)
2022-07-22 18:36:25.741 [WARN ] [ng.gardena.internal.GardenaSmartImpl] - Restarting GardenaSmart Webservice failed (home-My Garden): Error 429 null, {"message":"Limit Exceeded"}, restarting binding
2022-07-22 18:38:29.222 [WARN ] [ternal.handler.GardenaAccountHandler] - Error 429 null, {"message":"Limit Exceeded"}
2022-07-22 18:41:20.634 [INFO ] [org.openhab.core.model.script.test  ] - Gardena Account Offline, re-enabling in 30 minutes
2022-07-22 19:11:21.208 [INFO ] [org.openhab.core.model.script.test  ] - Gardena Account re-enabled
2022-07-22 19:11:21.649 [WARN ] [ternal.handler.GardenaAccountHandler] - Error 429 null, {"message":"Limit Exceeded"}
2022-07-22 19:16:20.634 [INFO ] [org.openhab.core.model.script.test  ] - Gardena Account Offline, re-enabling in 30 minutes
2022-07-22 19:46:21.167 [INFO ] [org.openhab.core.model.script.test  ] - Gardena Account re-enabled
2022-07-22 19:46:21.621 [WARN ] [ternal.handler.GardenaAccountHandler] - Error 429 null, {"message":"Limit Exceeded"}
2022-07-22 19:51:20.634 [INFO ] [org.openhab.core.model.script.test  ] - Gardena Account Offline, re-enabling in 30 minutes
2022-07-22 20:21:21.171 [INFO ] [org.openhab.core.model.script.test  ] - Gardena Account re-enabled
2022-07-22 22:21:22.589 [INFO ] [ng.gardena.internal.GardenaSmartImpl] - Restarting GardenaSmart Webservice (home-My Garden)
2022-07-22 22:21:25.812 [WARN ] [ng.gardena.internal.GardenaSmartImpl] - Restarting GardenaSmart Webservice failed (home-My Garden): Error 429 null, {"message":"Limit Exceeded"}, restarting binding
2022-07-22 22:23:29.285 [WARN ] [ternal.handler.GardenaAccountHandler] - Error 429 null, {"message":"Limit Exceeded"}
2022-07-22 22:26:20.634 [INFO ] [org.openhab.core.model.script.test  ] - Gardena Account Offline, re-enabling in 30 minutes
2022-07-22 22:56:21.245 [INFO ] [org.openhab.core.model.script.test  ] - Gardena Account re-enabled
2022-07-22 22:56:21.731 [WARN ] [ternal.handler.GardenaAccountHandler] - Error 429 null, {"message":"Limit Exceeded"}
2022-07-22 23:01:20.635 [INFO ] [org.openhab.core.model.script.test  ] - Gardena Account Offline, re-enabling in 30 minutes
2022-07-22 23:31:21.200 [INFO ] [org.openhab.core.model.script.test  ] - Gardena Account re-enabled
2022-07-23 01:31:22.488 [INFO ] [ng.gardena.internal.GardenaSmartImpl] - Restarting GardenaSmart Webservice (home-My Garden)
2022-07-23 03:31:25.682 [INFO ] [ng.gardena.internal.GardenaSmartImpl] - Restarting GardenaSmart Webservice (home-My Garden)
2022-07-23 04:16:05.439 [WARN ] [.core.thing.binding.BaseThingHandler] - Handler GardenaAccountHandler tried updating the thing status although the handler was already disposed.
2022-07-23 05:31:31.711 [INFO ] [ng.gardena.internal.GardenaSmartImpl] - Restarting GardenaSmart Webservice (home-My Garden)
2022-07-23 06:16:04.971 [INFO ] [ng.gardena.internal.GardenaSmartImpl] - Restarting GardenaSmart Webservice (home-My Garden)
2022-07-23 07:31:34.874 [INFO ] [ng.gardena.internal.GardenaSmartImpl] - Restarting GardenaSmart Webservice (home-My Garden)
2022-07-23 08:16:08.127 [INFO ] [ng.gardena.internal.GardenaSmartImpl] - Restarting GardenaSmart Webservice (home-My Garden)
2022-07-23 08:16:11.282 [WARN ] [ng.gardena.internal.GardenaSmartImpl] - Restarting GardenaSmart Webservice failed (home-My Garden): Error 429 null, {"message":"Limit Exceeded"}, restarting binding
2022-07-23 08:16:11.282 [WARN ] [.core.thing.binding.BaseThingHandler] - Handler GardenaAccountHandler tried updating the thing status although the handler was already disposed.
2022-07-23 08:18:14.753 [WARN ] [.core.thing.binding.BaseThingHandler] - Handler GardenaAccountHandler tried updating the thing status although the handler was already disposed.
2022-07-23 08:18:14.753 [WARN ] [ternal.handler.GardenaAccountHandler] - Error 429 null, {"message":"Limit Exceeded"}
2022-07-23 08:54:01.213 [WARN ] [.core.thing.binding.BaseThingHandler] - Handler GardenaAccountHandler tried updating the thing status although the handler was already disposed.
2022-07-23 08:54:01.213 [WARN ] [ternal.handler.GardenaAccountHandler] - Error 429 null, {"message":"Limit Exceeded"}
2022-07-23 09:06:25.525 [WARN ] [.core.thing.binding.BaseThingHandler] - Handler GardenaAccountHandler tried updating the thing status although the handler was already disposed.
2022-07-23 09:06:25.526 [WARN ] [ternal.handler.GardenaAccountHandler] - Error 429 null, {"message":"Limit Exceeded"}
2022-07-23 09:21:27.889 [WARN ] [.core.thing.binding.BaseThingHandler] - Handler GardenaAccountHandler tried updating the thing status although the handler was already disposed.
2022-07-23 09:31:38.040 [INFO ] [ng.gardena.internal.GardenaSmartImpl] - Restarting GardenaSmart Webservice (home-My Garden)
2022-07-23 09:31:41.200 [WARN ] [ng.gardena.internal.GardenaSmartImpl] - Restarting GardenaSmart Webservice failed (home-My Garden): Error 429 null, {"message":"Limit Exceeded"}, restarting binding
2022-07-23 09:33:41.053 [WARN ] [.core.thing.binding.BaseThingHandler] - Handler GardenaAccountHandler tried updating the thing status although the handler was already disposed.
2022-07-23 09:36:25.359 [WARN ] [.core.thing.binding.BaseThingHandler] - Handler GardenaAccountHandler tried updating the thing status although the handler was already disposed.
2022-07-23 09:36:25.359 [WARN ] [ternal.handler.GardenaAccountHandler] - Error 429 null, {"message":"Limit Exceeded"}
2022-07-23 09:51:24.939 [WARN ] [.core.thing.binding.BaseThingHandler] - Handler GardenaAccountHandler tried updating the thing status although the handler was already disposed.
2022-07-23 09:51:24.939 [WARN ] [ternal.handler.GardenaAccountHandler] - Error 429 null, {"message":"Limit Exceeded"}
2022-07-23 10:11:25.920 [WARN ] [.core.thing.binding.BaseThingHandler] - Handler GardenaAccountHandler tried updating the thing status although the handler was already disposed.
2022-07-23 10:11:25.921 [WARN ] [ternal.handler.GardenaAccountHandler] - Error 429 null, {"message":"Limit Exceeded"}
2022-07-23 10:31:25.015 [WARN ] [.core.thing.binding.BaseThingHandler] - Handler GardenaAccountHandler tried updating the thing status although the handler was already disposed.
2022-07-23 10:31:25.015 [WARN ] [ternal.handler.GardenaAccountHandler] - Error 429 null, {"message":"Limit Exceeded"}
2022-07-23 10:35:08.980 [WARN ] [.core.thing.binding.BaseThingHandler] - Handler GardenaAccountHandler tried updating the thing status although the handler was already disposed.
2022-07-23 10:35:08.981 [WARN ] [ternal.handler.GardenaAccountHandler] - Error 429 null, {"message":"Limit Exceeded"}
2022-07-23 10:51:34.723 [WARN ] [.core.thing.binding.BaseThingHandler] - Handler GardenaAccountHandler tried updating the thing status although the handler was already disposed.
2022-07-23 11:21:27.376 [INFO ] [ng.gardena.internal.GardenaSmartImpl] - Restarting GardenaSmart Webservice (home-My Garden)
2022-07-23 11:33:45.504 [INFO ] [ng.gardena.internal.GardenaSmartImpl] - Restarting GardenaSmart Webservice (home-My Garden)
2022-07-23 12:51:34.215 [INFO ] [ng.gardena.internal.GardenaSmartImpl] - Restarting GardenaSmart Webservice (home-My Garden)
2022-07-23 13:21:30.559 [INFO ] [ng.gardena.internal.GardenaSmartImpl] - Restarting GardenaSmart Webservice (home-My Garden)
2022-07-23 13:33:48.624 [INFO ] [ng.gardena.internal.GardenaSmartImpl] - Restarting GardenaSmart Webservice (home-My Garden)

Yes that is also my opinion. :slight_smile:

Just to clarify what is going on here…

  • If the server thinks the client has made too many calls, it will fail the current call with ‘429 limit exceed’. This ‘server thinks’ may be because the client did actually make too many calls. Or it may be because Gardena has been fiddling with the server.
  • The only way to recover from this issue is to wait until the server no longer thinks the client has made too many calls. This ‘server thinks’ may be because the time window for ‘too many calls’ has rolled over. I don’t know the exact time when the server window rolls over, but it may be (say) midnight California time (or something like that). Or it may be because Gardena stopped fiddling with the server again.
  • When the binding detects an ‘429 limit exceed’ error, it starts a timer to wait for 24 hours, and then retry to connect to the server.
  • If you disable and re-enable the account thing, it cancels the above mentioned timer, and it retries to connect to the server immediately.
  • This immediate reconnect attempt might either succeed or fail (see ‘server thinks’ above). If it succeeds, then all is good, but if it fails the process will have a) added one more call that might cause the server to trigger its call limit exceeded count, and b) it will restart the above mentioned 24 hour timer.
1 Like

Bridge just went offline again and like to share my log

Yesterday at 11:22PM I disabled/enabled Bridge to get it back to work

2022-07-22 23:22:12.374 [INFO ] [openhab.core.model.script.api_bridge] - Gardena Bridge status: INITIALIZING detail: NONE
2022-07-22 23:22:12.375 [ERROR] [openhab.core.model.script.api_bridge] - Something is wrong with Gardena Bridge.
2022-07-22 23:22:14.456 [INFO ] [openhab.core.model.script.api_bridge] - Gardena Bridge status: ONLINE detail: NONE
2022-07-22 23:22:14.456 [INFO ] [openhab.core.model.script.api_bridge] - Gardena Bridge back online.
2022-07-23 01:22:14.418 [INFO ] [ng.gardena.internal.GardenaSmartImpl] - Restarting GardenaSmart Webservice (home-My Garden)
2022-07-23 03:22:17.999 [INFO ] [ng.gardena.internal.GardenaSmartImpl] - Restarting GardenaSmart Webservice (home-My Garden)
2022-07-23 05:22:21.615 [INFO ] [ng.gardena.internal.GardenaSmartImpl] - Restarting GardenaSmart Webservice (home-My Garden)

Rule Trigger to check if Green needs to get watered

2022-07-23 06:05:00.711 [INFO ] [rg.openhab.core.model.script.Gardena] - Bewässerung Start abgebrochen, da Bodenfeuchte mit 100 % ausreichend!
2022-07-23 07:22:25.269 [INFO ] [ng.gardena.internal.GardenaSmartImpl] - Restarting GardenaSmart Webservice (home-My Garden)
2022-07-23 09:22:28.913 [INFO ] [ng.gardena.internal.GardenaSmartImpl] - Restarting GardenaSmart Webservice (home-My Garden)
2022-07-23 11:22:32.532 [INFO ] [ng.gardena.internal.GardenaSmartImpl] - Restarting GardenaSmart Webservice (home-My Garden)
2022-07-23 13:22:36.117 [INFO ] [ng.gardena.internal.GardenaSmartImpl] - Restarting GardenaSmart Webservice (home-My Garden)
2022-07-23 13:22:39.301 [WARN ] [ng.gardena.internal.GardenaSmartImpl] - Restarting GardenaSmart Webservice failed (home-My Garden): Error 429 null, {"message":"Limit Exceeded"}, restarting binding
2022-07-23 13:22:39.304 [INFO ] [openhab.core.model.script.api_bridge] - Gardena Bridge status: OFFLINE detail: COMMUNICATION_ERROR
2022-07-23 13:22:39.305 [ERROR] [openhab.core.model.script.api_bridge] - Something is wrong with Gardena Bridge.
2022-07-23 13:24:43.181 [INFO ] [openhab.core.model.script.api_bridge] - Gardena Bridge status: OFFLINE detail: COMMUNICATION_ERROR
2022-07-23 13:24:43.181 [WARN ] [ternal.handler.GardenaAccountHandler] - Error 429 null, {"message":"Limit Exceeded"}
2022-07-23 13:24:43.182 [ERROR] [openhab.core.model.script.api_bridge] - Something is wrong with Gardena Bridge.

Finally it goes down again but definatelly it doesn’t look like to much trigger from Binding

1 Like

not sure if relevant, but there are every two minutes pings which might count to the number of calls

2022-07-23 00:03:05.600 [TRACE] [rdena.internal.GardenaSmartWebSocket] - Sending ping (garden-My Garden)
2022-07-23 00:03:05.636 [TRACE] [rdena.internal.GardenaSmartWebSocket] - Pong received (garden-My Garden)
2022-07-23 00:05:05.602 [TRACE] [rdena.internal.GardenaSmartWebSocket] - Sending ping (garden-My Garden)
2022-07-23 00:05:05.638 [TRACE] [rdena.internal.GardenaSmartWebSocket] - Pong received (garden-My Garden)
2022-07-23 00:06:38.094 [DEBUG] [rdena.internal.GardenaSmartWebSocket] - Connection to Gardena Webservice was closed (garden-My Garden): code: 1001, reason: Going away
2022-07-23 00:06:38.095 [INFO ] [ng.gardena.internal.GardenaSmartImpl] - Restarting GardenaSmart Webservice (garden-My Garden)
2022-07-23 00:06:38.096 [DEBUG] [rdena.internal.GardenaSmartWebSocket] - Closing Gardena Webservice (garden-My Garden)
2022-07-23 00:06:41.101 [TRACE] [ng.gardena.internal.GardenaSmartImpl] - >>> POST https://api.smart.gardena.dev/v1/websocket, data: {"data":{"id":"wsreq-","type":"WEBSOCKET","attributes":{"locationId":"d7bdf90e-"}}}
2022-07-23 00:06:41.102 [DEBUG] [ng.gardena.internal.GardenaSmartImpl] - Gardena API token valid
2022-07-23 00:06:41.102 [DEBUG] [ng.gardena.internal.GardenaSmartImpl] - Token expiration: accessToken: 2022-07-23T22:06:23.244192+02:00[Europe/Berlin], refreshToken: 2022-08-01T22:05:34.243595+02:00[Europe/Berlin]
2022-07-23 00:06:41.344 [TRACE] [ng.gardena.internal.GardenaSmartImpl] - <<< status:429, {"message":"Limit Exceeded"}

No. :slight_smile:

Agreed.

EDIT: on second thoughts, it may be the cases in your log ‘Restarting GardenaSmart Webservice’ … the Gardena documentation says the rate limit is one call per 15 minutes or 3000 calls per month; and your log has several ‘Restarting’ messages within 3 or 4 minutes… => @INT5749 can you please advise what may be causing the ‘Restarting’?

Based on feedback here, and some guesswork on my side, I have made some code changes. Since I already have a small PR open for a slightly similar topic, I added these changes to that PR (rather than open another one). Unfortunately in my own case I have not seen any actual 429 errors anymore, (opposite example of the ‘demo effect’), so I could not test it. However I would appreciate if maintainers (e.g. @Kai / @laursen ) could already have a look at it. :slight_smile:

1 Like

To be honest: I can’t find anything in Logs. There is nothing right before this messages from Gardena nor later than already provided :-/

I have the same experience. After some hours of perfectly normal operation, the server suddenly reports ‘429 limit exceeded’ for no apparent reason.

I think this must be a bug in the Gardena API server. So I will try to contact them, and see if we can get it fixed. But don’t hold your breath…

In the meantime, I have made some further refinements to the code in my above-mentioned PR so that repeatedly manually disabling and enabling the thing will not not cause the rate limit to be exceeded. The new code now applies a stepped restart strategy in the event of encountering an error (or a manual disbale/enable cycle)…

  • If the error cause was 429, restart after 24 hours
  • If the last API call was less than 15 minutes ago, restart after 15 minutes
  • Otherwise restart after 2 minutes
4 Likes