Replacement for the default Dark Sky Home Assistant integration using Pirate Weather
This integration is designed to replace the defunct Dark Sky integration in Home Assistant with a modified and updated, 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://merrysky.net! To view the current API status check out the status page.
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! This project (especially the free tier) wouldn't be possibile without the ongoing support from the project sponsors, so they're the heros here!
If you get an AttributeError: PRECIPITATION
upon importing the integration please check that you are running HA 2022.10 or later. If you are running an earlier version please try updating your HA install and try the import again. If you are unable to update your version of HA then you can use the legacy branch instead.
While this integration is designed to be compatible with Dark Sky, the underlying code is significantly different. This version is designed to work with more modern versions of Home Assistant, and relies on asyncio, unified data update coordinators, and setup via the UI! A legacy branch that is a 1:1 replacement for the previous Dark Sky integration is also available, but is not recommended.
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.
Since the Dark Sky API has shut down, 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.
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://web.archive.org/web/20230128172320/https://www.home-assistant.io/integrations/weather.darksky/ for the weather card and here: https://web.archive.org/web/20230326100953/https://www.home-assistant.io/integrations/darksky for the sensor.
There are two methods to install this installation:
https://github.com/alexander0042/pirate-weather-ha
as a custom repositoryconfiguration.yaml
).custom_component
directory (folder) there, you need to create it.custom_components
directory (folder) create a new folder called pirateweather
.custom_components/pirateweather/
directory (folder) in this repository.The use to integration, click on the "Add Integration" button on the Integrations page in the Home Assistant Settings and search for Pirate Weather. This will open the add integration UI, shown below.
YAML configuration is still supported, but is depreciated and may be removed at some point in the future. If the integration detects an existing YAML integration, it will import and save it, allowing the yaml to be safely removed.
To use the integration via this approach, either add or edit to your configuration.yaml
file with this block, using the new API key:
weather:
- platform: pirateweather
api_key: <APIKEY>
# Additional optional values:
latitude: Location latitude
longitude: Location longitude
mode: "hourly" (default) or "daily"
name: Custom name
# you can also get a sensor data
sensor:
- platform: pirateweather
api_key: <APIKEY>
scan_interval: '00:15:00'
monitored_conditions:
- temperature
- precip_probability
- precip_type
- humidity
- cloud_cover
- nearest_storm_distance
- precip_intensity
- wind_speed