Replacement for the default Dark Sky Home Assistant integration using Pirate Weather

Overview

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!

Buy Me A Coffee

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

  1. Using the tool of choice open the directory (folder) for your HA configuration (where you find configuration.yaml).
  2. If you do not have a custom_component directory (folder) there, you need to create it.
  3. In the custom_components directory (folder) create a new folder called darksky.
  4. Download all the files from the custom_components/darksky/ directory (folder) in this repository.
  5. Place the files you downloaded in the new directory (folder) you created.
  6. Restart Home Assistant
  7. Register for a Pirate Weather API Key here: https://pirateweather.net/
  8. 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>
Comments
  • Testers needed for config flow integration update

    Testers needed for config flow integration update

    Hi everyone,

    Since I launched this a year ago, I've been blown away by the enthusiasm and support I've received for this project! It's been amazing to hear all the different use cases, and the API has improved considerably over the past 12 months.

    One important update is to modernize this integration away from just relying on the Home Assistant Dark Sky integration to one that can be setup from the GUI, uses coordinated updates, and supports modern Home Assistant API calls. In short, this is that update.

    For anyone interested, I'm looking for some people to try out the new version and get some feedback on what works, what doesn't and where the rough edges are. From my testing, everything seems stable, but since this is a major change I want to test it out as much as possible before a wider release.

    As a starting point, this version should behave exactly the same way the production one currently does. If you have an entry in your configuration.yaml. then a new weather entity and/or sensors will be created, and should be identical. Anything else is a bug. Moreover, this integration should now be able to be set up from the GUI integrations page, producing the same integrations that currently exist.

    To install and test this version, you'll need to manually patch the "dev-config-flow" branch into your custom_components directory using SSH and restart Home Assistant Core:

    cd "/config/custom_components/"
    mv "/config/custom_components/pirateweather/manifest.json" "/config/custom_components/pirateweather/manifest.json.old"
    mv "/config/custom_components/pirateweather" "/config/custom_components/pirateweather.old"
    git clone --branch dev-config-flow https://github.com/alexander0042/pirate-weather-ha.git
    mv "/config/custom_components/pirate-weather-ha/custom_components/pirateweather" "/config/custom_components/pirateweather"
    

    The two outstanding known issues are cleaning up the text options for the monitored conditions, and updating the installation instructions in the README, but I'm sure more will crop up as people start using this version.

    Thanks again for the help, and let me know it goes!

    help wanted 
    opened by alexander0042 61
  • After removing pirateweather references from config.yaml, 0d sensors not present

    After removing pirateweather references from config.yaml, 0d sensors not present

    hey @alexander0042 ... I was looking at my logs and they said to remove the pirateweather references from my config.yaml as they were no longer needed - I did, but now I no longer have access to those 0d sensors. Did I miss something, or did the logs mislead me?

    This error originated from a custom integration.
    
    Logger: custom_components.pirateweather.weather
    Source: custom_components/pirateweather/weather.py:137
    Integration: Pirate Weather (documentation, issues)
    First occurred: 10:26:59 AM (1 occurrences)
    Last logged: 10:26:59 AM
    
    Configuration of Pirate Weather (weather entity) in YAML is deprecated Your existing configuration has been imported into the UI automatically and can be safely removed from your configuration.yaml file
    

    Originally posted by @chicknlil in https://github.com/alexander0042/pirate-weather-ha/issues/58#issuecomment-1328074700

    opened by chicknlil 34
  • sunset_time & sunset_time sensors missing

    sunset_time & sunset_time sensors missing

    Hi!

    I have added the following to my config monitored_conditions:

    - sunset_time
    - sunrise_time
    

    However, these sensors do not appear. Is there something special about them?

    documentation 
    opened by JCHH2 29
  • FEATURE REQUEST: History

    FEATURE REQUEST: History

    Based on past issues I know you were looking for other ways to build this out so I thought I would drop this here and if nothing comes of it no big deal.

    1. I dont know if im missing this but there isnt an attribute for precipitation. This would be useful.
    2. Would be nice to have history based on the last 24 hours/week in a sensor/weather card/ anything i can pull from. My use case is i currently poll an outside/alternative weather api hourly to find the last 24 hours worth of precipitation gauge against if i should run my sprinklers. I have my own automation then adding that up so over the course of the past week if that number is too high it wont run them either. This might be a hyper specific use case but ive seen a lot of people in the community looking for/using similar data points and i would love to keep this local to your integration rather than using a few different apis which all pull from different sources. less points of failure.

    Thanks!

    documentation 
    opened by Scags104 19
  • Using 2 locations with PirateWeather... worked in DarkSky...

    Using 2 locations with PirateWeather... worked in DarkSky...

    I have the following config, I have installed PirateWeather via HACS and renamed the folder to darksky. It appears that my local home location is indeed being used, but my secondary location is not populated. This config worked in darksky, can I not look at 2 locations?

    #### PirateWeather acting as DarkSky ####
      - platform: darksky
        api_key: xxxxxxx
    # Additional optional values:
        mode: "daily"
        name: Homer
        scan_interval:
    # At least one of these must be specified:
          days: 0
          hours: 0
          minutes: 5
          seconds: 0
          milliseconds: 0
        
    #### PirateWeather acting as DarkSky ####
      - platform: darksky
        api_key: xxxxxxxxxxx
        name: Greenup
        latitude: 39.2478159
        longitude: -88.1633719
        mode: daily
        scan_interval:
      # At least one of these must be specified:
          days: 0
          hours: 0
          minutes: 15
          seconds: 0
          milliseconds: 0 
    

    image

    Adding my sensor config...

    - platform: darksky
      api_key: !secret pirateweather-api
      forecast:
          - 0
          - 1
          - 2
          - 3
          - 4
          - 5
      monitored_conditions:
        - summary
        - icon
        - temperature
        - summary
        - precip_probability
        - apparent_temperature
        - wind_speed
        - wind_gust
        - wind_bearing
        - humidity
        - temperature_high
        - temperature_low
        - nearest_storm_distance
        - nearest_storm_bearing
        - minutely_summary
        - hourly_summary
        - daily_summary
      scan_interval:
        # At least one of these must be specified:
        days: 0
        hours: 0
        minutes: 15
        seconds: 00
        milliseconds: 0
    
    opened by mattlward 13
  • Reported wind speed is higher than actual

    Reported wind speed is higher than actual

    Residing in Central Ohio, USA here. The wind speed is being reported in the low 40mph range, but is actually much much lower (I fly drones which is I'm noticing).

    bug 
    opened by tvtechdir 12
  • hPa decimals

    hPa decimals

    Thanks for your work; love it!

    But how do I round the decimals for hPa using Pirateweather? When using yr.no or Swedish SMHI as provider, there are "normal" decimals...

    Screenshot 2021-09-17 at 14 45 20
    opened by TheLordVader 10
  • Precipitation is null

    Precipitation is null

    Many thanks for maintaining this integration. I am trying to compare different forecasters using the custom:apexchart-card. One of the plots is several different weather providers forecast for precipitation. I don't know what darksky did/does, but all of the other ones return the number zero for no precipitation, but pirateweather returns 'null'. Could this be changed to zero, also? Is this maybe something that needs to be addressed at pirateweather.net? Or, is it there to keep correspondence with darksky?

    opened by jds11111 9
  • Icons

    Icons

    The last two nights at my location it got foggy overnight but when I checked the website it showed a visibility value of 0.1km but it did not show the fog icon.

    As far as I am aware a visibility under 1km is considered fog though it might need to be over 75% humidity like Mist needs to be otherwise it would be considered Haze/Smoke/etc.

    If you need an example here is Thunder Bay, Ontario where it has a visibility of 0.1km. The two blank icons on the weather page are the fog icons (that also needs to be fixed) and checking the api it seems that it shows when the visibility is exactly 0. image

    bug 
    opened by cloneofghosts 9
  • Sensor name doesn't act as expected and renaming creates orphans

    Sensor name doesn't act as expected and renaming creates orphans

    I am using the precip_probability monitored condition and my app is up-to-date.

    The name of the sensor that gets created ends up as a concatenated string of 'Name' and sensor type (I think) instead of using just the 'Name'.

    I set the sensor name to Zebra in my sensors.yaml file:

    - platform: pirateweather
      name: Zebra
      api_key: 6mwfdaJRNy39nrnNIUXwXhUV7FxSmbZ8HSW9m253
      scan_interval: "00:05:00"
      monitored_conditions:
        - precip_probability
    

    You can see in this screenshot, the newest sensor with 'Zebra' in the name contains more than just Zebra. Further, renaming the sensor in the config leads to some duplicate orphan sensors: List of random sensors

    Not sure what other info will be useful or what troubleshooting I can do. Thanks!

    opened by joaldes 8
  • Unable to connect to PirateWeather - CertificateError

    Unable to connect to PirateWeather - CertificateError

    When HA starts, I'm getting the following error: 2022-05-27 19:27:28 ERROR (SyncWorker_3) [custom_components.pirateweather.weather] Unable to connect to PirateWeather. HTTPSConnectionPool(host='api.pirateweather.net', port=443): Max retries exceeded with url: /forecast/om3xxPNoEt94XXXXXXXXXXCM78xtHiJ2s5iZsYa/XX.XXX50780789178,-XXX.XXX9254007341?units=us (Caused by SSLError(CertificateError("hostname 'api.pirateweather.net' doesn't match either of 'susi.comcast.net', '*.aws-np.susi.comcast.net', '*.aws-np.susi.xfinity.com', '*.aws.susi.comcast.net', '*.aws.susi.xfinity.com', '*.susi.comcast.net', '*.susi.xfinity.com', 'register-dev.xfinity.com', 'register-ng.xfinity.com', 'register-qa.xfinity.com', 'register-st.be.xfinity.com', 'register-st.xfinity.com', 'register-wg-st.bi.xfinity.com', 'register-wg-st.xfinity.com', 'register-wg.bi.xfinity.com', 'register-wg.xfinity.com', 'register.be.xfinity.com', 'register.xfinity.com'")))

    Yet when I visit the URL directly I get valid JSON: https://api.pirateweather.net/forecast/om3xXXXXXXXXXXXXXXXXXn3fCM78xtHiJ2s5iZsYa/XX.XX450780789178,-XXX.XXX29254007341?units=us

    (sensitive info redacted)

    Running: e95083f HA: 2022.5.5 In Docker; official container

    I'm not understanding why it's trying to compare api.pirateweather.net with a .xfinity.* cert.

    opened by xstrex 8
  • sensor.pirateweather_temperature is using native unit of measurement

    sensor.pirateweather_temperature is using native unit of measurement

    After Update to HA 2023.1 I get following warning în logs

    Logger: homeassistant.components.sensor Source: components/sensor/init.py:980 Integration: Sensor (documentation, issues) First occurred: 00:00:45 (2 occurrences) Last logged: 00:00:45

    Entity sensor.pirateweather_temperature (<class 'custom_components.pirateweather.sensor.PirateWeatherSensor'>) is using native unit of measurement 'None' which is not a valid unit for the device class ('temperature') it is using; Please update your configuration if your entity is manually configured, otherwise report it to the custom integration author. Entity sensor.pirateweather_humidity (<class 'custom_components.pirateweather.sensor.PirateWeatherSensor'>) is using native unit of measurement 'None' which is not a valid unit for the device class ('humidity') it is using; Please update your configuration if your entity is manually configured, otherwise report it to the custom integration author.

    opened by smarthomefamilyverrips 0
  • Integration is using deprecated `DEVICE_CLASS_*` constants

    Integration is using deprecated `DEVICE_CLASS_*` constants

    This custom integration uses deprecated DEVICE_CLASS_* constants in its codebase.

    The DEVICE_CLASS_* constants have been deprecated and replaced in Home Assistant Core 2021.12 (over a year ago). I would highly suggest updating/migrating this integration to the new enums.

    For example, for the device classes supported by the sensor platform, there is now a SensorDeviceClass enum. So if a sensor previously used the DEVICE_CLASS_ENERGY constant, it should now use SensorDeviceClass.ENERGY. Other platforms (like binary_sensor, and number) provide similar enumerations for their supported device classes.

    The migration thus only consists of replacing constants with an enumeration member and is, therefore, very low impact and should be fairly straightforward.

    If I can help resolve any questions regarding this change or migration, feel free to ask or respond to this issue. I'm happy to help!

    Kindest regards,

    ../Frenck

    opened by frenck 0
  • no weather entities created

    no weather entities created

    I installed via HACS and set API key. only activated weather - but here is no entitie created nor a lovelace card. only the default weather forecast from hass shows up.

    any suggestion how to debug?

    opened by trackhacs 3
  • No module named '_bz2'

    No module named '_bz2'

    Version | core-2022.12.8
    
    Installation Type | Home Assistant Core
    Development | false
    Supervisor | false
    Docker | false
    User | homeassistant
    Virtual Environment | true
    Python Version | 3.10.5
    Operating System Family | Linux
    Operating System Version | 5.10.0-20-amd64
    CPU Architecture | x86_64
    

    After installing version 1.0 , I get the following error:

    Logger: homeassistant.config_entries
    Source: config_entries.py:834
    First occurred: 16:35:07 (1 occurrences)
    Last logged: 16:35:07
    
    Error occurred loading configuration flow for integration pirateweather: No module named '_bz2'
    
    opened by conrad66 1
  • Forecast is way off for whole country or so or seems

    Forecast is way off for whole country or so or seems

    Hey,

    The Api had been quite imprecise lately. Its been telling me sunny last couple of days, when it's been nothing but cloudy. I tried changing locations but it keeps saying sunny, while other forecasters are more precise.

    I live in the Netherlands.

    opened by JBakers 7
Releases(v1.0.1)
  • v1.0.1(Dec 29, 2022)

  • v1.0.0(Dec 21, 2022)

    This is a major rewrite of this integration to allow it to be added via the UI, optimize API calls via an update coordinator, and generally bring it into compliance with modern Home Assistant standards. Existing configuration.yaml setups should be seamlessly integrated, and can be safely removed after the initial start.

    A major thank you to everyone who has helped this project by sponsoring it, debugging this update, providing feedback, and using it! This integration and API have come a long way in the last year, and wouldn't have been possible without the support I've received from the community.

    Source code(tar.gz)
    Source code(zip)
Fetch fund data from avanza.se using Python and some web scraping with bs4

Py(A)vanza Fetch fund data from avanza.se using Python and some web scraping with bs4. The default way is to display the data in the terminal, apply -

dunderrrrrr 1 Jan 27, 2022
RDMAss - A Python Discord bot creating an interaction with RDM API

RDMAss A Python Discord bot creating an interaction with RDM API. Features Assig

5 Sep 21, 2022
This project, search all entities related to A2P in twilio

Mirror A2P Twilio This project, search all entities related to A2P in twilio (phone numbers, messaging services, campaign, A2P brand information and P

Iván Cárdenas 2 Nov 03, 2022
SongLink Discord Bot - Discord bot to share music links easily

SongLink_Discord_Bot Discord bot to share music links easily. Take a link from y

Edgar Lefevre 4 Feb 18, 2022
A Discord.py bot which can adjust a voice channel's bitrate depending on the number of users connected.

discord_bitrate_bot A Discord.py bot which can adjust a voice channel's bitrate depending on the number of users connected. Programmed to be run on a

1 Feb 10, 2022
Generate visualizations of GitHub user and repository statistics using GitHubActions

GitHub Stats Visualization Generate visualizations of GitHub user and repository

Jun Shi 3 Dec 15, 2022
SEBUAH TOOLS CRACK FACEBOOK & INSTAGRAM DENGAN FITUR YANGMENDUKUNG

SEBUAH TOOLS CRACK FACEBOOK & INSTAGRAM DENGAN FITUR YANGMENDUKUNG

Jeeck X Nano 1 Dec 27, 2021
A Telegram Repo For Devs To Controll The Bots Under Maintenance.This Bot Is For Developers, If Your Bot Is Down, Use This Repo To Give Your Dear Subscribers Some Support By Providing Them Response.

Maintenance Bot A Telegram Repo For Devs To Controll The Bots Under Maintenance About This Bot This Bot Is For Developers, If Your Bot Is Down, Use Th

Vɪᴠᴇᴋ 47 Dec 29, 2022
Ulaavi for nuke, helps to keep our stocl elements organised.

Ulaavi Ulaavi for nuke, helps to keep our stock elements organised. Installation Downlaod ffmpeg from ffmpeg.org linux : https://johnvansickle.com/ffm

Arun Subramaniyam 17 Aug 24, 2022
Multi-purpose bot made with discord.py

PizzaHat Discord Bot A multi-purpose bot for your server! ℹ️ • Info PizzaHat is a multi-purpose bot, made to satisfy your needs, as well as your serve

DTS 28 Dec 16, 2022
VideoMergeDcBot1 - Video Merge Dc Bot for telegram

VIDEO MERGE BOT An Telegram Bot Demo 👉 @VideoMergeDcBot To Merge multiple Video

Selfie SD 2 Feb 04, 2022
Battle.net and PlayStation title watcher that reports updates via Discord.

Renovate Renovate is a Battle.net and PlayStation title watcher that reports updates via Discord. Usage Open config_example.json and provide the confi

Ethan 1 Nov 23, 2022
A Telegram Bot which notifies the user when a vaccine is available on CoWin Platform.

Cowin Vaccine Availability Notifier Telegram Bot A bot that notifies the available vaccines at given district in realtime. Introduction • Requirements

Arham Shah 7 Jul 31, 2021
A Collection Manager for the objkt.com Minting Factory

Objkt Collection Manager A Collection Manager for the objkt.com Minting Factory. This contract can create a collection on objkt.com and mint into it.

Asbjorn Enge 5 Nov 22, 2022
A GitHub Actions repo for tracking the dummies sending free money to Alex Jones + co.

A GitHub Actions repo for tracking the dummies sending free money to Alex Jones + co.

Egarok 2 Jul 20, 2022
Free TradingView webhook alert for basic plan users.

TradingView-Free-Webhook-Alerts Project start on 01-02-2022 Providing the free webhook service to the basic plan users in TradingView. Portal ↠ Instal

Freeman 31 Dec 25, 2022
Telegram Bot to check covid vaccine slot availability on CoWin site

Cowin Assist Telegram Bot Check the bot here @cowinassistbot. This is a simple Telegram bot to Check slots availability Get an alert when slots become

32 Jun 21, 2022
Unofficial WebApp for WhatsApp Web created in PyQt6

Unofficial WebApp for WhatsApp Web created in PyQt6 using PyQt6-WebEngine

Rafael Tosta Santos 126 Dec 20, 2022
SI_EXPLAINER_tg_bot: This bot is an assistant for medical professionals in interpreting the results of patient clustering.

SI_EXPLAINER_tg_bot This bot is an assistant for medical professionals in interpreting the results of patient clustering. ABOUT This chatbot was devel

Alexander Kanonirov 1 Jan 21, 2022
A self hosted slack bot to conduct standups & generate reports.

StandupMonkey A self hosted slack bot to conduct standups & generate reports. Report Bug · Request Feature Installation Install already hosted bot (Us

Muhammad Haseeb 69 Jan 01, 2023