Brandawg93 / homebridge-fordpass

Control your Ford vehicle in HomeKit using Homebridge.
GNU General Public License v3.0
61 stars 15 forks source link

[Bug]: Too many requests to status endpoint #187

Closed lebodano closed 2 years ago

lebodano commented 2 years ago

Describe the bug

currently the plugin is pinging an endpoint which i believe gets things like battery level or status of the vehicle. Account was blocked by Ford and they mentioned there was too much traffic to the status endpoint from my ID which can cause battery drain issues....I assume this will start happening to others as well. Can the amount this plugin pings the status endpoint be reduced?

Debug Output

pinging the status endpoint only once per minute?

Steps to reproduce

  1. integrate latest version of the plugin

Device Type

homekit

iOS Version

N/A

Bug Persistence

Consistently

Last Working Version

No response

Brandawg93 commented 2 years ago

Do you have the auto refresh enabled? The status endpoint is cached data from ford so it does not use your vehicle's battery unless you have the auto refresh enabled.

lebodano commented 2 years ago

AutoRefresh is set to false and Refresh rate is set to 180. They were concerned about how many times I was calling their endpoint vs whether data is cached or not I guess

Brandawg93 commented 2 years ago

They were concerned about how many times I was calling their endpoint vs whether data is cached or not I guess

I agree. Your account probably got flagged as a security risk.

For now so you can continue using the plugin, you can go into the plugin files and open index.js and search for 60 * 1000 and change it to whatever you want.

In the meantime, I'll look into making this configurable.

Out of curiosity, do you have more than one vehicle connected to FordPass?

lebodano commented 2 years ago

Yes, I have 2 vehicles but typically only use this for my vehicle vs my wife's

lebodano commented 2 years ago

I cannot use the plugin any longer as they suspended my account which is why I filed the bug ticket. I think you need to lower the threshold they said they are cracking down on people who are calling the APIs so much with automation. I think changing it to something lower is something that can be done fairly quickly and right away and then make it configurable too (but this could still get accounts suspended if they put it too high - I just don't know what "high" is in terms of Ford)

Brandawg93 commented 2 years ago

Typically burst requests are what triggers stuff like this. I wouldn't think 1 request a minute would throw any red flags. I've actually found a way to stop the burst requests from happening.

Before, it was requesting a status update 3 times at the same time (in your case, 6 for both vehicles). I bet they have a trigger for > 5 burst requests.

The latest plugin test (v1.7.0-test.1) now only does 1 request every 10 seconds max.

If they unsuspend your account, feel free to try it. Apologies for the issues with the plugin.

Brandawg93 commented 2 years ago

I'm going to close this since I was able to cut down on the number of requests (v1.7.0). I'll leave this pinned just in case anyone else runs into this issue.

Huxly72 commented 1 year ago

I am noticing 3 calls every minute to the endpoint. Newly installed, latest version. I have 2 ford vehicles. Refresh was never enabled.