[Plugin]DarkSky Weather

@reneboer
Rene - I am hoping to make your plugin work with UI5. But, I’m limited in development experience. Any suggestions on resources on how to do this?

Thanks

Hi @TamarackGhost,

Some changes would be in the D_DarkSkyWeather.json and D_DarkSkyMetric.json for the icon display and especially how to call the javascript tabs in J_DarkSkyWeather.js. You can read about the differences between UI5 and UI7 at http://wiki.micasaverde.com/index.php/Luup_plugins:_Static_JSON_file.

In D_DakrSkyWeather.lua you will have to comment out line 361. That does not work on UI5.

The biggest change will be the J_DarkSkyWeather.js file. The javascript handling between UI5 and UI7 is totally different. What you could do is look at the .js files for one of my other plugins vera-Harmony-Hub/chm-ludl at master · reneboer/vera-Harmony-Hub · GitHub. I use a similar set of template functions and you will see the difference between the two that do the same.

It is not trivial though. It will need some trial and error if you are new to this.

Success. Rene

Thanks Rene. I will give it a go!

Anyone seeing update issues with the plugin? Its beautifully sunny out right now and DSW is showing that its raining, even my Vera is showing that its sunny. I tried changing display line 1 to last update and doing a reload/refresh and it still shows a status of raining. The child temp is not displaying the proper temp either.
Update to this. I removed my key and reloaded luup Line 1 shows Complete settings first.
I went to dark sky and go a new key and entered it and reloaded and its still showing Complete settings first.
I did look at the DSW API console and seems there were 44 calls yesterday and none today.
It also looks like what its reporting is from the default latitude and longitude. If I run the api test form the DSW site it reports rain and a temp of 53.8 degrees F
If I replace the coordinates with mine it returns the proper forecast.
I am not able to look at the log currently to see if there are any errors, I will check that later today.

Mine is also incorrect. I am cloudy, overcast with very high winds. DarkSky is showing Sunny with light breeze?

This is the error I am seeing in the log
01 03/05/20 18:40:55.143 luup_log:68: DarkSky Weather_error: DarkSky API call failed with http code = closed <0x740bc520>
Hoping Rene can provide some help.

1 Like

For everyone’s information, this appears to be a Dark Sky problem.
Homeseer users are also affected.

Dark Sky not working. [broken link removed]

1 Like

Hi,

It is working for me now. Does it again for you too?

Cheers Rene

I am still showing ‘Complete settings first’. I probably shouldn’t have reset my key. Do I need to reinstall the app?

Hi Tim,

If you entered the new key and reload luup it should be working again.

Cheers Rene

Tried several reloads and still shows ‘Complete settings first’, just tried generating a new key and reloading and getting the same thing.

If I use a browser and go to the following it returns the data
https://api.darksky.net/forecast/mykey/mylatitude,mylongitude

On luup reloads I do not see calls counter updating on DSW’s site.
Must be something with my install?

Does anyone have any further suggestions on how to possibly troubleshoot what may be happening or should I just try uninstalling and reinstalling the app?

UPDATE:
I changed the log level to Debug for the device and grabbed the string from the log and pasted into a browser and it looks like it worked fine in the browser.
The Vera log shows the error that it returned with the status = to closed. I omitted my key and latitude and longitude but here are the lines from my log:

50 03/07/20 8:56:05.102 luup_log:68: DarkSky Weather_debug: calling DarkSky API with url = https://api.darksky.net/forecast/mykey/mylatitude,mylongitude?lang=en&units=auto&exclude=hourly,alerts,minutely <0x73dd6520>
01 03/07/20 8:56:05.159 luup_log:68: DarkSky Weather_error: DarkSky API call failed with http code = closed <0x73dd6520>

The newer LuaSec on Plus/Secure 7.3x requires that protocol be set on https.request() calls. This had a default before but now does not, and that has broken many similar plugins. I don’t have access to the code to check this one.

Hi,

It looks like DarkSky changed something as it is also failing on a VeraLite on V7.0.28. But it does seem to do with the protocol and DarkSky no longer accepting any as the value. Oddly it does work just fine on openLuup with a simple https.request.

Soo, it seems they need tlsv1.2 as a minimum now. That is supported on Vera 7.30, but not the Lite etc.

Updated version 1.5 will be available later today, but that won’t work on the Lite or older.

Cheers Rene

2 Likes

Mine running on openluup on much newer luasec version has been working just fine. Very likely a security level requirement change indeed with tlsv1.2.

Thanks everyone. Looking forward to the update.
Copied in the new file and back up and running.
Thanks Rene

1 Like

Will this require a firmware update? I hate doing those.

I am on 1.7.4453 now

Thanks.

M

Not sure when Vera updated LuaSec so it supports tlsv1.2. But DarkSky won’t work without the update so you have to update the plugin and just see if it starts working again.

Cheers Rene

ok, is the update out yet for mios?

It is not yet. Normally they get approved on Mondays, but none of my updates are up to now. You can force an update by putting this in your browser with your Vera’s IP address: http://VERA_IP/port_3480/data_request?id=action&serviceId=urn:micasaverde-com:serviceId:HomeAutomationGateway1&action=CreatePlugin&PluginNum=9231&Version=39710

Cheers Rene

I remember having the same problem with the ecobee plugin when ecobee also upgraded their security to tlsv1.2. Maybe should get a ticket to vera to implement a fix to not have to express the tls version in the http request call?