Add a configuration flag to support reducing the number of API calls#329
Open
francoisfernando wants to merge 5 commits intomacxq:mainfrom
Open
Add a configuration flag to support reducing the number of API calls#329francoisfernando wants to merge 5 commits intomacxq:mainfrom
francoisfernando wants to merge 5 commits intomacxq:mainfrom
Conversation
Collaborator
|
Hi, as it stands this would break the code for solar only inverters as they shut down overnight and the integration checks the last data read timestamp to calculate age of sample - 10 minutes would break that, it's a relatively simple fix for that but let me have a think about it and make sure there are no other hidden gems.. |
Author
Hi Dave, thanks for reviewing it; Happy to make any changes to not break solar inverters. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Why?
I recently installed a FoxESS battery with KH10 inverter in NSW, Australia. I also integrated my battery with a local VPP (Virtual Power Plant) provider/Energy Retailer which takes control of the battery.
Since I have a HA monitoring dashboard I also integrated using FoxESS HA plugin. But this lead to a problem as the combined API calls from VPP provider and HA plugin exceeded the 1440 API call limit per day. I really don't want to go the modbus route hence this little contribution to add a flag to run the FoxESS HACS plugin in a reduced api call mode.
What
Added a new boolean configuration flag
reduceAPICallswhich will reduce the main telemetry api calls frequency from 5 minutes to 10 minutes and also reduce other callsTesting
FoxESS API has an endpoint to retrieve the number of API calls remaining and using this in a jupyter notebook I have measured my VPP provider is using about 45 API calls per hour. Since 1440 API calls translates to 60 API calls per hour this leaves about 15 API calls which can be used by FoxESS plugin. With the changes I have implemented when this flag is enabled, it will reduce the number of calls to about 13.
The following file is from measuring call counts over 2 hours with VPP provider only making API calls
call-counts-2025-12-19 12:35:19-2025-12-19 14:38:39.csv