dgreif / ring

Unofficial packages for Ring Doorbells, Cameras, Alarm System, and Smart Lighting
MIT License
1.23k stars 162 forks source link

Ring API timeout, but Homebridge Ring still seems to be working #1311

Closed stevehoek closed 1 year ago

stevehoek commented 1 year ago

Is there an existing issue for this?

Describe The Bug

I'm getting frequent Ring API timeouts but everything else seems to be working (snapshots, live view). I've refreshed my token a few times, rebooted the RPi that Homebridge is on. I had a significant amount of motion over the last two days (constantly tiriggered for about 6 hours each day), so I wonder if I am rate limited for awhile?

To Reproduce

No response

Expected behavior

Not timeouts

Relevant log output

[19/09/2023, 10:16:55] [Ring] Failed to reach Ring server at https://api.ring.com/clients_api/ring_devices.  Timeout awaiting 'request' for 20000ms.  Trying again in 5 seconds...
[19/09/2023, 10:17:01] [Ring] Cottage Access View Detected Motion. Loading snapshot before sending event to HomeKit
[19/09/2023, 10:17:17] [Ring] Cottage Front Door View Detected Motion. Loading snapshot before sending event to HomeKit
[19/09/2023, 10:18:39] [myQ] Cottage Garage Door: Closing.
[19/09/2023, 10:18:48] [myQ] Cottage Garage Door: Closed.
[19/09/2023, 10:20:09] [Ring] Cottage Access View Detected Motion. Loading snapshot before sending event to HomeKit
[19/09/2023, 10:39:57] [Ring] Cottage Access View Detected Motion. Loading snapshot before sending event to HomeKit
[19/09/2023, 10:50:32] [Ring] Failed to reach Ring server at https://api.ring.com/clients_api/ring_devices.  Timeout awaiting 'request' for 20000ms.  Trying again in 5 seconds...
[19/09/2023, 10:54:55] [Ring] Failed to reach Ring server at https://api.ring.com/clients_api/ring_devices.  Timeout awaiting 'request' for 20000ms.  Trying again in 5 seconds...

Screenshots

No response

Homebridge Ring Config

{
            "refreshToken": "eyJyd...9fQ==",
            "hideDoorbellSwitch": true,
            "hideInHomeDoorbellSwitch": true,
            "locationModePollingSeconds": 0,
            "locationIds": [
                "31fb2ec6-32d8-44a7-7ec1-5c9d30884205"
            ],
            "platform": "Ring"
        },

Additional context

No response

OS

Raspbian

Node.js Version

18.17.1

NPM Version

9.81

Homebridge/HOOBs Version

1.4.1

Homebridge Ring Plugin Version

latest

Operating System

Raspbian

tsightler commented 1 year ago

Unless you start seeing these constantly, to the point where the code is not working, then there's really no reason to report this. Believe it or not, sometimes Ring API doesn't respond in a timely way, as it states in the log, the code simply retries such request after waiting 5 seconds. Only if it repeats over and over after these retries is this a concern and, even then, it's unlikely to be anything this project can do to resolve it as the code is only logging that this happens, it's not unexpected to see these sometimes.

stevehoek commented 1 year ago

Unless you start seeing these constantly, to the point where the code is not working, then there's really no reason to report this. Believe it or not, sometimes Ring API doesn't respond in a timely way, as it states in the log, the code simply retries such request after waiting 5 seconds. Only if it repeats over and over after these retries is this a concern and, even then, it's unlikely to be anything this project can do to resolve it as the code is only logging that this happens, it's not unexpected to see these sometimes.

Thanks for the input. I have 2 other sites running RPi+Homebridge+Ring all withing 75 miles of each other and the other two are not showing API timeouts. That is what led me to wonder if there is some rate limiting going on at this location due to the motion storm over the weekend.

I'll just monitor it for now and see if it lessens or goes away. Currently it is showing 6-12 timeouts per hour.

tsightler commented 1 year ago

Motions are handled via push notifications, so don't really go through the Ring API at all so I think that it is unlikely. Push notifications are received from Firebase Cloud Messaging which uses a socket connection.

It's pretty normal to see these timeouts, I get probably 4-5/day on average. In ring-mqtt I don't log these because it makes people open issues even though it's completely normal that the request will occasionally timeout. Usually if you are being throttled you will get a different response, like a 429 response, not a timeout.

tsightler commented 1 year ago

Closing as I don't believe it is an issue, and even if it is, there's not much that can be done about it from the plugin perspective.