Pirate Weather Integrations
This integration is designed to replace the default Dark Sky integration in Home Assistant with a slightly modified, but fully compatible version that relies on the Pirate Weather API instead!
To get a feel for the data returned by this API, check out https://weather.pirateweather.net!
I'm really hoping to keep free access going for this API, but it does take money to run the AWS back-end. If you'd like to support this project, I have a sponsorship link setup on my profile!
Notices
This integration will take priority over the built-in Dark Sky integration. While it is deigned to be a drop in replacement, it is possible that small differences will occur. The underlying API should return similar results, but specific weather variables may be missing, and additional testing is needed to find and correct these edge cases. Please document any issues, and I can either update this integration or the weather API.
The two most notable missing pieces at the moment are the language options and text summaries. Both of those are possible with the way I have things designed, but I need to write the code that generates the text, and then feed that into the Dark Sky translation module. For now, the text will display whatever the icon is showing, and it will always be in English.
Why?
Since the Dark Sky API will be shutting down this year, I set out to write an alternative API that would return results with the identical syntax, allowing it to be used as a drop in replacement. This culminated in the Pirate Weather API, which is a series of AWS lambda functions that read, process, and serve NOAA weather forecasts in same style and syntax as the Dark Sky API did.
This integration allows for any Home Assistant setup that uses Dark Sky to continue operating after it shuts down. While other weather integrations are available, this preserves anything that relies on unique aspects of Dark Sky (such as the minute-by-minute forecast) and let’s existing dashboards keep working. Plus, if you're interested in knowing exactly how your weather forecasts are generated, this is the "show me the numbers" approach, since the data returned is directly from NOAA, and every processing step I do is documented. If you're the sort of person who wants a dense 34-page PowerPoint about why it rained when the forecast said it wouldn't, then this might be for you.
What It Does
This integration adds creates custom sensor.py
and weather.py
files to change their data source from Dark Sky to Pirate Weather. Specifically, these functions are built around the forecast.io python package, and so instead of calling forecastio.load_forecast
, they call forecastio.manual
, which allows for a different API URL to be used.
The only other change is to call the API every 15 minutes instead of every 3. I only just graduated, so trying to keep my AWS bill reasonable here. If you need a more frequent update interval, or would like to support this project, I've set up a donation link!
Documentation
Since this integration returns the same type of data as the default Dark Sky integration, the parameter documentation is the same as described at https://www.home-assistant.io/integrations/weather.darksky for the weather card and here: https://www.home-assistant.io/integrations/darksky/ for the sensor.
Installation
- Using the tool of choice open the directory (folder) for your HA configuration (where you find
configuration.yaml
). - If you do not have a
custom_component
directory (folder) there, you need to create it. - In the
custom_components
directory (folder) create a new folder calleddarksky
. - Download all the files from the
custom_components/darksky/
directory (folder) in this repository. - Place the files you downloaded in the new directory (folder) you created.
- Restart Home Assistant
- Register for a Pirate Weather API Key here: https://pirateweather.net/
- Log into the Pirate Weather API interface (https://pirateweather.net/apis), select
PirateForecast Beta
, and click Subscribe!
Either add or edit to your configuration.yaml
file with this block, using the new API key:
weather:
- platform: darksky
api_key: <APIKEY>