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

[UPDATED]
V1.2.3
10/13/2019

  • Correction for forecastIcon and weatherIcon to use the 'standard' legacy WU codes that most dashboards use.
  • Tweaked lux (illumination) for 'fully nighttime' to force it to 5 lux with no further cloudCover adjustments (it was setting to 5 and then further adjusting for cloudCover after that before).
1 Like

I only get nt_fog showing up on my dashboard tiles. How do I get the actual “fog” or other weather icon to show up.

Thanks.

You have to turn on any 'optional' attributes you want to display, update and be available for dashboards. Did you turn on the icons?

I had not clicked on advanced and was not aware of the additional items. I now have everything working.
Thanks.

1 Like

Would it be possible to get windspeeds in m/s ? It seems that DarkSky is able to provide that when choosing units on their website:

image

EDIT: And hPa for pressure (which might come with the default setting). I see this also in DarkSky:

First, the driver does not work like you think. It makes one data query to Dark Sky to retrieve the data then any conversions to other 'units' are done within the driver. There is some flexibility on the units returned that are specified when the query is made, but you have to choose a pre-determined unit set that Dark Sky offers. My drivers use the pre-determined US/English default set when requesting data from Dark Sky and any options presented in the driver that differs from those are conversion calculations to those units performed within the driver.

Given that, I should be able to provide wind as 'm/s' as 1 mph is equal to 0.44704 meter/second. The driver already provides millibars as an option for pressure. That 'conversion' would be 1 hectopascal = 1 millibar (or no conversion because they are equal), so what you are asking is just to have an additional option on the label to say 'hPa' instead of 'MBAR' even though the number reported would be the same for both? I will take a look but if that is anything more than a trivial addition then I may not accomodate that request.

2 Likes

[UPDATED]
V1.2.4
10/14/2019

  • Added meters per second (m/s) as a selection for wind/wind gust speed.
  • Added hectopascal (hPa) as a selection for pressure.
6 Likes

Matthew, your awesomeness continues !
What you’ve done here has really filled the gap left by APIXU and it’s really appreciated every day.
Thank you.

6 Likes

I second njanda. Really awesome and truly appreciated. Now I can see the windspeed without resulting to math :slight_smile:

3 Likes

Hi,

With this, is it possible to get a forcast for today and one for tomorrow? I really don't need much info (dont need windspeed, humidity etc). Just maybe if its going to be a sunny or rainy day (maybe with temperature).

Edit: like in this picture e.g?

https://community.hubitat.com/uploads/default/original/3X/c/1/c1440d1db1ab67b1b4914f8f859d382cb6501a2e.jpeg

So far I couldnt find an option for "tomorrow".
Thank you!

'Today' forecast is what is shown from Dark Sky. The data elements 'tomorrow' or after are available from Dark Sky, but not exposed in this driver. The driver does expose percent chance of precipitation for 'tomorrow' and 'day after tomorrow', but no other forecast data for those periods.

I don't remember where I got the picture (I posted the link to) from....but someone managed to do this with darksky...

Can you help me/do you know how I could achieve this?

I can be done ... just create your own tile attribute in the driver code to expose what you want. There are lots of drivers you could use as examples, including this driver's 'myTile' code.

I am having trouble polling the pressure data. I keep getting null no matter how many times I try to put the pressure data into a global variable.

Could I be doing something wrong? Is it a format issue perhaps?

I'd appreciate your thoughts on this.

Thank you.

[UPDATE]
V1.2.5
10/22/2019

  • Added three day weather forecast dashboard tile.

You must turn 'on' the Optional Attribute to use this:
image

Then in your dashboard select your device, then the 'attribute' template, then the 'threedayfcstTile' attribute:

There you go....
image

4 Likes

Does the device show a value in the 'Current States"?

It is formatted as a string value in the code. Depending on your 'Units' selection is could be:
hPa or MBAR: String.format("%,4.1f", getDataValue("pressure").toBigDecimal())
inHg: String.format("%2.2f", getDataValue("pressure").toBigDecimal())

If you need it to be a number you would have to convert it.

Yes, it does. (unfortunately I am not able to post imagens here yet)

I don't need this as a number, having it as a string is enough to me. My problem is that when I try to set a global variable to pressure value, it returns "null" and I don't know why. Have you tried to use pressure data into a global variable successfully?
Thanks

VERY MINOR UPDATE (I did NOT increment the version number)
I posted the updated code at 5:10 PM EST so re-copy code if you copied before then.

  • Added 'forecast_text' to the two forecast days.
    image
3 Likes

I don't do much (anything really) with Global Variables in Rule Machine .... so I don't think I can help you. It sounds like a Rule Machine usage issue, not a Dark Sky driver issue.

[UPDATE]
V1.2.6
10/22/2019
@alphaville21a14 pointed out an error in the data type for 'pressure'

  • Corrected 'pressure' to be a number (it was a string with formatting).
  • Added 'pressured' to replace the formatted pressure for those that want the formatted string.