openLuup: Dark Sky (formerly Forecast.io) weather plugin

As an alternative to my “openWeather” plugin based on Weather Underground’s free developer API (and after being recently faced with with an apparent lack of reliable connectivity with WU servers that derailed some of my home automation), I wrote a new plugin to fetch weather data from Dark Sky, also offering free weather data. Please see Dark Sky

It is now published on the AltUI App Store as “DarkSky Weather” and can be installed following the attached instructions (also available from the plugin after it is installed).

The current version is 0.2 and is a beta version that may still contain bugs.
Version 0.3 beta is now available, featuring dynamic icon based on current weather and automatic location information upon install based on Vera/openLuup system setup.
I welcome any feedback.

Screen shots of the AlUI devices created by the plugin as well as of the plugin device variables available in the beta version are attached to this post as well.

It is designed to run on openLuup systems. It may work on a real Vera, but I did not test this (my only real Vera is a Veralite that I stripped off of all plugins to make it a zwave controller only, at last finally reliable… all my production and development systems are openLuup driven, with either Vera or Domoticz/openZwave controllers as “slaves” and that made my life so much easier while being cheaper…)

Sounds good!

I took a quick look at the documentation and have a couple of comments:

[ul][li]latitude and longitude are native luup variables (which can be set in the Lua Startup code.) I see that you’ve chosen to require these to be configured separately in your plugin. I suppose this gives flexibility to monitor weather in a different place. I haven’t looked at your source code and wondered if you preset those values from the existing luup variables?[/li]
[li]you mention the variable names, but not the serviceId that the plugin uses. Would be good to document that.[/li][/ul]

Anyway, hope this works well for you. Thanks for using the AltAppStore.

@akbooer, thanks for your prompt feedback !

You are right, I wanted the flexibility to use different locations… but your point about having the default location taken from the controller attributes is well taken… for next release 8)

good suggestion… hovering with the mouse over the variables in AltUI is the way to go for now…

thanks for this seems to be working well with one problem

2016-11-18 23:48:08.331 openLuup.server:: GET /cmh/skins/default/img/devices/device_states/darksky.png HTTP/1.1 tcp{client}: 0xcc2030 2016-11-18 23:48:08.477 openLuup.server:: request completed (214014 bytes, 14 chunks, 1898 ms) tcp{client}: 0xd3b018 2016-11-18 23:48:08.478 openLuup.server:: file not found:icons/darksky.png

cant seem to find the icon - I poresume a different one is downloaded depending on the weather

regards

Nik

Any chance of a native Vera plugin? I’d much rather use this than WU as it seems to be more reliable here. Also allows more “hits” a day. I am currently using an RPI to retrieve the information and pass it to Vera (along with a virtual rain sensor that’s tied to ForecastIO) but I’d love to be able to bring it all local…

[quote=“NikV, post:4, topic:194426”]thanks for this seems to be working well with one problem

2016-11-18 23:48:08.331 openLuup.server:: GET /cmh/skins/default/img/devices/device_states/darksky.png HTTP/1.1 tcp{client}: 0xcc2030 2016-11-18 23:48:08.477 openLuup.server:: request completed (214014 bytes, 14 chunks, 1898 ms) tcp{client}: 0xd3b018 2016-11-18 23:48:08.478 openLuup.server:: file not found:icons/darksky.png

cant seem to find the icon - I poresume a different one is downloaded depending on the weather

regards

Nik[/quote]
I do not see this error in my own logs… Would appreciate if you please check that the darksky.png icon exists in the cmh-ludl/icons directory ? I suspect installation parameters for the App Store might not be all correct.
Thanks

Thanks for trying the app ! I am not planning a native Vera plugin due to a) the cumbersome need to deal with json and xml device and service files when developing for Vera UI, and b) I do not want to load any plugin on my only real Vera*, so would not be able to test such a plugin.

That being said, you can use the mirroring feature of the Vera Bridge plugin to “push” any of the DarkSky device variables to a dummy device on the Vera… See http://forum.micasaverde.com/index.php/topic,36971.msg281751.html#msg281751 and/or the openLuup documentation for details.

  • as said before, I migrated all my scenes/plugins to openLuup and use my Veralite only as a radio controller… much more reliable… no reboots/reloads

[quote=“logread, post:6, topic:194426”][quote=“NikV, post:4, topic:194426”]thanks for this seems to be working well with one problem

2016-11-18 23:48:08.331 openLuup.server:: GET /cmh/skins/default/img/devices/device_states/darksky.png HTTP/1.1 tcp{client}: 0xcc2030 2016-11-18 23:48:08.477 openLuup.server:: request completed (214014 bytes, 14 chunks, 1898 ms) tcp{client}: 0xd3b018 2016-11-18 23:48:08.478 openLuup.server:: file not found:icons/darksky.png

cant seem to find the icon - I poresume a different one is downloaded depending on the weather

regards

Nik[/quote]
I do not see this error in my own logs… Would appreciate if you please check that the darksky.png icon exists in the cmh-ludl/icons directory ? I suspect installation parameters for the App Store might not be all correct.
Thanks[/quote]

yes I checked there is no Darksky.png anwhere I can find on the RPI , having looked at the darksky api it looks like the call should return the icon depending upon the state of the weather but this is optional

Thanks for checking. BTW, the variable icon based on weather conditions is not yet implemented. But still, I found why even the default icon is not displayed… I had incorrectly assumed the Alt App Store would also copy subdirectories of the GitHub repository to the host system, while it seems it does not (I need to check this with @akbooer)… I made a quick fix to this that will be in the next version, but in the meantime the attached updated device file can be manually added in the openLuup working directory (e.g. cmh_ludl) to implement the fix (the device will load the icon over the internet)

Thanks - I did not realise that it did not download the weather specific Icon (well I did this morning after I poked around in the code)

I can’t even get the alt app store to appear. It shows on Vera, but when I click APP STORE under Alt-UI, I get a blank page. Alt-UI also want’s to update itself, but it won’t…

You may want to check about that on the AltUI sub forum at http://forum.micasaverde.com/index.php/board,78.0.html
… This is not related to the DarkSky plugin.

Version 0.3 is now available from the Alt App Store.
Changelog:

[ul][li]automatic location setup by default - thanks @akbooer
[/li][li]default icon fix - thanks @NikV
[/li][li]state icons to reflect current weather - icons from icon8.com
[/li][/ul]

Ok, I did manage to get the App Store and everything loaded and got the plugin installed. Waiting to see how it works. It did populate back to Vera so that is a good thing. Any chance that it would be easy to either add a virtual rain sensor output to this or tag off of it to set and clear a virtual rain sensor? This looks like it may be what finally removes my Z-Way (Razberry) setup from the equation…

[quote=“logread, post:13, topic:194426”]Version 0.3 is now available from the Alt App Store.
Changelog:

[ul][li]automatic location setup by default - thanks @akbooer
[/li][li]default icon fix - thanks @NikV
[/li][li]state icons to reflect current weather - icons from icon8.com
[/li][/ul][/quote]

right I updated to version 0.3 (thanks for your efforts here) I have had currentconditions as “Drizzle” and “Light rain” this evening and checking the variables it lists the Icon as “Rain” but the icon has gone back to the standard Z-wave icon

checking the log

2016-11-19 22:47:09.478 openLuup.server:: request completed (14344 bytes, 1 chunks, 12 ms) tcp{client}: 0x1e726b8 2016-11-19 22:47:09.484 openLuup.server:: GET /cmh/skins/default/img/devices/device_states/DarkSky-rain.png HTTP/1.1 tcp{client}: 0x207fc48 2016-11-19 22:47:09.485 openLuup.server:: file not found:icons/DarkSky-rain.png 2016-11-19 22:47:09.485 openLuup.server:: request completed (137 bytes, 0 chunks, 0 ms) tcp{client}: 0x207fc48 2016-11-19 22:47:09.519 openLuup.server:: GET /data_request?id=lu_status2&output_format=json&DataVersion=595530974&Timeout=60&MinimumDelay=1500&_=1479595618093 HTTP/1.1 tcp{client}: 0x1e726b8

so we are back to where we were this morning :slight_smile: :slight_smile:

In my OpenLuup I dont have any directories under cmh and I dont have a skins directory under cmh-ludl either ???

I am puzzled… I am having the plugin version 0.3 running fine with dynamic icons on 3 different openLuup systems…

you should have an “icon” sub-directory in your “/etc/cmh-ludl/” directory (assuming this is the openLuup working directory in your setup, and in it should be the DarkSky-xxxx.png icons… This should (?) be created by the App Store upon installation for version 0.3 if it does not already exists. Could you please check this ? If it does not exist (please let me know of that), then could you create it and re-install the plugin version 0.3 ? At least we will know if this is an installer configuration issue (my bad if it is)…

Glad it seems to work for you

Not sure I fully understand what you want, but if it helps I can make the plugin expose as device variables the “precipIntensity”, “precipType” and “precipProbability” values returned by the DarkSky API but ignored by the plugin for now ?

I am puzzled… I am having the plugin version 0.3 running fine with dynamic icons on 3 different openLuup systems…

you should have an “icon” sub-directory in your “/etc/cmh-ludl/” directory (assuming this is the openLuup working directory in your setup, and in it should be the DarkSky-xxxx.png icons… This should (?) be created by the App Store upon installation for version 0.3 if it does not already exists. Could you please check this ? If it does not exist (please let me know of that), then could you create it and re-install the plugin version 0.3 ? At least we will know if this is an installer configuration issue (my bad if it is)…[/quote]

yes I have an Icons subdirectory see attach image - it only has the darksky.png in it which I put there after finding the path to it from your updated json so i downloaded it - I did just update the plugin from the plug ins page , should i do something different

I cannot reproduce the issue you are having… I deleted and re-installed the plugin version 0.3 and the installer indeed installed all the 11 icons the app uses in the /etc/cmh-ludl/icons directory… Not sure why you are having the issue, but still you can dowload the icons yourselves from the GitHub respository at GitHub - 999LV/DarkSkyWeather: DarkSky Weather plugin for openLuup and manually add these to the icons subdirectory on your target system… Not ideal, but at least it should get you going…

Thanks for that

looking at the log file im a little confused

2016-11-20 21:41:51.823 openLuup.server:: GET /cmh/skins/default/img/devices/device_states/DarkSky-cloudy.png HTTP/1.1 tcp{client}: 0x10704b8 2016-11-20 21:41:51.825 openLuup.server:: request completed (33363 bytes, 3 chunks, 2 ms) tcp{client}: 0x10704b8 2016-11-20 21:41:51.848 openLuup.server:: receive error: closed tcp{client}: 0x10704b8

at least it gets the file but it doesnt put the icon on the device

Perhaps i would be better if I unistalled and reinstalled it