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

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.

I corrected the data type of 'pressure' to a number. I ran a test with a global variable in Rule Machine and it worked for me. Please let me know if this fixes your issue.

You sir are awesome! Thank you very very much for creating the three days tile!

This is just perfect!!!

2 Likes

One more stupid question....would it be hard/possible to change languages? Just for the wife acceptance factor. My native language is German....as far as I can tell darksky provides different languages....

But dont get me wrong. Im already very pleased with how everything looks and works!

Hard ... Yes. Possible .... probably, but beyond my skillset or my desire to provide a multi-lingual driver. I will not attempt this. Perhaps someone else who desires a multi-lingual driver can make a copy of my base code and make those additions?

Thank you very much Matthew! It worked perfecty now.

1 Like

Thanks for this and also all the predecessors of the base code. Out of three I tried this is the only one that worked. :unamused:
Great stuff

1 Like

Ok. I didn't know it (multi language) was that hard to implement. But thanks anyways for this awesome driver!

[UPDATED]
V1.2.7
10/23/2019

  • Minor tweak to force the icons for the two forecast days in the 3 Day Forecast Tile to be 'daytime' icons (instead of 'nighttime').

Also ... before the requests come in ..... I looked at 5 Day Forecast Tile. The amount of data and formatting in almost all cases exceeds the Dashboard Tile's maximum character length of 1024 characters. In my testing I also found that I needed to put in additional checks for the character length on the 3 day tile to prevent it 'trimming' off required closing html formatting if the string exceeds 1024 characters. Now if that happens it will just display a message that the data exceeds the maximum character length and it will not show any forecast. This prevents unintended consequences of un-closed html formatting from impacting the rest of the dashboard or 'Current State' display.

1 Like