[RELEASE] DarkSky.net Weather Driver, no PWS Required

That is what I figured, I guess I will just add all the conditions in the rule as a custom attribute. Before I just used the condition code number and ">"

What is the "nt" in front of the condition stand for?

'nt_' is for 'nighttime.' Many of the icons used are different for the same condition between 'day' and 'night.'

Anyone know if its possible to have multiple values for "contains" in RM when using a custom attribute and also how you separate the values?

[UPDATED]
V1.0.9
09/16/2019

  • Added a log entry when schedule changes from Daytime <--> Nighttime.
  • Although icons remain in the same location (https://raw.githubusercontent.com/HubitatCommunity/WeatherIcons/master/), I have created a TinyURL that reduces the number characters in the path to about 40% of the direct path. This is important as the 'myTile' has seven icons and the full path to those adds to the character limit of a dashboard tile. The TinyURL is: https://tinyurl.com/y6xrbhpf/ . This is now the default for new installations. Existing installations will NOT automatically switch to this. Existing installations should change the preference setting for 'Alternative Icon Location' to this TinyURL.

image

2 Likes

Awesome work on the driver, @Matthew!

It looks like the values of two attributes might be swapped.

  • weather should be a description of the weather
  • forecastIcon should be a Weather Underground compatible icon name (for legacy purposes)

It seems like the values for weather and forecastIcon should be swapped around line 479.

    //`forecastIcon` should be a code and `weather` should be a description
    sendEvent(name: "forecastIcon", value: getDataValue("condition_code"))
    sendEvent(name: "weather", value: getDataValue("condition_text"))

Otherwise the weather description displays a condition code:

1 Like

[UPDATED]
V1.1.0
09/18/2019

  • Changed 'forecastIcon' from 'condition_text' to 'condition_code' and 'weather' from 'condition_code' to 'condition_text' (see discussion above).
  • Randomized scheduled start times. This will now pick a random seconds, minutes and/or hours to initiate schedules. I did this so when thousands of users are all polling DarkSky with this driver :smiley: they will not all poll at the exact same time. It will still honor the polling frequency selected in preferences.
  • Added the 'Powered By DarkSky' attribution required by their TOS to both the myTile and the weatherSummary. There is also now an attrbute called 'DSattribute' with the logo and hyperlink. Since there is a 'Light' and a 'Dark' text option you can select your choice of which to use in the preferences. (if you have a light colored background the 'Light' text option may not be visible and if you have a dark colored background the 'Dark' text may not be visible). Four new icons added into WeatherIcon repository. If you copied these to another location you should refresh those files.
3 Likes

Hi Matthew.
Have you put the new version up yet?
Last Update history still says 1.0.9.
Thanks.

Sorry about that. The update is there now.

3 Likes

Does the api expose the chance of precipitation in the next hour?

https://darksky.net/dev/docs

It looks like that is available. However, this driver is not pulling in hourly data so that is not exposed.

EDIT: I just looked. The current JSON being returned by DarkSky in this device is just over 8,600 characters. If hourly forecast data is included in grows to over 25,000 characters.

Ok and I guess that poses performance and memory issues?

Honestly .... I don't now? My guess is ... yes. It just seems to me that wanting one data element (of a historically inaccurate hourly precipitation forecast) at the cost of tripling the size of the data pull makes me question it's value? But that is just my opinion. So, if we poll the hourly forecast we get 48 hours of data for the following data elements:

  "hourly": {
      "summary": "Rain starting later this afternoon, continuing until this evening.",
      "icon": "rain",
      "data": [{
          "time": 1509991200,
          "summary": "Mostly Cloudy",
          "icon": "partly-cloudy-day",
          "precipIntensity": 0.0007,
          "precipProbability": 0.1,
          "precipType": "rain",
          "temperature": 65.76,
          "apparentTemperature": 66.01,
          "dewPoint": 60.99,
          "humidity": 0.85,
          "pressure": 1010.57,
          "windSpeed": 4.23,
          "windGust": 9.52,
          "windBearing": 230,
          "cloudCover": 0.62,
          "uvIndex": 1,
          "visibility": 9.32,
          "ozone": 268.95
      },
    ...
    ]
  },

What would you want the driver to expose? Just "precipProbability", or all the available data elements? Just one hour, or all of the 48 hours? (18 data elements x 48 hours = 864 attributes, that is not going to happen) If you just wanted one hour ... would you that be hour[0] (I assume this is the current hour forecast? So if it is 2:15 pm this may be the 2:00 pm forecast), or hour[1] (I assume ths is the next hour forecast? So if it is 2:15 pm this would be the 3:00 pm forecast).

Some version of this could be done. My questions are 1) what is the cost from a hub performance perspective?; and 2) does the value added from this newly available data offset that cost?

I would love to hear what others think? Please take the polls below so I can guage demand for this:

  • Expand the data poll and expose hourly data
  • Hourly data not needed, keep it as it is.

0 voters

  • Expose only hour[0] hourly forecast data
  • Expose only hour[1] hourly forecast data
  • Expose both hour[0] and hour[1] forecast data
  • Expose something MORE that hour[0] and/or hour[1] forecast data. (reply in comments with your selection)

0 voters

  • Expose only precipProbability
  • Expose all available data elements
  • Expose some other sub-set (reply in comments with your selection)

0 voters

Thanks!

My use case is if it is currently raining/snowing or will in next hour

AGAINST
The current conditions can be polled as often as every two minutes with the driver now. What would you do with the 'next hour' forecast? What would your action be if the precipProbability for the next hour was 49%? Would that action change if it was 51%? My guess is their accuracy with the next hour precipProbability is most likely just slightly better than a coin flip. I hope the 'actions' you are basing on these data elements are not critical with that level of accuracy.

FOR
I probably could provide a preference option for the user to choose to select hourly forecast data poll. If they select that they would triple the size of the data poll and get some hourly forecast data (TBD what data elements actually get exposed in the driver). If they choose not to get hourly forecast data, the data poll would remain as it is now. That way only those who select hourly data MAY (?) experience performance issues and those who do not choose hourly forecast data would not be impacted at all.

Hi @Matthew
With the APIXU driver the illuminance would be polled every 5 minutes and all other attributes were polled as per settings. Maybe every hour.
For me this is not an issue as I use Lux devices in my home.
I know other peeps may use the polled illuminance level.
Could 5 minute polling be achieved for just the illuminance level?
Thanks and what I can say is this is working well for me using the cloud cover percentage to gauge when my curtains close. Darksky appears to be more accurate than Apixu.
Thanks again.

To my knowledge it is not possible to poll for just a single data element? You either poll for 'forecast' data, or you don't poll. If you want illuminance every five minues (the driver now allows down to every two minutes) you poll the DarkSky site for the data and you get all the data, not just illuminance. I suppose it may be possible to NOT display the other refreshed data and keep it at the older value, but why? The amount of data being returned by DarkSky will not change and the database stores the last 1,000 values, regardless of when (or how often) that data changes so there is no 'resource' savings.

I don't think so .... or at least I don't know how? Other drivers described this as a separate data pull when in reality they were just setting up a different schedules for 'nightlime' to reduce the polling frequency (but not the amount of data returned in each poll) since illuminance is not valuable when it is dark. This driver does allow for 'Daytime' and 'Nighttime' schedules for that same reason.

OK. No worries. I don't know how these things work so was just querying.
Every 30 mins or an hour is fine for me anyway but just thought I would ask.
Once again, great driver and thanks for doing this.

2 Likes

I'd like to see precipitation and temperature forecast for each hour

Only 10 people voted and overwhelmingly against adding hourly data. Let me think if there is way to allow some for only those that select it, without adding that overhead to everyone else who will no use it. No promises ... but I'll think about how I might do that.

Is there an app that will give weather updates by sonos, I was trying message central, but it seems none of the current states are exposed to it?