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

Question about scan_interval #209

Closed
7 tasks done
jhemak opened this issue Apr 1, 2024 · 7 comments
Closed
7 tasks done

Question about scan_interval #209

jhemak opened this issue Apr 1, 2024 · 7 comments
Labels
documentation Improvements or additions to documentation

Comments

@jhemak
Copy link

jhemak commented Apr 1, 2024

Describe the issue

Regarding the comment on #88 that there's little value of a scan_interval more frequent that 15 min... is that also the case for Alerts? Or would a shorter scan_interval cause new alerts to be received in HA more quickly?

Home Assistant version

No response

Integration version

No response

Troubleshooting steps

  • I have updated my Home Assistant installation to the latest version.
  • I have updated the Pirate Weather Integration to the latest version.
  • I have gone through the documentation, parameter documentation and sensor documentation before opening this issue.
  • I have searched this repository and Pirate Weather Repository to see if the issue has already been reported.
  • I have restarted my Home Assistant installation.
  • I have checked to see if the issue is not an API issue.
  • I have written an informative title.
@cloneofghosts
Copy link
Collaborator

As mentioned in the other issue all the sensors and weather are updated at the same time so a lower update interval would update everything faster.

I'm not sure how fast the alerts data is processed on the API side so I'll tag @alexander0042 and he can let you know how often alerts get intergrated. I would think it would be faster than every 15m but I can't say for sure.

@alexander0042
Copy link
Collaborator

Great question, and should be improved in the docs.

The main reason to go faster than 15 minutes is if you want the currently to reflect the best guess at the current time, but realistically, I don't think it would make sense in the fast majority of cases. Since the currently is (linearly) interpolated from the nearest points, if the temperature was changing very quickly, you'd see more accurate currently data with a faster update interval, but that really is an edge case.

With respect to alerts, they're ingested every 15 minutes, so that's the limit there. TBH, I would rather a faster ingest, but it's surprisingly computationally expensive to do, since I have to turn all the polygons into gridded data, so gets expensive.

@jhemak
Copy link
Author

jhemak commented Apr 4, 2024

Thanks guys! This is very helpful. Unfortunately, what I thought might have been an update frequency issue seems to be something else. During a recent storm, the NWS was putting out many alerts for my location -- I saw them at alerts.weather.gov, in the Weather Channel app, and in another HA integration which was getting them in what seemed almost real-time. At one point, there were 7 active alerts from NWS showing in those three places, but sensor.pirateweather_alerts showed only 1. At other times, there were lower number of active alerts from NWS, but this integration never went above 1. Could there be a bug?

@jhemak
Copy link
Author

jhemak commented Apr 6, 2024

It appears that it may come down to this how the NWS API is being queried. When using GPS coordinates, as I think this API does, then it seems only zone-based alerts are included in the response. When querying, as the other integration does, with NWS Zone and County codes, then the complete set of relevant alerts is returned.

@alexander0042
Copy link
Collaborator

Oh yea, that makes sense. Right now I'm only ingesting zone based ones, since they have GPS coordinates; however, NWS puts out a whole range of things using a number of different geocoding approaches. I didn't think there would be much my the way of differences, but let me know if this happens more frequently and I can look into ingesting them somehow

@jhemak
Copy link
Author

jhemak commented Apr 9, 2024

Yes, it seems this is a frequent occurrence. For this to be a useful feature of the API/integration, it would probably be necessary to make this change. In the meantime, I am going to use the other integration to get the NWS alerts since it has all the alerts and refreshes every minute. Thanks for all your work on PW!

@cloneofghosts cloneofghosts added the documentation Improvements or additions to documentation label Apr 17, 2024
@cloneofghosts
Copy link
Collaborator

Thanks for opening this issue. There is an existing issue about improving the alerts in the API repository here Pirate-Weather/pirateweather#118. There is also #211 to improve the API documentation so I'll close this issue.

@github-actions github-actions bot locked and limited conversation to collaborators Jun 25, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
documentation Improvements or additions to documentation
Projects
Development

No branches or pull requests

3 participants