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

Yeah didn’t work.

So I setup a local variable like your example.

It’s now working. Thanks for the help!

Do you have any examples for upcoming rain ?

Nothing for Rule Machine. I look at the tiles (below) You could set up a rule that if the PoP is greater than x%, speak a rule. Lots of issue with that, like if it exceeds your threshold it will never stop triggering...... I am sure there is a way to limit that in Rule Machne, but I have never done it.

image
image
image

Okay fair enough.

Stupid question but where are you pulling that display info from? Dashboard ?

Reading is your friend. This has been discussed several times in this thread. Those three images are 'tile' attributes in the driver. They are 'myTile', 'threedayfcstTile' and 'weatherSummary'. You can show those on any dashboard, like any other attribute, by selecting driver, then the template 'Attribute', then the attribute you want in that dashboard tile. Several examples showing how this is done are in this thread.

4 Likes

Should your dashboard be short of screen real estate and the mytile, 3day, or summary tile is truncated, it can be made to scoll as follows;

  1. get the tile id for the element
    In windows an easy way to do this using Chrome, place the cursor over tile element, right click, select Inspect. HtML source displays, get tile element id.

  2. Display the dashboard page, Click gear on tile's dashboard.
    Click advanced
    Click CSS
    add the following
    #tile-n {overflow: auto !important;}
    replace 'n' above with your tile number Won't work without important
    Click Save

  3. (update) You also probably want to get rid of the fixed position device id on the bottom of the tile by adding the following CSS
    #tile-n>.tile-title {visibility: hidden;}

  4. Shows scroll bars on non-touch screens as needed. Smooth scrolls on touch screens

Sample Html to look for
<div id="tile-2" class="tile attribute h-full" style="grid-area: 1 / 1 / 3 / 4; font-size: 9px; border-radius: 4px; background-position: center center; background-repeat: no-repeat; background-size: cover; overflow: hidden;"><div class="tile-contents"><div class="tile-secondary"> myTile </div><div class="tile-primary" style="font-size: 13.5px;"><span style="display:inline;"><a href="https://darksky.net/forecast/4x.xxxx,-7x.xxxx">Someplace, NJ</a><br>Clear | <span><a style="font-style:italic;color:red;" href="https://alerts.weather.gov/cap/wwacapget.php?x=NJ125F3FC63F94.SpecialWeatherStatement.125F3FC77D8CNJ.PHISPSPHI.92450720d95b4d609c891a38178d76ea">Special Weather Statement</a></span><br> 41°F<img src="https://tinyurl.com/y6xrbhpf/32.png" style="height:1.5em;display:inline;"> Feels like 36°F<br></span><span style="font-size:.9em;"><img src="https://tinyurl.com/y6xrbhpf/wb3.png">North-Northwest @ 9 MPH, gusts @ 18 MPH<br><img src="https://tinyurl.com/y6xrbhpf/wb.png">30.11 inHg <img src="https://tinyurl.com/y6xrbhpf/wh.png">43% <img src="https://tinyurl.com/y6xrbhpf/wu.png">8%<br><img src="https://tinyurl.com/y6xrbhpf/wsr.png">06:29 <img src="https://tinyurl.com/y6xrbhpf/wss.png">17:50 Updated: 16:57<br></span></div></div><!----></div>

4 Likes

[UPDATED]
V1.3.6
03/01/2020

First update since last month! :rofl:

Changes:

  • All hyperlinks added in the last update will now open in a new tab/window instead of replacing the current tab/window.
  • Removed some spacing in the alertTile to make it easier to fit in a 1x1 tile. Removed the 'green' color for no alerts. At least on my displays/screens it has blurry and hard to read.
  • Some minor tweaking to further reduce the code size and therefore reduce the likelihood of exceeding the dashboard tile character limitation and any mitigation required in that event (removing icons & links).
1 Like

Imported, and I'm getting the following error on save:

Looks like something didn't copy in right? I re-copy the code into GitHub at 8:55 PM EDT. If you copied the code prior to then and get an error, please refresh the code again.

Sorry for the inconvenience.

Yes. It worked OK that time. I must have just missed the re-copy.

2 Likes

Another CSS tweak.

How to shrink the amount of blank space between text lines on this app's alertTile, myTile, weatherSummary, or threedayfcstTile tiles: Adjust the page defined line-height of 1.5 to 1.25, or whatever you want.

The CSS
body {line-height:1.25} /* applies to all text on dashboard page */

#tile-n {line-height:1.25} /* apply only text in this tile where n is tile number */

How to find tile number and add CSS to dashboad page

2 Likes

Perhaps I'm doing it wrong in some way, but it seems like it is not possible to have multiple devices to show weather from multiple locations? Example scenario, I have my local US weather, would also like to see weather where my parents live in Australia.

I have tried this and the additional devices only ever show the weather from the first device, I even tried using a different API from another account in case it was a restriction on DS's side.

The driver pulls it's location from your hub. Much older versions made you key in your latitudes and longitude, but that changed to pull in the hub's details automatically. You could go into the driver's code and look for ' location.latitude'' and 'location.longitude' and replace those with your desired coordinates, then save the driver under a different name. Otherwise, it will always give you the location coordinates you established when you setup the hub.

2 Likes

Thanks - I will check it out.

@Matthew ... Cockily, I thought I could manage that but this looks to be a bit of a beast. I'm somewhat of a powershell guy, and groovy seems way more different than I'd expected.

I'm guessing "location.latitude" is a hubitat system-defined variable? Maybe I'll revisit and chip away at my comfort level over time. Thanks again for the response.

Correct. The change should be pretty simple. on line 254 change:

def ParamsDS = [ uri: "https://api.darksky.net/forecast/${apiKey}/" + location.latitude + ',' + location.longitude + "?units=us&exclude=minutely,hourly,flags" ]

to

def ParamsDS = [ uri: "https://api.darksky.net/forecast/${apiKey}/" + "Your_Latitude_here" + ',' + "Your_Longitude_here" + "?units=us&exclude=minutely,hourly,flags" ]

Both latitude and longitude are strings so enclose them in quotation marks.

It is very kind of you to take time to track that down and post it ... however I count 9 instances, 2 of them occurring prior to line 254, I don't know what each's purpose is and I'm worried I'd need to change them all, every time you release a new build.

Stupid (conceptual) question time - there's a lot i don't understand about the architecture here - but is it hypothetically plausible to implement a choice, between electing to use system location data, or defining a custom location like the older driver required? Or is that kind of functionality departing driver territory and venturing into apps?

You most likely correct. I just gave you the location that pulls the Dark Sky data. There are other data pulls too (like the SunriseAndSunset data) that also use the location coordinates. Adding an option to allow you to override the Hub's location coordinates with user provided coordinates is a possibility. I'll add that to the enhancements list for a future release.

2 Likes

Thanks for the code! can someone help with the illuminance/lux scale? What's the general range/distribution? Has anyone segmented into ranges for their rules that they'd like to share?

The maximum lux is set by time of day as listed below:

  • from Twilight begins until Sunrise: 50
  • from Sunrise until Sunset 10,000
  • from Sunset to Twilight: 50
  • between Twilight ends and Twilight begins: 5

The 'maximums' are further adjusted by cloud cover and/or time (percentage of time from reading until Noon (morning); percentage of time from Noon until reading (afternoon).

1 Like