Open Mariusthvdb opened 2 years ago
I just got the same issue after updating.
Logger: homeassistant.config_entries
Source: config_entries.py:1067
First occurred: 4:47:36 PM (1 occurrences)
Last logged: 4:47:36 PM
Config entry 'Country Life Acres' for weatherbit integration not ready yet: Error requesting data from WeatherBit: 429, message='', url=URL('https://api.weatherbit.io/v2.0/current?lat=38.65259474700931&lon=-90.48935672384688&key=f77974adbc6d4efd91ae6ae0b4f69a73&lang=en&units=M'); Retrying in background
Followup: It's going over the request limit.
{"status_code":429,"status_message":"Your request count (585) is over the allowed limit of 500 per day - Upgrade your key, or retry after 129.85 minutes"}
right, I see that too now, maybe cause by the fact its installed on several devices..? how can we decrease that request count to fall under the 500 in that case?
wait, this seems the place:
Ive now increased from 5 to 10 minutes, which should be significant, lets see what happens next ;-)
In the settings on the integrations page you can increase the poll times. I set mine from 5 up to 10 minutes, didn't hit the limit today.
On Fri, Aug 19, 2022, 5:59 PM Marius @.***> wrote:
right, I see that too now, maybe cause by the fact its installed on several devices..? how can we decrease that request count to fall under the 500 in that case?
— Reply to this email directly, view it on GitHub https://github.com/briis/weatherbit/issues/73#issuecomment-1221153916, or unsubscribe https://github.com/notifications/unsubscribe-auth/ABMDZCEPZN6BTASHS3RQOHTV2AGW3ANCNFSM566UA55A . You are receiving this because you commented.Message ID: @.***>
haha we crossposted....
There is nothing that has changed in the part of the code that handles the frequencies of updates for month. I have now done some extensive testing just to verify that this is running as expected, and it does.
When you start up HA and the Integration, it performs two calls to Weatherbit on startup: 1 for the current data and one for the Forecast, and then it follows the schedule. So if default values are selected it makes 1 call every 5 minutes for the current data and 1 call every 30 min for the forecast. That means 288 call for current data per day and 48 calls for the forecast per day. That is 336 calls per day, and way below the 500 that is on the Free plan.
The above number also indicates that if you run more than 1 location, then you MUST lower the frequency of updates to ensure you do not hit the 500 calls limit.
Thans Bjarne.
I am not running more than 1 location, but have ofc more than 1 device running HA.
Suppose that should not matter ( considering it is the Ha server doing the requests?)
The above number (336 calls per day) is for each instance of Weatherbit running with 1 location setup. So if you use the Integration on two HA instances then you will get 2 x 336 calls per day.
Yeah. Understood. Running 1 instance only though...
I also only had one location being used...and still hit the limit. I've increased my polling times and not had problems since then.
well, Ive decreased the polling to 10 minutes, as explained above, and yet saw this:
2022-08-21 21:19:02.504 ERROR (MainThread) [custom_components.weatherbit] Error fetching weatherbit data: Error while retreiving data: Error requesting data from WeatherBit: 429, message='', url=URL('https://api.weatherbit.io/v2.0/current?lat=<lat>&lon=<lon>&key=<key>&lang=en&units=M&include=alerts')
2022-08-21 21:23:17.437 ERROR (MainThread) [custom_components.weatherbit] Error fetching weatherbit data: Error while retreiving data: Error requesting data from WeatherBit: 429, message='', url=URL('https://api.weatherbit.io/v2.0/forecast/daily?lat=<lat>&lon=<lon>&key=<key>&lang=en&units=M')
other than this, I have a few template sensors involving weatherbit sensors but don't think that would cause any extra polling?
and I have 1 card in HA frontend:
type: entities
header:
type: picture
image: /local/weather/weatherbit.png
tap_action:
action: url
url_path: !secret weatherio_api_url
hold_action:
action: call-service
service: homeassistant.reload_config_entry
service_data:
entry_id: b31782708171df0556b76c520ce103ed
but that url is only activated on a tap. Which didnt happen.
On holding the card above, I just saw all of my sensors disappear into the unknown..... tapping revealed the reason:
{"status_code":429,"status_message":"Your request count (536) is over the allowed limit of 500 per day - Upgrade your key, or retry after 215.26666666667 minutes"}
I haven't had any more problems, my settings are 10 and 45 for each of the sliders.
wait, checking the integration again, it reveals that the slider has moved back to 5 minutes...
so this is odd in itself.
ofc, next to the fact that Bjarnes calculation for polling seems to no stick somehow, and my numbers are topping that in the default settings
I've started getting this error the last couple of days. It appears that the free tier has been dropped to 50 calls per day.
You are absolutely right - just checked the website. I made adjustments now to the minimum and maximum values of the updates, but honestly, this leaves this integration somewhat useless. I don't use it myself anymore, as I get my data elsewhere, and this does not encourage me to spend too much time on it.
Changes will be in 1.0.14, which I will put out soon.
I will make a post on the Community Forum also.
Thanks
Yeah, pretty disappointing. Out of curiosity, what do you use as an alternative?
On Thu, Oct 13, 2022, 9:44 AM Bjarne Riis @.***> wrote:
You are absolutely right - just checked the website. I made adjustments now to the minimum and maximum values of the updates, but honestly, this leaves this integration somewhat useless. I don't use it myself anymore, as I get my data elsewhere, and this does not encourage me to spend too much time on it.
Changes will be in 1.0.14, which I will put out soon.
I will make a post on the Community Forum also.
Thanks
— Reply to this email directly, view it on GitHub https://github.com/briis/weatherbit/issues/73#issuecomment-1277730656, or unsubscribe https://github.com/notifications/unsubscribe-auth/ABMDZCCZGCIYH6HFDDALRCLWDAN4ZANCNFSM566UA55A . You are receiving this because you commented.Message ID: @.***>
Also looking at an alternative. I have mine set to 30 Minutes and 120 Minutes for the Sensor and Forecast yet still go over the limit by 12PM...
Now to find another option...
same here, since the last update i get to many requests
mine is set to 60 Minutes Sensor and 120 Minutes Forecast
{"status_code":429,"status_message":"Your request count (51) is over the allowed limit of 50 per day - Upgrade your key, or retry after 881.26666666667 minutes"}
but honestly, this leaves this integration somewhat useless. I don't use it myself anymore, as I get my data elsewhere, and this does not encourage me to spend too much time on it.
really sorry to hear Bjarne, I was an avid user, so thank you for your efforts nonetheless!
btw, what are you using for the sun intensity Weatherbit offered us? I cant seem to find a replacement for that
The alternative for me, is:
With the above I am covered for my needs, and as all these devices are local (Except for Forecast), I can pull data as often as I want. 😁
@B-Kramer @louispires
i use now openweathermap with Platinum Weather Card by @makin-things from HACS
Short Card
Long Card
in openweathermap config you have to use onecall_daily to get the forecast for 7 days
"i use now openweathermap with Platinum Weather Card by @Makin-Things from HACS"
The free openweathermap api doesn't seem to allow "onecall_daily" selection. I get an invalid api key error, but the key works on hourly selection. Also openweathermap doesn't provide solar radiation levels on the free api.
@greg520820
strange, i use onecall_daily and i use the free API
The problem is discussed here: https://github.com/home-assistant/core/issues/78241. It could be that you are on an earlier version of HA. It appears to have started on 2022.9.x.
On Sat, Oct 15, 2022 at 5:39 PM Bloodpack @.***> wrote:
@greg520820 https://github.com/greg520820
strange, i use onecall_daily and i use the free API
— Reply to this email directly, view it on GitHub https://github.com/briis/weatherbit/issues/73#issuecomment-1279836809, or unsubscribe https://github.com/notifications/unsubscribe-auth/AUMQW545HYTHHXDQAMMQ3GTWDMQC7ANCNFSM566UA55A . You are receiving this because you were mentioned.Message ID: @.***>
@greg520820
I have an very old API key possible they changed someting with new registrations
Here my Homeassistant versions
It appears the sensor call from the integration is counting as 2 calls by Weatherbit. Setting the sensor call at 60 minutes and the forecast update at 240 minutes the call count increases by 2 each hour. I'm finding the call usage by using https://api.weatherbit.io/v2.0/subscription/usage?key="API_KEY". I even set the forecast interval at 720 minutes and checked the call count after 5 hours and it was 10 instead of the expected 5.
Only thing I could find in the api was this statement " include=minutely,alerts (optional: Include a 1 hour / minutely forecast , and severe weather alert in the response) Counts as an extra request against quota."
I verified this is true by issuing a https://api.weatherbit.io/v2.0/current?lat=39.xxx&lon=--84.xxxx&key=xxxxxxx5258edb290xxxxd62&include=minutely and another without the "include=minutely" The first counted as 2 calls the last as 1 call. So maybe the integration is requesting the severe weather alert and that is counting as another call.
Is there a way to modify the code so it doesn't request the severe weather alert to see if this is the issue?
I would really like to get 1 hour sensor updates and 6 hour forecast interval, which should only be 28 calls, well within the 50 limit. I get severe weather alerts from another source (NWS).
Any help would be appreciated.
Thanks @greg520820 for checking this. I was not aware that adding the alert would generate an extra call - here we go, maybe I should be more carefully in reading the docs 😁 Yes I could remove the automatic Weather Alert pull, it is a simple operation. But I would then have to add some extra config options for the people who want the Alerts, with the extra call this makes. Let me see what I can do over the weekend.
Thanks for looking at this. I've tried to find another source for similar information, but 16 days of daily forecasts with a full compliment of sensors, especially the solar radiation sensor, doesn't seem to exist. Your integration is great at pulling and presenting the data.
I will say that weather alert information is available from many sources, but being able to select if you wanted alert information would be ideal.
Making the Alert pull selectable will certainly help with the 50 call limit. I tried to understand the code and the Alert pull seems to be hard-coded in the pyWeatherbitdata module? So I was not able to remove the Alert pull to checkout it out. According to Weatherbit most stations only update sensors every 15 to 30 minutes and forecasts every hour. So very short update intervals for the integration are often just pulling the same information from Weatherbit.
To evaluate the number of pulls I setup another free Weatherbit key using another email address. Not sure this would even be possible, but could the code be modified to allow two keys to be entered. Use one key for 50 pulls and then switch to second key? Or use the key until the "too many pulls error" was returned and then switch to other key. This would allow sensors, forecasts, and alerts to be retrieved with reasonably intervals.
if I would only use this for irradiance.... would that be possible at all, and stay within limits? Dont need the forecasts, or alerts. As Bjarne said, those can be had elsewhere. I havent found the irradiation however. and, ofc, that must be update at least hourly during the day
With the current integration each call for irradiance level uses two calls, since sensors (which includes irradiance) and Alerts are combined in one call. This would allow for a sensor update interval of 60 minutes with forecasts unselected. This assumes you do not restart Home Assistant multiple times each day. Each time Home Assistant is restarted is would use two calls to initialize the sensors data.
If @briis is able to modify the integration to make Alerts optional/selectable then the sensor/irradiance interval could be set at 30 minutes and still stay within the 50 calls per day limit. The weather stations used by Weatherbit updates the sensor data every 15 to 30 minutes. So a 30 minute interval would work okay.
I have just released 1.0.15. Here are the release notes for that:
BREAKING CHANGE This version now completely removes the Alerts from Weatherbit. As it turned out, even though I only did 1 REST call to Weatherbit to get Current, Forecast and Alert Data, the Alert data counted as an extra call. So by removing this, the Integration is a bit more usefull, after Weatherbit reduced the number of Free Calls per day from 500 down to 50. Removing the Alert part is the best option, as this data is available in a few other specialized integrations like MeteoAlarm.
I have no plans of bringing that back as an option. Use one of the other Alert Integrations. I have not done a lot of testing, but it runs here at my site. Let me know how this works out for you all.
Magic. Thank you Bjarne! For your continued efforts!
Meanwhile I found the tomorrow.io integration to carry an irradiance sensor, but I am not sure it's the same as Weatherbit s info.
Just letting you know.
Again: appreciated!!
I have given this some time (as in days), but Integration wont setup anymore:
is this a know issue right now? Or did something go Amis in updating to HA 2022.8.6...
thanks!