The Vera Community forums have moved!

Advanced => Plugins & Plugin Development => Programming => openLuup => Topic started by: logread on November 18, 2016, 07:51:22 am

Title: openLuup: Dark Sky (formerly Forecast.io) weather plugin
Post by: logread on November 18, 2016, 07:51:22 am
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 https://darksky.net/dev/

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...)
Title: Re: openLuup: Dark Sky (formerly Forecast.io) weather plugin
Post by: akbooer on November 18, 2016, 08:05:26 am
Sounds good!

I took a quick look at the documentation and have a couple of comments:
Anyway, hope this works well for you.  Thanks for using the AltAppStore.
Title: Re: openLuup: Dark Sky (formerly Forecast.io) weather plugin
Post by: logread on November 18, 2016, 08:13:26 am
@akbooer, thanks for your prompt feedback !

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?
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)

you mention the variable names, but not the serviceId that the plugin uses.  Would be good to document that.
good suggestion... hovering with the mouse over the variables in AltUI is the way to go for now...
Title: Re: openLuup: Dark Sky (formerly Forecast.io) weather plugin
Post by: NikV on November 18, 2016, 06:56:38 pm
thanks for this seems to be working well with one problem

Code: [Select]
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
Title: Re: openLuup: Dark Sky (formerly Forecast.io) weather plugin
Post by: Mike Yeager on November 18, 2016, 07:49:52 pm
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...
Title: Re: openLuup: Dark Sky (formerly Forecast.io) weather plugin
Post by: logread on November 19, 2016, 02:43:56 am
thanks for this seems to be working well with one problem

Code: [Select]
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
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
Title: Re: openLuup: Dark Sky (formerly Forecast.io) weather plugin
Post by: logread on November 19, 2016, 02:59:11 am
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...
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
Title: Re: openLuup: Dark Sky (formerly Forecast.io) weather plugin
Post by: NikV on November 19, 2016, 03:49:55 am
thanks for this seems to be working well with one problem

Code: [Select]
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
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

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

Title: Re: openLuup: Dark Sky (formerly Forecast.io) weather plugin
Post by: logread on November 19, 2016, 04:24:57 am
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)
Title: Re: openLuup: Dark Sky (formerly Forecast.io) weather plugin
Post by: NikV on November 19, 2016, 04:42:39 am
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)
Title: Re: openLuup: Dark Sky (formerly Forecast.io) weather plugin
Post by: Mike Yeager on November 19, 2016, 12:41:32 pm
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...
Title: Re: openLuup: Dark Sky (formerly Forecast.io) weather plugin
Post by: logread on November 19, 2016, 12:47:16 pm
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.
Title: Re: openLuup: Dark Sky (formerly Forecast.io) weather plugin
Post by: logread on November 19, 2016, 12:51:37 pm
Version 0.3 is now available from the Alt App Store.
Changelog:
Title: Re: openLuup: Dark Sky (formerly Forecast.io) weather plugin
Post by: Mike Yeager on November 19, 2016, 01:23:31 pm
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...
Title: Re: openLuup: Dark Sky (formerly Forecast.io) weather plugin
Post by: NikV on November 19, 2016, 06:00:37 pm
Version 0.3 is now available from the Alt App Store.
Changelog:
  • automatic location setup by default - thanks @akbooer
  • default icon fix - thanks @NikV
  • state icons to reflect current weather - icons from icon8.com

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

Code: [Select]
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 :) :)

In my OpenLuup I dont have any directories under cmh and I dont have a skins directory under cmh-ludl either ????
Title: Re: openLuup: Dark Sky (formerly Forecast.io) weather plugin
Post by: logread on November 20, 2016, 04:38:10 am
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)...
Title: Re: openLuup: Dark Sky (formerly Forecast.io) weather plugin
Post by: logread on November 20, 2016, 04:45:18 am
Glad it seems to work for you
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?
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 ?
Title: Re: openLuup: Dark Sky (formerly Forecast.io) weather plugin
Post by: NikV on November 20, 2016, 06:03:05 am
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)...

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
Title: Re: openLuup: Dark Sky (formerly Forecast.io) weather plugin
Post by: logread on November 20, 2016, 12:34:25 pm
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 https://github.com/999LV/DarkSkyWeather and manually add these to the icons subdirectory on your target system... Not ideal, but at least it should get you going...
Title: Re: openLuup: Dark Sky (formerly Forecast.io) weather plugin
Post by: NikV on November 20, 2016, 04:50:59 pm
Thanks for that

looking at the log file im a little confused
Code: [Select]
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
Title: Re: openLuup: Dark Sky (formerly Forecast.io) weather plugin
Post by: Mike Yeager on November 20, 2016, 05:28:56 pm
Glad it seems to work for you
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?
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 ?

That would probably do the trick. I have a virtual rain sensor that runs under ZWay (on my RPi) that I use to trigger a few things (including delaying my sprinklers). It triiger off of the precipIntensity and precipProbability variables. Have you seen the virtual rain sensor plugin for Vera? It's a bit more involved to use, but it's also hardwired to WU...
Title: Re: openLuup: Dark Sky (formerly Forecast.io) weather plugin
Post by: NikV on November 23, 2016, 03:47:59 am
Thanks for that

looking at the log file im a little confused
Code: [Select]
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

ok I removed and reinstalled this from the app store but still no luck although it appaers to have installed the icons this time but in /var/log/cmh !!!

Code: [Select]
2016-11-23 08:39:32.246   openLuup.server:: GET /cmh/skins/default/img/devices/device_states/DarkSky-partly-cloudy-day.png HTTP/1.1 tcp{client}: 0x1ecedf8
2016-11-23 08:39:32.247   openLuup.server:: request completed (6859 bytes, 1 chunks, 1 ms) tcp{client}: 0x20175a0
2016-11-23 08:39:32.247   openLuup.server:: request completed (3162 bytes, 1 chunks, 1 ms) tcp{client}: 0x1cf3978
2016-11-23 08:39:32.248   openLuup.server:: request completed (33516 bytes, 3 chunks, 1 ms) tcp{client}: 0x1ecedf8
2016-11-23 08:39:32.762   luup.variable_set:5: 10005.urn:micasaverde-com:serviceId:ZWaveNetwork1.LastPollSuccess was: 1479890139 now: 1479890370 #hooks:0
2016-11-23 08:39:32.763   luup.variable_set:5: 10021.urn:micasaverde-com:serviceId:EnergyMetering1.Log was: 231,231,232,1479890337,538 now: 232,231,232,1479890367,568 #hooks:0
2016-11-23 08:39:33.282   openLuup.server:: request completed (15254 bytes, 1 chunks, 5366 ms) tcp{client}: 0x1b32c78
2016-11-23 08:39:33.398   openLuup.server:: GET /data_request?id=lu_status2&output_format=json&DataVersion=850181401&Timeout=60&MinimumDelay=1500&_=1479845843847 HTTP/1.1 tcp{client}: 0x1b32c78
2016-11-23 08:39:34.244   openLuup.server:: GET /data_request?id=lu_status2&output_format=json&DataVersion=1&Timeout=60&MinimumDelay=1500&_=1479890370156 HTTP/1.1 tcp{client}: 0x1ecedf8
2016-11-23 08:39:35.887   openLuup.server:: request completed (214850 bytes, 14 chunks, 1643 ms) tcp{client}: 0x1ecedf8
2016-11-23 08:39:36.006   openLuup.server:: GET /cmh/skins/default/img/devices/device_states/DarkSky-partly-cloudy-day.png HTTP/1.1 tcp{client}: 0x1ecedf8
2016-11-23 08:39:36.007   openLuup.server:: request completed (33516 bytes, 3 chunks, 1 ms) tcp{client}: 0x1ecedf8
2016-11-23 08:39:36.021   openLuup.server:: receive error: closed tcp{client}: 0x1ecedf8

this is the excerpt from the log file where I am assuming that it is trying to set the icon but  it is not even setting the default icon - just the generic Z-wave icon - the 2 daughter devices are working ok and it appears to be getting the forecast/weather ok - its jusrt not setting the Icon
Title: Re: openLuup: Dark Sky (formerly Forecast.io) weather plugin
Post by: logread on November 23, 2016, 05:50:41 am
@NikV,

Strange... you must have an unusual directory setup for your openLuup install... Please overwrite your D_DarkSkyWeather.json file with the attached patch that will fetch the icons from the GitHub repository over the internet instead of the local ones (at least you should get the icons as long as you have internet connectivity...
Title: Re: openLuup: Dark Sky (formerly Forecast.io) weather plugin
Post by: NikV on November 23, 2016, 07:37:00 am
Thanks

 - that now works ok

I used a turnkey image (think it was based on jessie lite  by cudanet IIRC) and havent tampered with the directory structure since, just did updates from the plugin.  If I save this json elsewhere and update the plugin will that give me the original so I can have a look to see what was going wrong ?

Code: [Select]
016-11-23 08:39:36.007   openLuup.server:: request completed (33516 bytes, 3 chunks, 1 ms) tcp{client}: 0x1ecedf8
2016-11-23 08:39:36.021   openLuup.server:: receive error: closed tcp{client}: 0x1ecedf8


looked  to me that it was getting the file locally but there was some sort or error which closed the tcp client before setting the icon but im a bit lost trying to find out why :-)


EDIT UPDATE :  all of the images downloaded onto the pi are have a size of 33k and are unreadable !! If I use your links in the json file and download and save to my windows machine they are fine but when I download them straight to the pi they end up unreadable. odd  ???

The only one I cant download is Darksky-darksky ... I get

The image "https://raw.githubusercontent.com/999LV/DarkSkyWeather/master/icons/DarkSky-darksky.png" cannot be displayed because it contains errors

I assume its just the original Darksky.png so I will rename that

UPDATE 2 I have updated the plugin and am now using the original Json file with the readable icon files (copied from my windows m/c) and it is all working fine - Thank you for your help with this its much appreciated  :)
Title: Re: openLuup: Dark Sky (formerly Forecast.io) weather plugin
Post by: akbooer on November 23, 2016, 08:46:55 am
I've just done a DarkSky download from the AltAppStore and get this log:

Code: [Select]
2016-11-23 13:27:15.491   luup_log:4: AltAppStore : updating icons in icons/ ...
2016-11-23 13:27:15.491   luup_log:4: AltAppStore : updating device files in ./ ...
2016-11-23 13:27:15.557   luup_log:4: AltAppStore : ... 0 icon files
2016-11-23 13:27:15.557   luup_log:4: AltAppStore : ... 4 device files
2016-11-23 13:27:15.557   luup_log:4: AltAppStore : DarkSky Weather update completed

...which clearly shows that, indeed, no icons are downloaded.

The AltAppStore database has this entry under the DarkSky Repository field:

Code: [Select]
[{"type":"GitHub","pattern":"","source":"999LV/DarkSkyWeather","folders":[""," icons"],"versions":{"1":{"release":"0.2"},"2":{"release":"0.3"}}}]
which looks OK... but isn't.

Turns out that there is a leading space in the icons folders definition: " icons" should be "icons".

I've fixed that and re-installed from the store:

Code: [Select]
2016-11-23 13:45:00.264   luup_log:4: AltAppStore : updating icons in icons/ ...
2016-11-23 13:45:00.264   luup_log:4: AltAppStore : updating device files in ./ ...
2016-11-23 13:45:00.297   luup_log:4: AltAppStore : ... 11 icon files
2016-11-23 13:45:00.297   luup_log:4: AltAppStore : ... 5 device files
2016-11-23 13:45:00.297   luup_log:4: AltAppStore : DarkSky Weather update completed

... success!



Title: Re: openLuup: Dark Sky (formerly Forecast.io) weather plugin
Post by: logread on November 23, 2016, 10:34:49 am
Many thanks @akbooer... glad you found this out as this was driving me crazy !
Apologies to @NikV and possibly others for the time wasted...

Incidentally I am working on a new version of the plugin that includes an optional virtual rain sensor child device based on DarkSky weather data as per @Mike Yeager's suggestion... now in testing but should be posted soon.
Title: Re: openLuup: Dark Sky (formerly Forecast.io) weather plugin
Post by: NikV on November 23, 2016, 11:09:35 am

Apologies to @NikV and possibly others for the time wasted...


No need its really great to have folks moving things forward and its kind of fun to try and work out whats happening  :).   
Title: Re: openLuup: Dark Sky (formerly Forecast.io) weather plugin
Post by: akbooer on November 23, 2016, 11:13:36 am
... glad you found this out as this was driving me crazy !
Apologies to @NikV and possibly others for the time wasted...
... now in testing but should be posted soon.

Well, apologies to you both, since, clearly, the AltAppStore plugin should remove invalid spaces!
Title: Re: openLuup: Dark Sky (formerly Forecast.io) weather plugin
Post by: Mike Yeager on November 25, 2016, 01:11:00 pm
Incidentally I am working on a new version of the plugin that includes an optional virtual rain sensor child device based on DarkSky weather data as per @Mike Yeager's suggestion... now in testing but should be posted soon.

Any chance that the Darksky API exposes heatindex? I see that dewpoint is already there, I just need to figure out how to extract it for my needs. I'm sure it won't be difficult but if I have problems, you'll be the first to know...
Title: Re: openLuup: Dark Sky (formerly Forecast.io) weather plugin
Post by: logread on November 28, 2016, 06:58:43 am
Version 0.4 is now available from the Alt App Store.
Changelog:
- more DarkSky API exposed as device variables
- updated documentation including all device variables and their service Ids

@Mike Yeager:
I elected for now not to create a "virtual rain sensor" child device (the event triggering by a child device seems a bit awkward. I need to think about it more.), but I exposed the precipitation intensity and probability variables which should make it easy to create scenes triggered by variable watches in AltUI that could act like a virtual rain sensor.
Also, I exposed the "ApparentTemperature" variable that - I think - is similar to the heat index you were looking for...
Title: Re: openLuup: Dark Sky (formerly Forecast.io) weather plugin
Post by: Mike Yeager on November 28, 2016, 10:24:03 am
Sweet! I figured the rain sensor thing might hold you up a bit. Depending on how involved you want to get into it, it could be an undertaking. I believe the original one I'm using in Z-Way just uses the probability of rain as a threshold. The one for Vera uses a far more intricate method that I haven't cared to figure out. Thanks again for this plugin!!!

Now I have to figure out this blockly editor to make things function....
Title: Re: openLuup: Dark Sky (formerly Forecast.io) weather plugin
Post by: Mike Yeager on November 28, 2016, 05:20:58 pm
Okay, I created a dummy device in AltUI for heatindex. The code below :

new = (luup.variable_get("urn:upnp-micasaverde-com:serviceId:Weather1", "ApparentTemperature", 136))
luup.variable_set("urn:upnp-micasaverde-com:serviceId:TemperatureSensor1", "CurrentTemperature", new , 140)

Creates and updates the variable of the dummy device but it doesn't display. Still displays NaN... Any Suggestions? I need several of these variables exposed so that I can export them via HTTP call to another process and I don't think it's fair to subject everyone else to a butt load of variables pulled out into their own elements...
Title: Re: openLuup: Dark Sky (formerly Forecast.io) weather plugin
Post by: akbooer on November 28, 2016, 05:31:17 pm
Don't know where it's gone... but when it was there, was it a Temperature device?  The UI will only display, by default, the relevant device variable on its front panel.
Title: Re: openLuup: Dark Sky (formerly Forecast.io) weather plugin
Post by: Mike Yeager on November 28, 2016, 06:00:42 pm
It was a temperature device. I recreated it and have it working but I can't figure out why it disappeared. When I recreated it, it used the next device number so it's either still there and I can't see it, or it's gone completely. Now I'm working on a humidity type device to expose the PrecipProbability variable... It seems to play a little different...
Title: Re: openLuup: Dark Sky (formerly Forecast.io) weather plugin
Post by: akbooer on November 28, 2016, 06:21:45 pm
Easiest to check the More > Devices page and sort by device number to see if it's still there.

Possibly in an unexpected room...?
Title: Re: openLuup: Dark Sky (formerly Forecast.io) weather plugin
Post by: Mike Yeager on November 28, 2016, 08:02:26 pm
Nope! Poof and it's gone. Oh well, I got the rest working. Are there any pre-made elements for wind direction (possibly in degrees), speed (mph), and rain (inches)?
Title: Re: openLuup: Dark Sky (formerly Forecast.io) weather plugin
Post by: akbooer on November 29, 2016, 02:45:06 am
I don't think that there are any standard UPnP-defined ones; weather plugins seem to make their own.  That's what I did for the Netatmo plugin.

There is a GenericSensor device that you can use, although last time I looked it had been incorrectly modified from a light sensor (wrong variable name.)  Nevertheless, you could try that.
Title: Re: openLuup: Dark Sky (formerly Forecast.io) weather plugin
Post by: Mike Yeager on November 29, 2016, 01:49:49 pm
I guess I'll be experimenting with modifying device type files then. Not important at the moment...

My next project will be getting OpenLuup running again and to see if I can get it stable and able to survive a reboot on the RPi. The RPi (Razberry) setup I was incorporating at one time has been completely done away with as of this plug in. I migrated the last of what it was doing last night.

How does one offload the Vera into OpenLuup and use it for just the radios? Since this seems like the eventual goal, leaving the Vera to do as little as possible. Right now I'm running AltUI on the vera, so the Vera is still carrying the full load....
Title: Re: openLuup: Dark Sky (formerly Forecast.io) weather plugin
Post by: akbooer on November 29, 2016, 02:36:10 pm
Well, what plugins are you running?  Should be possible to migrate at least some.
Title: Re: openLuup: Dark Sky (formerly Forecast.io) weather plugin
Post by: Mike Yeager on November 29, 2016, 02:49:35 pm
Well, I'm starting to play with the rules engine, that's going to take a little getting used to. As for actual plug ins, I'm running virtual switch, multiswitch, EcoBee, Ping Sensor, AutoVera, and PLEG. There are a few others but they're not essential. I have Heliotrope installed but as of yet, I'm not really using it. There are people on here that have migrated the devices out to OpenLuup as well. That was the bigger question. I'm not there yet though...
Title: Re: openLuup: Dark Sky (formerly Forecast.io) weather plugin
Post by: Mike Yeager on December 23, 2016, 04:50:03 pm
By the way, the DarkSky plugin is working great! So happy to have this native to the HA environment and not having to pull it in from elsewhere....
Title: Re: openLuup: Dark Sky (formerly Forecast.io) weather plugin
Post by: akbooer on February 15, 2017, 07:49:09 am
Version 0.4 is now available from the Alt App Store.
Changelog:
- more DarkSky API exposed as device variables

Any reason why the parent device doesn't have a CurrentHumidity variable?
Title: Re: openLuup: Dark Sky (formerly Forecast.io) weather plugin
Post by: Mike Yeager on February 15, 2017, 10:08:20 am
It's there, it just reads as CurrentLevel. I don't know why it's that way but I assume it's because the child device reads the CurrentLevel variable. It was probably made to conform to MCV's variable lists....

Just a guess... :)
Title: Re: openLuup: Dark Sky (formerly Forecast.io) weather plugin
Post by: akbooer on February 15, 2017, 10:22:26 am
Ah, I see it now.  But that's very inconsistent, given that these:

Code: [Select]
CurrentCloudCover
CurrentConditions
CurrentDewPoint
CurrentPressure

...are all there under the Weather1 serviceId.

I do understand that there is a formally-defined UPnP Temperature service, but the Humidity one is MCV home-grown.  Seems like it might be more complete to add CurrentTemperature and CurrentHumidity also under the Weather1 service. 

Just a thought, but I'm glad it's there somewhere.  Thanks for pointing that out.
Title: Re: openLuup: Dark Sky (formerly Forecast.io) weather plugin
Post by: logread on February 15, 2017, 10:28:57 am
It was probably made to conform to MCV's variable lists....

Just a guess... :)
Excellent guess... I indeed followed MCV's ServiceId and variable name from http://wiki.micasaverde.com/index.php/Luup_UPnP_Variables_and_Actions#HumiditySensor1

The other non-MCV variables are all arbitrarily using the Weather1 service id in an effort I made to make this plugin consistent with the original Weather Underground plugin

Happy to consider any better alternative if it makes more sense
Title: Re: openLuup: Dark Sky (formerly Forecast.io) weather plugin
Post by: akbooer on February 15, 2017, 10:40:08 am
Happy to consider any better alternative if it makes more sense

Only this...

Seems like it might be more complete to add CurrentTemperature and CurrentHumidity also under the Weather1 service. 

...but not an issue, since I can now find the variable!  (I'm using AltUI's Data Service Provider functionality along with DataYours  to log the data and I didn't want to go to all the individual child devices to set them all up.)
Title: Re: openLuup: Dark Sky (formerly Forecast.io) weather plugin
Post by: Mike Yeager on February 15, 2017, 04:31:25 pm
If you choose to change the variables, please make an announcement so I can change code of mine that looks for it.  :)
Title: Re: openLuup: Dark Sky (formerly Forecast.io) weather plugin
Post by: akbooer on February 15, 2017, 04:34:01 pm
I didn't mean change anything... just add something.

No problem to have two variables called the same thing if they have different a serviceId.
Title: Re: openLuup: Dark Sky (formerly Forecast.io) weather plugin
Post by: Mike Yeager on February 15, 2017, 04:35:19 pm
That works as well.... 
Title: Re: openLuup: Dark Sky (formerly Forecast.io) weather plugin
Post by: Chelseagroup on August 06, 2018, 11:23:24 am
Has this become anything but a "beta"?
Title: Re: openLuup: Dark Sky (formerly Forecast.io) weather plugin
Post by: akbooer on August 06, 2018, 12:13:58 pm
I use it as my main weather plugin these days.  Works just fine.
Title: Re: openLuup: Dark Sky (formerly Forecast.io) weather plugin
Post by: Chelseagroup on August 06, 2018, 12:19:15 pm
I see it is in the alt library - but I don't see any documentation.
Is documentation for the alt app library stored elsewhere?
Title: Re: openLuup: Dark Sky (formerly Forecast.io) weather plugin
Post by: akbooer on August 06, 2018, 12:25:13 pm
I see it is in the alt library - but I don't see any documentation.
Is documentation for the alt app library stored elsewhere?

There is a Documentation link variable in the plugin once you install it.  It points here:
https://raw.githubusercontent.com/999LV/DarkSkyWeather/master/documentation/DarkSkyWeather.pdf
Title: Re: openLuup: Dark Sky (formerly Forecast.io) weather plugin
Post by: Chelseagroup on August 06, 2018, 01:21:42 pm
It must be "dead" as an install from the app store does nothing - does not bring up the install "ok" box
Title: Re: openLuup: Dark Sky (formerly Forecast.io) weather plugin
Post by: akbooer on August 06, 2018, 02:55:41 pm
It must be "dead" as an install from the app store does nothing - does not bring up the install "ok" box

Well, that's odd, because I have just installed it (on Vera - I assume that's what you're doing, even though you're posting in the openLuup thread.)

Attached are two screenshots showing the AltAppStore response and also the Vera devices after it reloaded (it would need a key to work properly as per the documentation.)

Which Vera firmware are you on?  I do wonder about the latest ones - they seem very flakey and also had some 'security' features which, unless disabled, can stop some things working.
Title: Re: openLuup: Dark Sky (formerly Forecast.io) weather plugin
Post by: Chelseagroup on August 06, 2018, 03:12:13 pm
I tried it with a different browser and it DID install this time.
Thanks
Title: Re: openLuup: Dark Sky (formerly Forecast.io) weather plugin
Post by: korttoma on October 03, 2018, 05:04:59 am
Installed Dark Sky plugin on my VeraPlus (firmware 1.7.4001) manually by uploading the 4 plugin files and then created the device.

I then set the required variables to start receiving some data and it seems to be working but I cannot see the advanced tab on the plugins main device (see Pic1).

It is a bit difficult to use the variables when I cannot see them. Anyone know how I can get the advanced page visible for the device?

There is a requirement "Lua libraries ?ssl.https? and ?dkjson? installed" that I'm not sure I have because I don't have AltUI installed, could this be the reason why I cannot see advanced page?

Any hint would be appreciated.


Title: Re: openLuup: Dark Sky (formerly Forecast.io) weather plugin
Post by: akbooer on October 03, 2018, 05:20:56 am
This is a DarkSky / Vera problem, not an openLuup issue?
Title: Re: openLuup: Dark Sky (formerly Forecast.io) weather plugin
Post by: korttoma on October 03, 2018, 05:27:09 am
Yes Dark Sky / Vera issue, sorry did I post in wrong place?
Title: Re: openLuup: Dark Sky (formerly Forecast.io) weather plugin
Post by: korttoma on October 03, 2018, 05:57:01 am
tried adding the advanced page in to the D_DarkSkyWeather.json file but then the complete device disappeared :D fortunately the device returned when putting back the original file..

Checked from OpenWeather how the .json was implemented but I failed anyway...
Title: Re: openLuup: Dark Sky (formerly Forecast.io) weather plugin
Post by: korttoma on October 03, 2018, 06:49:28 am
The thing is that I'm currently using OpenWeather plugin and it is working fine but I heard that its days are numbered.
Now as OpenWeather and DarkSky plugin are quite similar i'm sure that it can work but unfortunately my coding skills do not seem to be enough.

I'm sure I can use the variables for my purpose by just checking from the DarkSky documentation what their names are but it would be nice to be able to see the variables in the UI.
Title: Re: openLuup: Dark Sky (formerly Forecast.io) weather plugin
Post by: akbooer on October 03, 2018, 08:32:09 am
Yes Dark Sky / Vera issue, sorry did I post in wrong place?

Well, yes, really.  I think I can move these posts to the Weather Plugin subforum if you'd like me to do that.
Title: Re: openLuup: Dark Sky (formerly Forecast.io) weather plugin
Post by: korttoma on October 04, 2018, 03:14:59 am
It does not matter so much to me where my posts are as long as the right person takes note of them and find it in their interest to lend me a helping hand.

I think logread would be the best person to look in to my request since I think he it the author of both openWeather and DarkSky plugins and openWeather shows the advanced variables page just fine. Anyhow I bet anyone with a little bit more programing skills than me could figure it out. I will also try again myself and let you know if I manage to manipulate the plugin to start showing the advanced variables (if you akbooer have any hints please let me know).
Title: Re: openLuup: Dark Sky (formerly Forecast.io) weather plugin
Post by: korttoma on October 04, 2018, 06:37:08 am
I took another look at this and I found that I had one "," missing between the declaration of the menu tabs from my modified .json file. Now it is working :D

Title: Re: openLuup: Dark Sky (formerly Forecast.io) weather plugin
Post by: chris66 on October 30, 2018, 03:33:12 am
I took another look at this and I found that I had one "," missing between the declaration of the menu tabs from my modified .json file. Now it is working :D
Hi Tomas, so you use it without AltUI, right? What files with the .json do you have uploaded? Thanks, Chris
Title: Re: openLuup: Dark Sky (formerly Forecast.io) weather plugin
Post by: korttoma on October 30, 2018, 08:39:41 am
I took another look at this and I found that I had one "," missing between the declaration of the menu tabs from my modified .json file. Now it is working :D
Hi Tomas, so you use it without AltUI, right? What files with the .json do you have uploaded? Thanks, Chris

Hi, Yes, I use Dark Sky Weather Plugin without AltUI. You can find the other files from here -> https://github.com/999LV/DarkSkyWeather

Upload the the files:
D_DarkSkyWeather.json
D_DarkSkyWeather.xml
I_DarkSkyWeather.xml
L_DarkSkyWeather.lua

Then manually create a device from vera UI under Apps -> Develop apps -> Create device

Upnp Device Filename* = D_DarkSkyWeather.xml

Then check the DarkSky documentation for configuring the mandatory variables.
Not sure if the variables will show up automatically or if you need to add them. Let me know if you need help creating the mandatory variables.

There are also some icon files @ github but I have no idea where to put them and if they can even be used in the Vera UI.
Title: Re: openLuup: Dark Sky (formerly Forecast.io) weather plugin
Post by: chris66 on October 30, 2018, 09:59:41 am
Thanks for the answer Tomas, will try this.
Title: Re: openLuup: Dark Sky (formerly Forecast.io) weather plugin
Post by: chris66 on November 02, 2018, 11:23:56 am
Ok, uploaded the files and created new device. I can see the device with usual Tabs, but no Variables available. After refreshing the browser I just have the Control Tab available, but no fieds available. Tried to reboot. So I'm not  able to type the Key (Old key Forecast.IO, but still valid) and Location.
As I'm not in OpenLuup environment, I do not have Lua libraries ?ssl.https? and ?dkjson? installed.

So maybe just help me to create the mandatory variables, thanks!

EDIT: Now appears following devices DarkSky Humidity and DarkSky Temperature. Added manually in L_DarkSkyWeather.lua my key and lat long but still missing values, because I have to create mandatory variables, if you can help me, thanks, Chris
Title: Re: openLuup: Dark Sky (formerly Forecast.io) weather plugin
Post by: korttoma on November 07, 2018, 07:28:33 am
sorry for the late reply.

You need to use the D_DarkSkyWeather.json from my earlier post to be able to see the Advanced page -> http://forum.micasaverde.com/index.php/topic,40406.msg420817.html#msg420817

From the top of the advanced page you should be able to see the device id (in my case it is device #548)

Then run the following commands from Apps -> Develop apps -> Test Luup code

First (replace the xxx with your API key and 548 with your device id!):

local KEY1 = "xxxxxxxxxxxxxxx"

luup.variable_set("urn:upnp-micasaverde-com:serviceId:Weather1", "Key",KEY1,548)


Then this (again replace 33.1 with you latitude and device id):

local VAR1 = 33.1

luup.variable_set("urn:upnp-micasaverde-com:serviceId:Weather1", "Latitude",VAR1,548)


Then this (again replace 51.6 with you longitude and device id):

local VAR2 = 51.6

luup.variable_set("urn:upnp-micasaverde-com:serviceId:Weather1", "Longitude",VAR2,548)


Then this (again remember device id):

luup.variable_set("urn:upnp-micasaverde-com:serviceId:Weather1", "Period",1800,548)


And finally (again remember device id and change also sv (sv=swedish) to your prefered language, see DarkSkyWeather.pdf for options):

luup.variable_set("urn:upnp-micasaverde-com:serviceId:Weather1", "Language","sv",548)


Restart luup engine if it did not restart automatically...
Title: Re: openLuup: Dark Sky (formerly Forecast.io) weather plugin
Post by: chris66 on November 12, 2018, 04:30:31 am
Thanks for your very accurate indications, succeed. Now I can see on the main device the weather (Clear) and Pressure. On 2 child devices I get Humidity and Temperature. Do you know if I can get another child for Wind? Or I can easily query the WindSpeed value in Variables to get some scenes interaction, great job, thanks!
Title: Re: openLuup: Dark Sky (formerly Forecast.io) weather plugin
Post by: Seth22 on December 22, 2018, 01:03:38 pm
I have the plugin installed on my Vera and I have 2 child devices for temp and humidity.  I am trying to get a third child device installed to show the weather conditions (clear, rain etc).  I have searched for a while and I cannot figure out how to do this.  Can you point me in a direction? 

To clarify a bit.  I am trying to come up with an alternative to the Weather Underground plugin.  With that plugin I can build conditions around if the weather is clear rainy etc.  When I try to create these conditions now the only devices exposed to vera are the 2 child devices.  The master plugin which shows the wx status is not available.  So i think i need a child device to also be able to use the wxstatus as a condition?
Title: Re: openLuup: Dark Sky (formerly Forecast.io) weather plugin
Post by: akbooer on December 22, 2018, 01:46:03 pm
Hmmm...  not an expert, but not sure the app does that itself.

However, you can certainly create a dummy device with a repeating scene to transfer the variable needed to the dummy device.  Why, in fact, do you need this as a separate device?
Title: Re: openLuup: Dark Sky (formerly Forecast.io) weather plugin
Post by: Seth22 on December 22, 2018, 02:41:38 pm
I have zwave shades in my sunroom.  When the wx is clear I have a schedule where certain shades open and close at certain times. (to prevent the temp from getting too high) but if the wx is cloudy then I don't want any shades to close.

I am doing this now with the vera wx underground plugin. I have a master device and children.  When I create a condition, the master device shows up and I can select weather status, clear, cloudy etc. This works great.

With darksky I have the parent device with 2 children. The problem is that the parent device does not show in my conditions, only the 2 child devices (temp and humidity)
The parent devices wx status and icons show perfectly in Vera's device view but they are invisible in Vera's scene creation or my PLEG conditions.

Basically I am looking for a way to write conditions based on the parent devices variables.  Wx underground works great for this and I cannot replicate this functionality with darksky even though I can see what I want in the ui.

My thought was to create another child device that shows the conditions (clear rain etc). But I cannot figure out how to do this.

Any help would be greatly appreciated. I'm not opposed to other methods to accomplish this, I just want the data for my conditions somehow
Title: Re: openLuup: Dark Sky (formerly Forecast.io) weather plugin
Post by: rigpapa on December 22, 2018, 02:45:51 pm
Reactor will show and access all variables in the parent and child devices and let you use them in conditions.
Title: Re: openLuup: Dark Sky (formerly Forecast.io) weather plugin
Post by: reneboer on December 31, 2018, 05:40:03 am
Hi Logread,

I found three more value useful that the DarkSky API returns : WindGust, uvIndex, Visibility

So i added this to the VariablesMap in my copy of the plugin:
Code: [Select]
  currently_uvIndex = {serviceId = SID_Weather, variable = "uvIndex"},
  currently_visibility = {serviceId = SID_Weather, variable = "Visibility"},
  currently_windGust = {serviceId = SID_Weather, variable = "WindGust"},

Would you consider adding these to a next release?

Cheers Rene
Title: Re: openLuup: Dark Sky (formerly Forecast.io) weather plugin
Post by: swfire271 on March 12, 2019, 05:29:16 pm
I went through the above instructions to add Dark Sky to my Vera Plus (not running altui) but it was unsuccessful.  I then added Altui, and tried it that way, but it wouldn't let me download from the altui appstore either.  Here is the configuration of the app, but in the main ui7 devices tab, the device itself doesn't even show up as a device, it is hidden.  All the variables are in the variables tab after manually configuring them using the Test Lua code area.

Any ideas on what I'm doing wrong?
Title: Re: openLuup: Dark Sky (formerly Forecast.io) weather plugin
Post by: chris66 on March 15, 2019, 10:55:35 am
Your pict is AltUI, I didn't installed AltUI, please read carefully the steps described above.
Title: Re: openLuup: Dark Sky (formerly Forecast.io) weather plugin
Post by: chris66 on March 15, 2019, 11:12:04 am
Anyway, I have another question, couldn't find for Darksky the equivalent to Condition field values like Partly Cloudy, Raining, etc. that listing was available with WeatherUnderground api there: https://www.wunderground.com/weather/api/d/docs?d=resources/phrase-glossary
Any help appreciated! Chris
Title: Re: openLuup: Dark Sky (formerly Forecast.io) weather plugin
Post by: reneboer on March 15, 2019, 12:38:09 pm
Hi Chris,

There are some more parameters that may help. See http://forum.micasaverde.com/index.php/topic,40406.msg435773.html#msg435773

I have the updated LUA code if you like.

Cheers Rene.
Title: Re: openLuup: Dark Sky (formerly Forecast.io) weather plugin
Post by: swfire271 on March 18, 2019, 12:03:14 pm
Your pict is AltUI, I didn't installed AltUI, please read carefully the steps described above.

I understand that.....but altui is the only way I can get the device to appear/be seen.  Something is missing - I've followed the exact steps at least 4 different times, it never installs properly or lets me get to the advanced menu.  I can't even get it to show up as a device in the Devices menu in the original Vera menu (non-altui).
Title: Re: openLuup: Dark Sky (formerly Forecast.io) weather plugin
Post by: rafale77 on March 23, 2019, 12:57:41 am
I am modifying the plugin so it can supply data to the Virtual Rain Sensor plugin. I see that the code initially had provisions for an optional virtual rain sensor as well but can't see where it went?