Skip to content
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’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[netatmo] Adding a request counter #13494

Merged
merged 7 commits into from
Oct 7, 2022

Conversation

clinique
Copy link
Contributor

@clinique clinique commented Oct 6, 2022

This creates a new channel at bridge level that counts the number of request emitted to Netatmo API.
The counter is resetted to 0 after one hour of operations.

Signed-off-by: clinique <gael@lhopital.org>
Signed-off-by: clinique <gael@lhopital.org>
Signed-off-by: clinique <gael@lhopital.org>
@clinique clinique requested a review from lolodomo as a code owner October 6, 2022 12:53
Signed-off-by: clinique <gael@lhopital.org>
Signed-off-by: clinique <gael@lhopital.org>
@clinique
Copy link
Contributor Author

clinique commented Oct 6, 2022

This will help identify potential enhancements regarding #13358

@lolodomo lolodomo added the enhancement An enhancement or new feature for an existing add-on label Oct 6, 2022
@lolodomo
Copy link
Contributor

lolodomo commented Oct 7, 2022

@clinique: with my moidified version of that PR, I can see that my counter is between 102 and 104 requests per hour.
Note that your branch does not yet include your merged enhancement regarding the ping request. It will be interesting to see how this counter is reduced with that change.
I am far from the API limit (500 per hour) but to be honest I had not in mind so many requests were run in my case. So maybe I should re-enable logs to understand what are all these requests.
Your PR about getting home events should of course also reduce this number of requests.

I see regular block of 4 requests, that is probably for my camera. To be confirmed and analyzed if this is expected to run 4 API requests.

@lolodomo
Copy link
Contributor

lolodomo commented Oct 7, 2022

The 4 requests could be:

  • The home status
  • The last home event
  • The last camera event
  • The camera ping

Do you confirm?

@clinique
Copy link
Contributor Author

clinique commented Oct 7, 2022

I'll study this deeper but I think :

  • homedata
  • homestatus
  • events
  • ping

Maybe we could improve on homedata as this is not subject to change frequently and maybe pull it only once after initialization.

@lolodomo
Copy link
Contributor

lolodomo commented Oct 7, 2022

If that is confirmed, with your change regarding ping, you should have already reduced to 3 requests -> already a gain of almost 25%.
And your cache of the home events should also provide a new gain of almost 25%.

Signed-off-by: clinique <gael@lhopital.org>
@clinique clinique force-pushed the netatmo_request_counter branch from 01ed5c8 to 9b8824e Compare October 7, 2022 07:15
Signed-off-by: clinique <gael@lhopital.org>
Copy link
Contributor

@lolodomo lolodomo left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM, thank you

@lolodomo lolodomo merged commit cc6e4fa into openhab:main Oct 7, 2022
@lolodomo lolodomo added this to the 3.4 milestone Oct 7, 2022
@clinique clinique deleted the netatmo_request_counter branch October 7, 2022 09:49
andan67 pushed a commit to andan67/openhab-addons that referenced this pull request Nov 6, 2022
* Adding a request counter channel to Api Bridge thing.

Signed-off-by: clinique <gael@lhopital.org>
andrasU pushed a commit to andrasU/openhab-addons that referenced this pull request Nov 12, 2022
* Adding a request counter channel to Api Bridge thing.

Signed-off-by: clinique <gael@lhopital.org>
Signed-off-by: Andras Uhrin <andras.uhrin@gmail.com>
borazslo pushed a commit to borazslo/openhab-mideaac-addon that referenced this pull request Jan 8, 2023
* Adding a request counter channel to Api Bridge thing.

Signed-off-by: clinique <gael@lhopital.org>
psmedley pushed a commit to psmedley/openhab-addons that referenced this pull request Feb 23, 2023
* Adding a request counter channel to Api Bridge thing.

Signed-off-by: clinique <gael@lhopital.org>
nemerdaud pushed a commit to nemerdaud/openhab-addons that referenced this pull request Feb 28, 2023
* Adding a request counter channel to Api Bridge thing.

Signed-off-by: clinique <gael@lhopital.org>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement An enhancement or new feature for an existing add-on
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants