Darksky Weather Component Using Twice the API Calls it Should

About 3 days ago, my darksky sensor or weather more than doubled it’s number of requests and now is exceeding the allowed amount. I had the sensor set to 30 minutes, and it wasn’t going over about 550 a day previously with both the weather and sensor enabled. Now it runs out quite quickly. Was this broken in 0.84.6 when they added the additional days to the forecast? As soon as I fixed that, it started having this problem. Here’s my settings for the weather and sensor:

weather:
  - platform: darksky
    api_key: <REDACTED>
    name: Weather Forecast

sensor:

  - platform: darksky
    api_key: <REDACTED>
    update_interval:
      minutes: 30
    forecast:
      - 0
    monitored_conditions:
    - temperature_high
    - temperature_low
    - apparent_temperature_high
    - apparent_temperature_low
    - summary
    - icon
    - nearest_storm_distance
    - precip_type
    - precip_intensity
    - precip_probability
    - temperature
    - apparent_temperature
    - dew_point
    - wind_speed
    - wind_bearing
    - wind_gust
    - cloud_cover
    - humidity
    - pressure
    - visibility
    - ozone
    - minutely_summary
    - hourly_summary
    - daily_summary

I just use the sensor and my 10 minute update has been consistently making 144 calls to darksky per day as expected.

- platform: darksky
  api_key: !secret forcastio_api
  update_interval:
    minutes: 10
  monitored_conditions: etc...
1 Like

Are you using the new forecast: option? I suspect this is what’s causing it, as it’s the only thing that changed in my config.

So I disabled the darksky sensor completely, and it appears that the darksky weather component by itself is consuming pretty close to 1000 API calls per day, despite saying in the docs that it should only consume 480… Looks like someone changed that without thinking about those of us that like to use both the sensor and weather component. I’m changing the subject of this thread to reflect that it’s the weather component rather than the sensor which is the problem. Is anyone using both of them successfully in 0.84.6?

I’m on 84.6 with the update interval set at 2 minutes. I’m using the forecast option. The API site says I’m using 275 calls a day.

You are talking about only the darksky sensor then, as the weather component doesn’t have the setting for polling interval. I have isolated the problem as being in the weather component now.

Correct! Sorry to confuse the two!

No problem, it took me quite a while to figure out that there were 2 separate components as well… Once I did I wanted both of them, hence the problem I have now, where the weather component isn’t leaving enough API calls for the sensor to function.

Hello!

Is it possible to change the update interval on the weather component?

I am not referring to the mode parameter…

Thanks.

Supposedly you should be able to set it using scan_interval, but in my testing it’s had no effect when set as below:

weather:
  - platform: darksky
    api_key: !secret darksky_api_key
    mode: daily
    scan_interval: 300

Furthermore, the darksky weather component still appears to be consuming double the Api calls its supposed to. I have opened an issue below:

Thanks for your reply.

I’ve migrated to the Darksky weather componente since yahoo weather is deprecated. I now have both a sensor and weather components from Darksky running on my machine and I see double the usage of calls since then.

Maybe this will be fixed on a future release.

Thanks.

Cool, it would be great if you added your feedback to my issue above so I’m not the only one reporting the problem.

Here is my config and my usage as data points.

https://github.com/SilvrrGIT/HomeAssistant/blob/master/sensors/weather.yaml#L75

Note that I switched (likely on the 4th) to using the weather component, I was previously only using the sensor component.

Actually yours looks about right. It should use 480 API calls per day by default. What version are you running?

Version 84.5

Note that I have an update interval of 10 minutes on my sensors.

It seems to be 0.84.6 specific then. It also used to work correctly for me in 0.83.2, and I was successfully running both the sensor and weather component. Now unfortunately the weather component alone hogs up all the API calls, I can only run the sensor with a 2 hour refresh interval which isn’t really enough for my purposes.