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

[quote=“logread, post:17, topic:194426”]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 ?[/quote]

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…

[quote=“NikV, post:20, topic:194426”]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[/quote]

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 !!!

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

@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…

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 ?

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

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

I’ve just done a DarkSky download from the AltAppStore and get this log:

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:

[{"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:

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!

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.

No need its really great to have folks moving things forward and its kind of fun to try and work out whats happening :).

[quote=“logread, post:26, topic:194426”]… 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.[/quote]

Well, apologies to you both, since, clearly, the AltAppStore plugin should remove invalid spaces!

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…

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…

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…

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…

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.

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…

Easiest to check the More > Devices page and sort by device number to see if it’s still there.

Possibly in an unexpected room…?

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

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.

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…

Well, what plugins are you running? Should be possible to migrate at least some.

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…