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

Hits the limit after 6 hours #230

Closed
2 tasks done
alpha520098 opened this issue May 2, 2024 · 19 comments
Closed
2 tasks done

Hits the limit after 6 hours #230

alpha520098 opened this issue May 2, 2024 · 19 comments
Labels
bug Something isn't working

Comments

@alpha520098
Copy link

Describe the issue

So i got the storm distance and bearing to work (thank you)

however the API limit is being exhausted with in 6 hours, ive got the refresh to 1200

Acknowledgements

  • I have searched this repository to see if the issue has already been reported.
  • I have written an informative title.
@cloneofghosts
Copy link
Collaborator

From the looks of things you're using the HA integration no? Someone else was having a similar situation #221 and it turns out the cause was having more than one integration setup and the key was marked as untrustworthy so it was being blocked.

I'll also ping @alexander0042 to look into things on his end to see if he can figure anything out.

@cloneofghosts cloneofghosts moved this from Todo to In Progress in Pirate Weather Home Assistant May 2, 2024
@cloneofghosts cloneofghosts added the needs more info Further information is requested label May 3, 2024
@alexander0042
Copy link
Collaborator

Thanks for reaching out! I'll second what @cloneofghosts said, could you clarify if you're using the HA integration or some other way to call the API?

@alpha520098
Copy link
Author

@alexander0042 and @cloneofghosts - Good morning gents, so I am using HA intergation, I have deleted all the other API and using just the one.

I have found however if i only select the storm distance and bearing it seems to last long rather then the entire amount of sensors.

Also just another question in terms of the storm distance, is this measuring the storm from the location GPS from my location?

@cloneofghosts
Copy link
Collaborator

Thanks for confirming that you're using the HA integration. Just for clarification you're still having issues with hitting the API limit or has it been solved? If you're still having issues do you have more than one instance of the integration setup? The update rate you have it set to shouldn't cause any issues with hitting the API limit that quickly and having other weather integrations shouldn't affect anything either.

I have found however if i only select the storm distance and bearing it seems to last long rather then the entire amount of sensors.

Can you clarify what you mean by this? I'm not really sure what exactly you are trying to say here.

@cloneofghosts cloneofghosts added the needs more info Further information is requested label May 15, 2024
@cloneofghosts
Copy link
Collaborator

Hi @alpha520098 are you still having issues with the API limit or has it sorted itself out? If you are still having issues with the API limit could you supply the email you signed up with or email [email protected] and @alexander0042 can look into this for you.

@alpha520098
Copy link
Author

alpha520098 commented Jun 3, 2024

@cloneofghosts, Hi and thanks for checking in. Yes, I’ve subscribed to the $2 per month plan, and it seems to have settled things down.

On a side note, I wrote some code that analyzes the bearing and distance to create distance rings at 10, 20, 50, and 100 km intervals in all directions. This includes the names of areas and suburbs to provide context on the storm's location, using my home as a reference point.

for anyone else that is reading this make a template sensor
Screenshot 2024-06-04 085253

my many thanks to @alexander0042 and @cloneofghosts for making this intergation

@cloneofghosts
Copy link
Collaborator

Alright, good to know. I'll close this for now but feel free to re-open if you're having issues with hitting the limit in the future.

@github-project-automation github-project-automation bot moved this from In Progress to Done in Pirate Weather Home Assistant Jun 3, 2024
@cloneofghosts cloneofghosts removed the needs more info Further information is requested label Jun 4, 2024
@alpha520098
Copy link
Author

hey @alexander0042 so i've seen the excellent work that you've done and i have paid for the subsribtion but I hit the limit again i do note its been over 2 weeks but i thought that this would have solved this issue, any chance you could have a look at this?

@alexander0042
Copy link
Collaborator

On it!

@alexander0042
Copy link
Collaborator

Sorry for the short update followed by silence, it is a weird issue! I checked a couple things, but nothing immediately jumped out.

Can you confirm if you subscribed on Apiable and what your e-mail address was (you can redact part of it if you'd like)? I've got a plan to figure this out once and for all, but first I need to extend your subscription so calls start working again

@LeonardoGandini
Copy link

LeonardoGandini commented Jun 18, 2024

Hi @alexander0042 just want to add that this is happening to my HA as well. Error communicating with API: 429, message='Too Many Requests', url=URL('https://api.pirateweather.net/forecast/API_KEY/44.8,9.2units=si&extend=hourly&version=2') in this HA I have 6 PW entries, different coordinates.
I have PW on 3 different HA installations and never had an issue for months, now on just one, this is happening. I was planning to finally upgrade my PW subscription then I saw @alpha520098 message. If you need extra info let me know

@alexander0042
Copy link
Collaborator

Hi @LeonardoGandini, thanks for helping to debug this issue! Just to confirm, you have 6 different locations configured, and do you know if you changed the update interval from the default? At the default 20 minute update interval, I believe that would exceed the 10,000 base limit which might explain this?

@alexander0042
Copy link
Collaborator

Also, in the meantime I upped your request limit, so you should see things start working again!

@LeonardoGandini
Copy link

Thanks it's working now. I didn't change the default settings I don't think 🤔
Is there a way to check how many requests are going from HA and/or reconfigure the integration interval without adding a new one?

@alexander0042
Copy link
Collaborator

If you turn on "debug logging" you should see something in your logs every time there's a new update. Default is 20 minutes, which should be enough for up to four different locations

@LeonardoGandini
Copy link

got it, apologies I might just be dumb, is there a way to change the scan_interval without removing and adding an Entry again?
I will upgrade my subscr anyway, as I'm planning to add other locations.

@alexander0042
Copy link
Collaborator

Not a dumb question at all! I really wish there was, but I can't figure out how to update an existing data coordinator once it's been created in Home Assistant (same problem with changing locations).

@jhemak
Copy link

jhemak commented Jun 18, 2024

@alexander0042 - perhaps you know this and know better than to try it. But once upon a time, I was able to find the integration in config\.storage\core.config_entries, edited scan_interval, rebooted, and was good to go. But, be careful not to mess up the file!

alexander0042 added a commit that referenced this issue Aug 15, 2024
- Corrects a small bug about platforms re: Issue #273
- Changes sensor reported times to datetimes re: Issue #275
- Allows for updating locations via hass re: Issue #241
- Allows changing the scan_interval re: Issue #230
@cloneofghosts
Copy link
Collaborator

As of V1.5.5 you can now edit the scan_interval in the integration configuration even after you've setup the integration.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
bug Something isn't working
Projects
Development

No branches or pull requests

5 participants