kcharwood / homebridge-rachio-platform

Homekit support for Gen1/Gen2 Rachio Controllers
MIT License
20 stars 13 forks source link

Daily Calls to Rachio Server Exceeded Error #5

Open designzguy opened 5 years ago

designzguy commented 5 years ago

I had this plugin working initially then when I tried to run it today using Homekit Home app the switch turned on but nothing happened. After checking my Homebridge setup I received the following error:

[2019-2-26 11:45:29] [Rachio Controller] Failed to refresh devices. Error: 1700 daily calls rate limit exceeded. [429] GET https://api.rach.io/1/public/person/info at Request.request [as _callback] (C:\Users\homebridge\AppData\Roaming\npm\node_modules\homebridge-rachio-platform\node_modules\rachio\lib\datastore\DataStore.js:25:21) at Request.self.callback (C:\Users\homebridge\AppData\Roaming\npm\node_modules\homebridge-rachio-platform\node_modules\rachio\node_modules\request\request.js:186:22) at emitTwo (events.js:126:13) at Request.emit (events.js:214:7) at Request. (C:\Users\homebridge\AppData\Roaming\npm\node_modules\homebridge-rachio-platform\node_modules\rachio\node_modules\request\request.js:1163:10) at emitOne (events.js:116:13) at Request.emit (events.js:211:7) at IncomingMessage. (C:\Users\homebridge\AppData\Roaming\npm\node_modules\homebridge-rachio-platform\node_modules\rachio\node_modules\request\request.js:1085:12) at Object.onceWrapper (events.js:313:30) at emitNone (events.js:111:20) at IncomingMessage.emit (events.js:208:7) at endReadableNT (_stream_readable.js:1055:12) at _combinedTickCallback (internal/process/next_tick.js:138:11) at process._tickCallback (internal/process/next_tick.js:180:9)

So it looks like somehow I exceeded the 1700 daily call limit but I have no idea how this happened. Does this plugin constantly ping the Rachio servers to check on the sprinkler system status? If so then you might have to add some lines of code that limit how often the plugin sends a request to the Rachio servers.

designzguy commented 5 years ago

I found something regarding the 1700 daily call limit on the Rachio API documentation.

Rachio’s public API has rate limiting in order to improve server performance for all users. We only allow 1,700 calls per day, which is over 1 call per minute. In general, this limit is only reached by integrations that are polling. If you’d like to explore a non-polling method, we do support webhooks. We are willing to work with users to discuss exceptions on rate limiting for specific use cases.

Does this plugin use polling in it? If so then it is causing this "1700 calls per day" limit to be reached fairly quickly.

designzguy commented 5 years ago

I also found this interesting conversation covering this topic on the Rachio Community Forums. https://community.rachio.com/t/api-calls-failing/10751

kcharwood commented 5 years ago

Thanks for posting this issue.

The way its written, it listens to web hooks. There is no polling involved at all. Can you give more info about your setup? It would also be helpful if you post your log file to me.

kcharwood commented 5 years ago

If you look at the error, it is only from refreshDevices which is only called in the constructor. Is your your homebridge constantly restarting during the day?

kcharwood commented 5 years ago

Also, do you have any other integrations using your API key?

designzguy commented 5 years ago

I wasn't restarting my homebridge constantly, the only thing that I can think that might have happened was that when I asked Siri to start a zone for some reason it was cycling through all of the zones starting them, then stopping them in order to get to the zone that I asked for. Seems there are still some bugs with the way that Siri understands irrigation control and how to navigate or cycle through to the Zone that is requested. I'll try to upload my log for review and I'll try to run some more tests with my system and the plugin. After the 24 hr "1700 calls per day" violation period ended I once again had access to all of my sprinkler zones again using this plugin via Homekit. I haven't had time to try to "break" the plugin in last few days and due to the cold snap of weather that has hit my part of Texas. Not really wanting to run sprinklers in cold weather with chance for them to freeze.

Sent with GitHawk

irctrakz commented 3 years ago

I'm also running into this issue:

[12/15/2020, 9:55:18 AM] [Rachio-Platform] Failed to refresh devices. Error: 1700 daily calls rate limit exceeded. [429] GET https://api.rach.io/1/public/person/info at Request._callback (/homebridge/node_modules/homebridge-rachio-platform/node_modules/rachio/lib/datastore/DataStore.js:25:21) at Request.self.callback (/homebridge/node_modules/homebridge-rachio-platform/node_modules/rachio/node_modules/request/request.js:186:22) at Request.emit (events.js:315:20) at Request. (/homebridge/node_modules/homebridge-rachio-platform/node_modules/rachio/node_modules/request/request.js:1163:10) at Request.emit (events.js:315:20) at IncomingMessage. (/homebridge/node_modules/homebridge-rachio-platform/node_modules/rachio/node_modules/request/request.js:1085:12) at Object.onceWrapper (events.js:421:28) at IncomingMessage.emit (events.js:327:22) at endReadableNT (_stream_readable.js:1327:12) at processTicksAndRejections (internal/process/task_queues.js:80:21)

I have no other API integrations and haven't reloaded the Homebridge server more than a couple of times today (unrelated troubleshooting)

irctrakz commented 3 years ago

Going back through the logs, I do see this a lot:

(node:1024) UnhandledPromiseRejectionWarning: Error: 1700 daily calls rate limit exceeded. [429] GET https://api.rach.io/1/public/zone/44cb6130-5e5f-4f6f-8500-9e7df12c264d at Request._callback (/homebridge/node_modules/homebridge-rachio-platform/node_modules/rachio/lib/datastore/DataStore.js:25:21) at Request.self.callback (/homebridge/node_modules/homebridge-rachio-platform/node_modules/rachio/node_modules/request/request.js:186:22) at Request.emit (events.js:315:20) at Request. (/homebridge/node_modules/homebridge-rachio-platform/node_modules/rachio/node_modules/request/request.js:1163:10) at Request.emit (events.js:315:20) at IncomingMessage. (/homebridge/node_modules/homebridge-rachio-platform/node_modules/rachio/node_modules/request/request.js:1085:12) at Object.onceWrapper (events.js:421:28) at IncomingMessage.emit (events.js:327:22) at endReadableNT (_stream_readable.js:1327:12) at processTicksAndRejections (internal/process/task_queues.js:80:21) (node:1024) UnhandledPromiseRejectionWarning: Unhandled promise rejection. This error originated either by throwing inside of an async function without a catch block, or by rejecting a promise which was not handled with .catch(). To terminate the node process on unhandled promise rejection, use the CLI flag --unhandled-rejections=strict (see https://nodejs.org/api/cli.html#cli_unhandled_rejections_mode). (rejection id: 50) (node:1024) UnhandledPromiseRejectionWarning: Error: 1700 daily calls rate limit exceeded. [429] GET https://api.rach.io/1/public/zone/8360ce8b-fdf5-46bd-9e39-969201d09471 at Request._callback (/homebridge/node_modules/homebridge-rachio-platform/node_modules/rachio/lib/datastore/DataStore.js:25:21) at Request.self.callback (/homebridge/node_modules/homebridge-rachio-platform/node_modules/rachio/node_modules/request/request.js:186:22) at Request.emit (events.js:315:20) at Request. (/homebridge/node_modules/homebridge-rachio-platform/node_modules/rachio/node_modules/request/request.js:1163:10) at Request.emit (events.js:315:20) at IncomingMessage. (/homebridge/node_modules/homebridge-rachio-platform/node_modules/rachio/node_modules/request/request.js:1085:12) at Object.onceWrapper (events.js:421:28) at IncomingMessage.emit (events.js:327:22) at endReadableNT (_stream_readable.js:1327:12) at processTicksAndRejections (internal/process/task_queues.js:80:21) (node:1024) UnhandledPromiseRejectionWarning: Unhandled promise rejection. This error originated either by throwing inside of an async function without a catch block, or by rejecting a promise which was not handled with .catch(). To terminate the node process on unhandled promise rejection, use the CLI flag --unhandled-rejections=strict (see https://nodejs.org/api/cli.html#cli_unhandled_rejections_mode). (rejection id: 51) (node:1024) UnhandledPromiseRejectionWarning: Error: 1700 daily calls rate limit exceeded. [429] GET https://api.rach.io/1/public/zone/44cb6130-5e5f-4f6f-8500-9e7df12c264d at Request._callback (/homebridge/node_modules/homebridge-rachio-platform/node_modules/rachio/lib/datastore/DataStore.js:25:21) at Request.self.callback (/homebridge/node_modules/homebridge-rachio-platform/node_modules/rachio/node_modules/request/request.js:186:22) at Request.emit (events.js:315:20) at Request. (/homebridge/node_modules/homebridge-rachio-platform/node_modules/rachio/node_modules/request/request.js:1163:10) at Request.emit (events.js:315:20) at IncomingMessage. (/homebridge/node_modules/homebridge-rachio-platform/node_modules/rachio/node_modules/request/request.js:1085:12) at Object.onceWrapper (events.js:421:28) at IncomingMessage.emit (events.js:327:22) at endReadableNT (_stream_readable.js:1327:12) at processTicksAndRejections (internal/process/task_queues.js:80:21) (node:1024) UnhandledPromiseRejectionWarning: Unhandled promise rejection. This error originated either by throwing inside of an async function without a catch block, or by rejecting a promise which was not handled with .catch(). To terminate the node process on unhandled promise rejection, use the CLI flag --unhandled-rejections=strict (see https://nodejs.org/api/cli.html#cli_unhandled_rejections_mode). (rejection id: 52) (node:1024) UnhandledPromiseRejectionWarning: Error: 1700 daily calls rate limit exceeded. [429] GET https://api.rach.io/1/public/zone/37a5e290-79f2-4fd9-ac15-498240092cc0 at Request._callback (/homebridge/node_modules/homebridge-rachio-platform/node_modules/rachio/lib/datastore/DataStore.js:25:21) at Request.self.callback (/homebridge/node_modules/homebridge-rachio-platform/node_modules/rachio/node_modules/request/request.js:186:22) at Request.emit (events.js:315:20) at Request. (/homebridge/node_modules/homebridge-rachio-platform/node_modules/rachio/node_modules/request/request.js:1163:10) at Request.emit (events.js:315:20) at IncomingMessage. (/homebridge/node_modules/homebridge-rachio-platform/node_modules/rachio/node_modules/request/request.js:1085:12) at Object.onceWrapper (events.js:421:28) at IncomingMessage.emit (events.js:327:22) at endReadableNT (_stream_readable.js:1327:12) at processTicksAndRejections (internal/process/task_queues.js:80:21) (node:1024) UnhandledPromiseRejectionWarning: Unhandled promise rejection. This error originated either by throwing inside of an async function without a catch block, or by rejecting a promise which was not handled with .catch(). To terminate the node process on unhandled promise rejection, use the CLI flag --unhandled-rejections=strict (see https://nodejs.org/api/cli.html#cli_unhandled_rejections_mode). (rejection id: 53) (node:1024) UnhandledPromiseRejectionWarning: Error: 1700 daily calls rate limit exceeded. [429] GET https://api.rach.io/1/public/zone/8360ce8b-fdf5-46bd-9e39-969201d09471 at Request._callback (/homebridge/node_modules/homebridge-rachio-platform/node_modules/rachio/lib/datastore/DataStore.js:25:21) at Request.self.callback (/homebridge/node_modules/homebridge-rachio-platform/node_modules/rachio/node_modules/request/request.js:186:22) at Request.emit (events.js:315:20) at Request. (/homebridge/node_modules/homebridge-rachio-platform/node_modules/rachio/node_modules/request/request.js:1163:10) at Request.emit (events.js:315:20) at IncomingMessage. (/homebridge/node_modules/homebridge-rachio-platform/node_modules/rachio/node_modules/request/request.js:1085:12) at Object.onceWrapper (events.js:421:28) at IncomingMessage.emit (events.js:327:22) at endReadableNT (_stream_readable.js:1327:12) at processTicksAndRejections (internal/process/task_queues.js:80:21) (node:1024) UnhandledPromiseRejectionWarning: Unhandled promise rejection. This error originated either by throwing inside of an async function without a catch block, or by rejecting a promise which was not handled with .catch(). To terminate the node process on unhandled promise rejection, use the CLI flag --unhandled-rejections=strict (see https://nodejs.org/api/cli.html#cli_unhandled_rejections_mode). (rejection id: 54)

JoaoCharnetTR commented 3 years ago

I just configured this plugin with my rachio information, and I see this message in the logs as well. The device does not show at all up in the home app. Any ideas?