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

Hi, @Matthew. Is there a reason why all of the forecast temperatures are strings? That makes working with them in RM super annoying. You can't trigger based on if they are below a certain value because you can't compare a string to a number to check that.

Yes. Unfocused code writing while failing to successfully multi-task several other projects at the same time.

I'll push out a correction as soon I can find the time to focus on this.

2 Likes

[UPDATED]
V1.3.1
02/24/2020

As requested by several users, added the ability to select the number of decimals shown. There are two groups i) Temperature, Wind Speed & Distance, ii) Pressure. Each can be set indepently of the other. You may choose to display from none (0) to four (4) decimal places, although I am not certain any data sources provide that level of detail.

This version corrects a bug introduced in V1.3.0 that made some numeric attributes strings.

1 Like

[UPDATED]
V1.3.2
02/24/2020 ~8:20 PM EDT

I think I have the "java.lang.NullPointerException: null (updateLux)" bug squashed. I have been running with no error on both this version and the PWS-Required version. Please report any further errors you may get.

Thanks.

2 Likes

[UPDATED]
V1.3.3
02/26/2020

Changes:

Logging
Reduced default logging to display only warnings and errors (no polling events) and a few other infrequent events (switching between Daytime and Nighttime scheduling). You may turn on 'Extended Logging' to see more details (like polling event details). Extended logging will automatically turn itself off after 30 minutes. The driver's Current States or dashboard items for attributes 'myTile' and 'weatherSummary' show the last update times as an easy reference to when the data was updated. You may also turn 'on' the optional 'Observation Time' attribute to update and show the poll time in the Current States list.

Refresh
The 'refresh' capability/command will no longer force a poll of Dark Sky data, unless there is a change required for the Daytime/Nighttime scheduling. If you want to force a poll of Dark Sky use the 'pollData' command. If you are currently forcing a poll by using a Rule Machine custom action on the 'refresh' command, you should switch that to a custom action on 'pollData' to force a Dark Sky poll.

Various code cleanups and minor bug fixes.

Darksky API temperatures forecast as shown in 3 day forecast tile varies from Darksky.net website. Anyone know the reason for this?

Website's lat/lon was adjusted to match those in HE Settings.

Website

3 Day tile
image

From the Dark Sky website 'API Documentation' ..... This is contributing to some of the differences you may be seeing ....

  • Overnight low temperatures usually occur around dawn, and so will usually occur on a different date from the daytime high temperatures. (This is the primary difference between temperatureLow and temperatureMin.)

  • Summaries and icons on daily data point objects actually cover the period from 4AM to 4AM, rather than the stated time period of midnight to midnight. We found that the summaries so generated were less awkward.

Found the temps used by the darksky website in the API fields
temperatureMin
temperatureMax

Kind of confusing, my preference is to match the website info and use those fields vs
temperatureLow
temperatureHigh

Are you up for another option or changing the low and high source fields? :innocent:

I'll consider it, but I don't have time right now (today) to research or commit to that. Is the difference the time of day (4AM - 4AM vs midnight to midnight)? A lot of others use this driver too so, I'd like to make sure there isn't a significant objection to this change. It makes sense to me .... but I don't know if there may be any down-sides I have not considered.

If anyone has strong opinions (either way), please share them. Thanks.

I don’t have a strong opinion on this but I really love what you’ve provided here and it does seem logical to have the website data matching the 3 day forecast.
With them being different, I can see the question coming up again and again.

2 Likes

[UPDATED]
V1.3.4
02/27/2020

Changes:

  • Changed the forecast temperature polled from Dark Sky from 'temperatureHigh' and 'temperatureLow' to 'temperatureMax' and 'temperatureMin'. This change now allows the values to match what Dark Sky shows on their website for the same location. This should not require any user changes as the Dark Sky API variable names are not used in the driver other than to pull in those values. The new Dark Sky variable values continue to be pulled into the same driver attributes names so no changes will be required by the users of this driver. This change was recommend by @arnb .... Thanks.

  • Added the update time to the bottom of the 'threedayfcstTile'.

  • Corrected one decimal formatting in the 'weatherSummary' that was missed in the recent update (thanks @arnb) .

3 Likes

Hi Matthew,
I noticed this on the driver page after I updated to the latest release....
image

Thanks. I have updated my version checking file. Open the driver click the 'Save preferences' button and it should update.

1 Like

[UPDATED]
V1.3.5
02/28/2020

Changes: (inspired by @arnb)

Lots of 'behind the scences' changes to myTile and some that will be noticable:

  • Greatly reduced the html coding used for formatting the tile. This freed up space for some enhancements.
  • The location name at the top on 'myTile' is now a hyperlink that will take you to you hub location's weather details on Dark Sky's website.
  • If there is a weather alert, it will show in red italics. That weather alert will also be a hyperlink to the weather.gov alert details page. Those weather.gov links can be quite long, but the reduced formatting mentioned above should prevent exceeding the 1,024 character limit in most cases. If it does exceed the limit, the hyperlink will first revert to the Hub location's weather details page on Darsky.net where you can get details on the alert, and if it still exceeds the character limit, the hyperlink will be omitted.
  • Added a new 'alertTile' (second image below) that will just list weather alerts (or 'No current weather alerts for this area.'). Hyperlinks will take you to the hub location's weather details page on Darksky.net for no alerts, or the weather.gov alert details page if there is an alert.
  • Added a hyperlink to the 'threedayfcstTile' on the 'Today' text that will take you to the hub location's weather details page on Darksky.net

Black circled text is a hyperlink to the hub location's weather detail page.
Red circled text is a hyperlink to weather.gov's alert detail page.
image
image
image

2 Likes

Is there anyway to create a rule that will trigger a TTS if it sees a weather alert ?

Probably. If you create a rule in rule machine with a custom attribute trigger, what do you see listed when you select your darksky weather device?

Would this work ?

Here is mine ....

2 Likes

Thanks this is helpful.

I’m not using a global variable.

Would running an event below work?

Weather Alert: %alert%

Did you try it?

My guess is that it will not work because %alert% is a global variable ... so if you are not using a global variable and did not set %alert%'s value then it will not work.