-
-
Notifications
You must be signed in to change notification settings - Fork 28.5k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We鈥檒l occasionally send you account related emails.
Already on GitHub? Sign in to your account
Reduce ecobee throttle #115968
Reduce ecobee throttle #115968
Conversation
What's the API request interval limits at the provider? |
@MartinHjelmare
https://www.ecobee.com/home/developer/api/introduction/licensing-agreement.shtml That being said, I have never manage to reach it. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ok, thanks!
I would also note that there are separate limits in their terms.
At once every 5 seconds, you'd go through your limit in 5 days. I would not recommend this change if I'm reading this right. Can someone confirm? Assuming I'm reading this correctly, I wouldn't go faster than every 31-35 seconds. Between reboots, reloads, loss of connections, etc., you could have several other queries each month. Edit: in fact, 31.5 seconds would use up all queries in 31-day months with just regular queries, not including reloads, etc. |
Also worth noting that the Developers Documentation still states that the API only offers updated data once every three minutes
|
@dxmnkd316 would there be a way to have the throttle at a small number "like few seconds" but limit home assistant "refreshes" to 3 minutes. The issue is: We want it to be more responsive when we initiate a change from HA. So but the HA fresh when nothing happens can stay 3 min |
Refractor the integration to use an update coordinator. For now, I suggest we revert this PR since there were additional limits that we will hit. |
Not sure. I find that running both the HomeKit and core integration versions of ecobee is a way to improve response times for a couple of features.
It's possible that the HomeKit data would allow for more rapid refreshes without a query of the server. But I haven't looked into how HomeKit handles data refreshes, whether they have refresh limits even locally, etc. That would be where I would focus your research efforts after checking whether the server-side data is refreshed more often than 3 minutes. The downside with the HomeKit integration is that it's significantly more limited in the data it provides. Some temperatures are rounded to integers (individual sensors are not), fan status is not available, limited preset modes are available, etc. As for overwriting sensors created by an integration, I'm less familiar with how the actual code works in that respect for Home Assistant when mixing commands and API requests. I suppose it's theoretically possible, but you might start to get conflicting signals. The last thing I would want is my A/C unit fighting ecobee and Home Assistant causing it to cycle. Nor would I really want automations using that signal if it's going to have a lot of chatter. But as for the changes in this PR, I think it would be wise to test several (>5) API queries spaced 40 seconds apart to determine if the data is indeed updated more frequently than 180 seconds on the server side. Again, assuming I read the quota info right from the terms, I don't think anything more frequent than 35 seconds would be advisable regardless. I would hate to have 8,500+ people lose their ecobee dev access for three weeks because they hit their quota. |
This reverts commit 65b2c15.
just opened a PR to revert |
Proposed change
Ecobee now support, near instant, update on their API.
In the past the API would refresh every 3 min or so, polling it faster was useless. Now, even if thermostat initiated changes are updated every 3 min, the one done via the API are reflected instantly.
In other word. This makes the Home Assistant integration a lot more responsive as changes made on HA side, does not get reverted until the 3 min update. 馃殌
Type of change
Additional information
Checklist
ruff format homeassistant tests
)If user exposed functionality or configuration variables are added/changed:
If the code communicates with devices, web services, or third-party tools:
Updated and included derived files by running:
python3 -m script.hassfest
.requirements_all.txt
.Updated by running
python3 -m script.gen_requirements_all
..coveragerc
.To help with the load of incoming pull requests: