[RELEASE] Weather-Display With DarkSky.net Forecast Driver

[RELEASE] Weather-Display With DarkSky.net Forecast Driver


** PLEASE READ!!! This driver requires a Personal Weather Station with Weather-Display software and uses waynedgrant's json webservice that makes your weather station's data available to the driver. If you do have a PWS and you do not use Weather-Display software then this driver WILL NOT WORK FOR YOU! In this case, try my driver that does not require a PWS instead ...

UPDATE:
By Adam Grossman on July 1, 2020.

Update: Service to existing users and subscribers of the Android app will now continue until August 1, 2020, at which point the app will be shut down. Subscribers who are active at that time will receive a full refund. Weather forecasts, maps, and embeds available on the Dark Sky website will also shut down on August 1, 2020.


IMPORTANT NOTICE:

DarkSky has been acquired by Apple (Apple Acquires Weather App Dark Sky - MacRumors). Before proceeding with this driver make sure you either already have your API Key, or can get one, before they stop issuing those. The API will continue through the end of 2021, then it will not be available and this driver will no longer function.

Releasing this under a new name so the old driver will remain for those who are still using it. This basically just removes the ApiXU.com option from the previous driver since that will no longer be a viable option after October 14th due to the Weatherstack merger.

Some changes are introduced because of this removal of ApiXU:

  • Latitude and Longitude are pulled from the Hub so those are no longer an input. Make sure your Latitude and Longitude are set properly in your Hub settings. These are used both for the Sunrise/Sunset times and the DarkSky forecast location.
  • Prior driver used 'uv'/'UV' for ultravioletIndex. This has been changed to capability of "Ultraviolet Index" and now is exposed as 'ultravioletIndex'.
  • Prior driver had 'lux' as an attribute. This has been eliminated. Use the attribute 'illuminance' exposed by the capability "Illuminance Measurement", or the optional 'illuminated' attribute that adds the 'lx' unit indicator for a dashboard.

The driver exposes a default set of attributes for weather capabilities:

  • humidity
  • illuminance
  • pressure
  • temperature
  • ultravioletIndex
    Plus a small set of 'Required for Dashboard' attributes (used by SmartTiles/SharpTool.io, and maybe some others)
  • city
  • feelsLike
  • forecastIcon
  • localSunrise
  • localSunset
  • percentPrecip
  • weather
  • weatherIcon
  • wind

There are many other 'optional' attributes that can be selected if you need those exposed. It is best to keep those off if you do not require them as they will increase the Hub database size if selected. You can turn 'on' the 'Display All Preferences' then hit 'Save Preferences' to expose the optional attributes. Turn on those you want, turn off those you no longer want, then 'Save Preferences' again. You can turn off 'Display All Preferences' then 'Save Preferences' to hide those options and reduce the clutter on the driver display. NOTE: You do NOT have to select the optional attribute to allow those specific attributes to show in either the 'myTile' or 'weatherSummary' attributes (e.g. 'alert' will show in myTile and weatherSummary even if it is not selected). Optional attributes include:

  • alert: Weather Alert (DarkSky only)
  • betwix: Slice of Day
  • cloud: Cloud Coverage
  • condition_code: Condition Code
  • condition_icon_only: Condition Icon Only
  • condition_icon_url: Condition Icon URL
  • condition_icon: Condition Icon
  • condition_iconWithText: Condition Icon With Text
  • condition_text: Condition Text
  • country: Country
  • dewpoint: Dewpoint (in default unit)
  • fcstHighLow: Forecast High/Low Temperatures (DarkSky only)
    forecastHigh
    forecastLow
  • forecast_code: Forecast Code (DarkSky only)
  • forecast_text: Forecast Text (DarkSky only)
  • illuminated: Illuminance (with 'lx' added for use on a Dashboard)
  • is_day: Is daytime?
  • localSunrise: Display the Group of Time of Local Sunrise and Sunset
    tw_begin (Twilight begin)
    sunriseTime
    noonTime
    sunsetTime
    tw_end (Twilight end)
  • myTile: myTile for dashboard
  • moonPhase: Moon Phase
  • percentPrecip: Percent Precipitation
  • solarradiation: Solar Radiation
  • summarymessage: Weather Summary Message
  • precipExtended: Precipitation Forecast (DarkSky only)
    rainDayAfterTomorrow (probability of precipitation)
    rainTomorrow (probability of precipitation)
  • obspoll: Observation time for station and forecasts
    last_observation_Station (time of data observation)
    last_poll_Station (time poll was made)
    last_observation_Forecast (time of data observation)
    last_poll_Forecast (time poll was made)
  • precip_today: Precipitation today (in default unit)
  • state: State
  • vis: Visibility (in default unit) (DarkSky only)
  • wind_degree: Wind Direction (number)
  • wind_direction: Wind Direction (text)
  • wind_gust: Wind gust (in default unit)
  • wind_string: Wind string

Motivation for the work done in this new version was from @csteele and his improved wx-ApiXU-driver. This driver includes adapted versions of his asynchttp calls, the updated Lux (Luminance) code and the selectable attributes code. Without his work these would not be available in this driver.

IMPROVEMENTS:

  • All calls are now asynchttp to reduce Hub latency.
  • Most attributes are optional/selectable, choose only what you need to reduce unneccessary database buildup.
  • Eliminated 'State' variables to further reduce unneccessary DB buildup.
  • Astronomy data only polled three times a day.
  • Station data can be polled as often as every minute and is on it's own separate schedule.
  • Forecast can be polled as often as every five minutes and is on it's own schedule.
  • Can be used without an external forecast, or choose DarkSky.net as your forecast source.
  • Improved 'myTile' and 'weatherSummary'
  • Many, many corrections to the data presented.

NOT CHANGED:

  • Still requires a Personal Weather Station with Weather-Display software and uses waynedgrant's json webservice that makes your weather station's data available to the driver.
  • You may choose to use your weather station's Solar Radiation (for Lux), Ultraviolet and Apparent Temperature (feelsLike) or choose to get those from the DarkSky forecast source.
  • You will need your own DarkSky.net API key for the external weather forecast.
  • User selectable Date/Time formats.
  • User selectable units (imperial or metric, or can be mixed).
4 Likes

Stupid question time :slight_smile:

I have my Secret key from DarkSky, but getting this in the logs.

dev:58492019-09-12 20:21:25.865 errorWeather-Display weather api did not return data
dev:58492019-09-12 20:21:25.428 infoWeather-Display Driver - INFO: Polling Weather-Display
dev:58492019-09-12 20:21:20.357 infoWeather-Display Driver - INFO: Polling Sunrise-Sunset.org

Any tips?

Update, I used the API URL + Key + Long/Lat and its giving me data on the browser.

That error indicates that your driver is not returning any Weather-Display data. It hasn't gotten to DarkSky data yet. Make sure you have setup the JSON file creation from 'waynedgrant' and you have the correct location of that entered into the preferences.

1 Like

Damn, I should have read deeper instead of skimming. D'oh!

1 Like

So you do need a weather station in order to use the driver? Ican see I'm getting data back fromDarSky now.

Yes, you do. The driver will pull in the DarkSky forecast data, but it is not setup to pull in any 'Current' weather data from Dark Sky. The purpose of the driver is to pull the 'Current' weather from your own Personal Weather Station using Weather-Display software and suppliment that with the forecast data from DarkSky.

1 Like

Thank you. I had better put one on my "want" list :wink:

1 Like

Is this the current driver for Darksky?
GitHub - klkester/DarkSky-Weather-For-Hubitat-Dashboard

And how to add the weather icons to Hubitat after downloading it from deviantart.

Thanks.

Do you meet this requirement? If not, this driver will not work for you. If you meet this requirement just put the location where your DevianArt icons are in the preference input section and the driver will use those.
image

[UPDATED] V4.1.1 09/13/2019

  • Bug fixes.
  • Added 'Ozone' from DarkSky
  • Added 'nearestStorm' data from DarkSky .... but I am not sure about the validity of that data ... at least in my area is looks odd???

Would it be possible for this to integrate into the Weewx driver?

Weewx does the same thing as Weather-Display. There would be no need to have both in the same driver. I am certain someone could take this and alter it to make a version that would pull in Weewx data instead of Weather-Display data.

[UPDATED] V4.1.2 09/14/2019

  • some minor bug fixes
  • Made changes to Attributes. Attributes should now be available for dashboards. CAUTION - READ BELOW

ATTRIBUTES CAUTION
The way the 'optional' attributes work:

  • Initially, only the optional attributes selected will show under 'Current States' and will be available in dashboards.
  • Once an attribute has been selected it too will show under 'Current States' and be available in dashboards.
    <*** HOWEVER ***> If you ever de-select the optional attribute, it will still show under 'Current States' and will still show as an attribute for dashboards BUT IT'S DATA WILL NO LONGER BE REFRESHED WITH DATA POLLS . This means what is shown on the 'Current States' and dashboard tiles for de-selected attributes may not be current valid data.
  • To my knowledge, the only way to remove the de-selected attribute from 'Current States' and not show it as available in the dashboard is to delete the virtual device and create a new one AND DO NOT SELECT the attribute you do not want to show.

I wish there was a better solution ..... but I have not been able to find it. If anyone has ideas ..... please share.

[UPDATED] V4.1.3 09/14/2019

  • Added 'windSpeed' and 'windDirection', required by some dashboards.

[UPDATED] V4.1.4 09/14/2019

  • added 'weatherIcons' used for OpenWeatherMap Icons/dashboard.

[UPDATED]
V4.1.5
09/14/2019

  • Tweaking and bug fixes.

Alert attribute is missing when using it in RM. I was using alerts in RM from your previous driver to trigger an announcement when a Severe Thunderstorm Watch was issued. I ended up going back to the previous driver.

'alert' is one of the optional attributes now. In order to have it available for other apps/dashboards, you must turn it on then 'Save Preferences' . Do you have 'alert' turned on?

image

I did and it is not in the custom attributes when creating a trigger in RM.

I had to add it in your driver:

// The following attributes may be needed for dashboards that require these attributes,
// so they are listed here and shown by default.
attribute "alert", "string"
attribute "city", "string" //SharpTool.io SmartTiles

[UPDATED]
V4.1.6
09/15/2019

  • Another optional attribute bug fix. (thanks @CurtisZM!)