custom-components / weatheralerts

A sensor that gives you weather alerts from alerts.weather.gov.
MIT License
126 stars 15 forks source link

Thousands of DNS Queries Per Day Made to "api.weather.gov" #67

Closed jhemmond closed 2 years ago

jhemmond commented 2 years ago

My AdGuard local DNS shows that every 30 seconds two DNS requests are fired to api.weather.gov

https://imgur.com/a/TVt6e6K

This just happened last week out of the blue. Please let me know if I can help with anything specific. My setup is:

jlverhagen commented 2 years ago

This is not a bug or "issue" per se, it's just the way the integration works. The weatheralerts integration polls the api.weather.gov NWS weather alerts API URL for active weather alerts. By default, the integration polls the API every 30 seconds. This polling interval can be changed by changing the scan_interval setting in the YAML package, if you are using the YAML package, or by adding the scan_interval setting to your weatheralerts YAML configuration. If you live in an area where you don't get severe weather, like tornados or flash floods, you can probably increase the scan_interval setting to decrease the number of times per day the integration polls the NWS weather alerts API. If you do live in an area with the potential for severe weather, I recommend leaving it set at the default 30 seconds.

As long as AdGuard isn't blocking the DNS queries or the http requests to api.weather.gov, there isn't any problem and it looks like everything is working as it should be.

jhemmond commented 2 years ago

Thank you for the detailed answer! _Do you mind sharing where to add the scan_interval into the YAML package? I searched my weatheralerts1.yaml and couldn't find anything.

EDIT: I found the answer in the documentations 👍