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

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.

Well, yes, really. I think I can move these posts to the Weather Plugin subforum if you’d like me to do that.

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

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 :smiley:

Hi Tomas, so you use it without AltUI, right? What files with the .json do you have uploaded? Thanks, Chris

Hi Tomas, so you use it without AltUI, right? What files with the .json do you have uploaded? Thanks, Chris[/quote]

Hi, Yes, I use Dark Sky Weather Plugin without AltUI. You can find the other files from here → GitHub - 999LV/DarkSkyWeather: DarkSky Weather plugin for openLuup

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.

Thanks for the answer Tomas, will try this.

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

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…

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!

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?

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?

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

Reactor will show and access all variables in the parent and child devices and let you use them in conditions.

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:

  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

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?

Your pict is AltUI, I didn’t installed AltUI, please read carefully the steps described above.

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: Loading | Weather Underground
Any help appreciated! Chris

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.

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