The Vera Community forums have moved!

Advanced => Plugins & Plugin Development => Programming => Weather Plugin => Topic started by: 325xi on July 06, 2009, 11:24:22 pm

Title: Weather Plugin
Post by: 325xi on July 06, 2009, 11:24:22 pm
I remember a hypothetical plugin, mentioned in Wiki, creating a virtual device that takes data from weather.com to make it available to other devices.

1. How do we do "wget" in LUA? Or what is the best way to do HTTP GET from LUA without going low level?
2. Is there easy way to process/parse HTTP response in Lua?
3. In what variable scope data should be stored to be available globally for all Lua resources on the device?
Title: Re: Plugin for Web: weather.com et al
Post by: micasaverde on July 07, 2009, 10:20:11 am
I just added: lu_wget (see: http://wiki.micasaverde.com/index.php/Luup_Lua_extensions#General_purpose).  This will be in the next release in a couple days.
Title: Re: Plugin for Web: weather.com et al
Post by: 325xi on July 07, 2009, 10:29:02 am
Great!

What about the two other questions? :)
Title: Re: Plugin for Web: weather.com et al
Post by: anker on July 07, 2009, 10:41:02 am
...and what about implementation of curl?

http://curl.haxx.se/libcurl/lua/

Is it possible to add as well?

/Anker
Title: Re: Plugin for Web: weather.com et al
Post by: micasaverde on July 09, 2009, 03:54:22 pm
765 has the wget now.

As far as parsing the response, I don't have much experience with Lua's text parsing.  I do basic stuff in my implementation files, like gc100, etc.  But I know Lua has pretty powerful parsing and supports regular expressions.  I think there's a tutorial on text handling in Lua at lua.org

Any variable that you don't put 'local' in front of is global automatically within that Lua instance.  So, if you add inside a snipped of code attached to a scene:

myvariable="abc"

in some other scene, you can read that variable.  The same is true in implementation files.  Look at: I_PanasonicPTZ.xml (in >=765) and note that I retrieve the http authentication in the startup, store it in a variable, and use it in the jobs.

As far as the scope and Lua sessions/states...  There is one "Master Lua State", which is what all the code attached to scenes and events goes into.  Also, any .lua files that you explicitly import into with Devices, Luup plugins, 'extra lua files' go into the 'master state'.  When you choose 'test lua code', if you leave the device id blank, or 0, your code is run inside the 'master state'.

Every top level device is given it's Lua state as well.  This is basically a separate engine, with separate variables, etc., to provide isolation if one device acts up so it won't effect the others, and so if one device creates a global variable, like "IP", and another device uses the same global variable, they won't conflict.  So, the GC100, which is actually one top level device and a bunch of child devices (i/r transmitter, relay, etc.), all the implementation files for the gc100 and children run in their own Lua state.  All the Z-Wave devices (again, 1 master, and many children) run in their own Lua state too.  And, when you create your own lua device, like the Somfy blinds, it also has it's own state.
Title: Re: Plugin for Web: weather.com et al
Post by: micasaverde on July 10, 2009, 10:38:33 pm
We'll add the curl library on Monday.  This should make a lot of the plugins like weather.com interfaces much easier to use.
Title: Re: Plugin for Web: weather.com et al
Post by: guessed on July 11, 2009, 02:23:51 am
If it helps, heres a few "stub" LUA routines that will parse the content of Yahoo's Weather service RSS.  I used this as an exercise to "learn" how to write LUA so the edges are really ragged:

    http://www.box.net/shared/n2j62yq7uv

To test-author this stuff I'm using the freestanding version LUA engine, and I'm running the Eclipse development env with the LUA Plugin (on a Mac, if it matters) to give me a GUI Editor.

Anyhow, the text above sample has a few crude parsing routines that can extract the Element/Attr values from the Yahoo feed.  To make it work outside Vera, I've mocked up a lu_wget() function, similar to the one that I'd have if I deployed it.... but I've never tested it in Vera itself.


Here's some sample output from running it.  I imagine you could use this stuff to create a Weather Device, but I haven't got that far (MCV just fixed a Lua Startup problem in my Vera)

I used Micasa's ZIP code to generate the output

Code: [Select]
Element: geo:lat, value: 39.53
Closed Element: yweather:condition
  Attribute date=Fri, 10 Jul 2009 9:55 pm PDT
  Attribute text=Mostly Cloudy
  Attribute temp=74
  Attribute code=27
Element: guid, value: USNV0076_2009_07_10_21_55_PDT
  Attribute isPermaLink=false
Closed Element: yweather:units
  Attribute speed=mph
  Attribute temperature=F
  Attribute pressure=in
  Attribute distance=mi
Closed Element: yweather:location
  Attribute country=US
  Attribute city=Reno
  Attribute region=NV

In Reno, it's currently 74(F) and Mostly Cloudy




I'm using this as the reference manual for Lua:
    http://www.lua.org/manual/5.1/manual.html#2.5

and this for the Lua Eclipse plugins:
    http://luaeclipse.luaforge.net/manual.html#introduction


Hoepfully this will get you a little further with what you want to build.
Title: Re: Plugin for Web: weather.com et al
Post by: guessed on August 15, 2009, 08:28:13 pm
ok, so with some prodding from a more than a few...   The attached files implement a Weather device, reporting back the following properties, each displayed as "children" of the Parent Weather object:

    [Current] Temperature
    Low Temperature
    High Temperature
    [Current] Humidity

The device will "poll" for this information every ~30 minutes.

To get it going (using a newer Luup release like 1.0.862 etc):

Please post on this thread if this doesn't work, providing detailed screenshots and log output, and I'll do my best to fix anything I can where there's enough detail in the forum posting to work it out.

This will get easier when it can be included in the Luup catalog...


When it starts, it prints  the following type of log entries:
Code: [Select]
50 08/15/09 16:28:50.068 luup_log:133: Google Weather #133 starting up with id  <0x803>
...
50 08/15/09 16:28:51.661 luup_log:133: At [-53.080002 ,73.489609], it's currently 26(US) and Clear.  Humidity is 1%.  Low is 30 High is 32 <0x803>

(given a device id of "133")

For a location like:
    http://maps.google.com/?ie=UTF8&ll=-53.080002,73.489609&spn=0.271404,0.464172&t=h&z=11

The Weather device will fire off a URL like:
    http://www.google.com/ig/api?weather=,,,-53080002,73489609

I have no idea how accurate this data is, how often it's updated, and where there's coverage so we'll roll the dice on that.  But, from a few samples (like the above) it has some offbeat places ;)

The data reported back is imperial, not metric... for now.



Many thanks to the pointers provided by @LibraSun and @Ap15e.  These suggestions made be cutover from using the Yahoo! Weather API to using the [undocumented] Google equivalent, since it's parameters are more flexible.

As a result, if you've established Vera's "Location" settings correctly, then this device should report the weather correctly.

It relies upon Vera's Luup releases, and I've only tried it on 1.0.862.  There will be a warning in the log output about the S_Weather.xml file.  This is incomplete, and designed for future Location-based overrides.  It can be ignored for now.

It could also do with some error handling, since it really doesn't have any right now ;)

(modified to remove the legacy version of Weather.zip, newer version attached later in forum thread)
Title: Re: Plugin for Web: weather.com et al
Post by: 325xi on August 15, 2009, 08:45:25 pm
Can anyone see the attachments?
Title: Re: Plugin for Web: weather.com et al
Post by: guessed on August 15, 2009, 08:50:39 pm
ok, for backup, I've uploaded Weather.zip to box.net as:

    [legacy, removed]

and the screenshot of the running device is:

    [legacy, removed]

I can usually see others GIF Attachments, so no idea why these wouldnt work.  As a side-note, it's amusing that you cannot upload .XML files as attachments to the forums, since that's the format used for Luup device files ;)

UPDATE: Removed box.net versions, since they're antique and are now on code.mios.com (et-al)
Title: Re: Plugin for Web: weather.com et al
Post by: LibraSun on August 15, 2009, 09:53:38 pm
So, you've already pieced together the following:

(1) Can get Celsius results using: http://www.google.co.uk/ig/api?weather=[ZIP]

(2) Full Google Weather API documentation here: http://www.codeplex.com/awAPI

Glad you got this project underway.  Sounds fun!
Title: Re: Plugin for Web: weather.com et al
Post by: guessed on August 15, 2009, 10:08:05 pm
Yes, I should have been clearer.  I have both the Metric (C) feed info, and the "unofficial" documentation, but I'm missing a few key pieces:

a) For a [Vera] Temperature component should it present in degC or degF or in the format specified under Location?  Should this be normalized to always present in one of these, and have the UI "normalize" the value.  The specs here are vague.
b) A standardized way to select between the two collection types?
Should this follow the setting under Location, and if so, what variable is this within the luup.xxx area?  If not, what Service defn can be used to provide the UI/Selector?
c) There is no formal documentation for Google's Weather API, from a trusted *.google.com address, although there's lots of informal stuff floating around.
Title: Re: Plugin for Web: weather.com et al
Post by: micasaverde on August 16, 2009, 11:45:06 am
Quote
For a [Vera] Temperature component should it present in degC or degF or in the format specified under Location?

The UPnP standard requires all temperatures to be stored in Celsius.  However, we had to break the standard because the RCS thermostats won't accept temperatures in Celsius or temperatures with decimal places, and because rounding errors were causing temperatures stored in Fahrenheit to be off by 1.

So, in our implementation, if you store a temperature as a number-only (ie 75) it is assumed to be in the same format specified under Location.  Or, you can append a C or F to be explicit (ie 22C or 72F).  This may break some UPnP control points because the official spec is that the temperature is numeric-only.  But, internally within the Luup engine, whenever we see a C or F we do a conversion if necessary so it's handled correctly.
Title: Re: Plugin for Web: weather.com et al
Post by: guessed on August 17, 2009, 11:27:43 am
Ok, given the options, I'd like to make it "follow" the setting in the Location tab, as this seems to do the least amount of damage wrt UPnP spec.

I don't see this spec'd in the Luup extensions Wiki page, so can you let me know the name of the luup.xxxx variable to get this value?  (presumably with domain values of "C" and "F")
Title: Re: Plugin for Web: weather.com et al
Post by: zmistro on August 19, 2009, 04:59:17 pm
Anyone know why the Off next to the temp and no hunidity?
Title: Re: Plugin for Web: weather.com et al
Post by: guessed on August 19, 2009, 05:07:32 pm
Zmistro,
There are UI rendition bugs for both Temperature and Humidity controls in the luup releases.  These are open issues listed against the main topic thread.

The attribute values are correct if you need to script a scene against them or anything.  You'll see the same UI bug if you have another temperature device like a hsm100.
Title: Re: Plugin for Web: weather.com et al
Post by: micasaverde on August 19, 2009, 10:14:27 pm
These are now fixed.  The next release will be out in a couple days.
Title: Re: Plugin for Web: weather.com et al
Post by: guessed on August 29, 2009, 04:27:20 pm
Just a side-note, my code wont work unless you've filled in the Location information.  It needs this to get the Lat/Long.  I'll see if I can add some startup validation code that fails when this isn't set so users will "know", otherwise it silently fails.

Dashboard rendition of the component in the 1.0.883 release attached.  Looks like HumiditySensor1 components don't yet have a nice render widget, but the value is there behind the scenes for scripters.

@zmistro: the "OFF" stuff is gone in the newer Luup releases.
Title: Re: Plugin for Web: weather.com et al
Post by: guessed on August 29, 2009, 05:17:16 pm
Updated version attached.  This will check the Lat/Long and fail during startup if these aren't set.

Updated the version at box.net also, just in case the attachments aren't working (or are delayed as they have been in the past)


(modified to remove the legacy version of Weather.zip, newer version now only on Box.net to ensure we dont have stragglers)
Title: Re: Plugin for Web: weather.com et al
Post by: madas on August 29, 2009, 10:57:41 pm
Thank you guessed.  It works great.  Just having a play.  Real nice data input to have!
Title: Re: Plugin for Web: weather.com et al
Post by: guessed on August 30, 2009, 11:50:32 pm
@madas, you're welcome.  I'd be interested to know what you use it for, and to get confirmation that the temperature settings are reporting correctly for your area (just to get any bugs out).
Title: Re: Plugin for Web: weather.com et al
Post by: Chimpware on August 31, 2009, 10:24:25 am
Nice plugin.

In the version I just loaded, I get 2 temperatures.  One listed in the main device as "Current Temperature = xxF" and another in the Temperature child window.  They do not match, so I am wondering what the child temperature reading means.

(http://img.skitch.com/20090831-ndsjg4dj54pxpbskc1ku3ftgth.jpg)
Title: Re: Plugin for Web: weather.com et al
Post by: LibraSun on August 31, 2009, 11:30:01 am
This plug-in is top-notch and I look forward to using it.

In fact, I sincerely hope Vera could incorporate this functionality natively, perhaps expanding the range of variables she presents (and makes available to other Luup plug-ins!), such as:

Cumulative rainfall for past X days:
Visibility (mi/km):
Cloud cover:
Humidity:
"Feels like":
Smog / allergen / pollen, etc. level:

I believe, given the proper interfacing with existing (free) weather services, Vera could "screen scrape" all kinds of relevant weather / climate information!

Imagine being able to instruct Vera (I know this is years away!), "IF [Humidity] [exceeds] 75% OR [Air Quality] [falls below] 6, THEN [Close] [Motorized Sunroof], [Set] [Thermostat] to [Auto]" etc.

Or water your lawn after 3 consecutive dry days, etc.
Title: Re: Plugin for Web: weather.com et al
Post by: guessed on August 31, 2009, 12:05:58 pm
@Chimpware, not sure where the extra Current temperature is coming from, since nothing should be attached to the Parent device (it's just a container). 

What Vera version are you on?   Was it a clean install of the component or an upgrade from a previous version (I used to have the root-Device as a Temp sensor, but I nuked that some time back)

The intention was to use one of the 3x "Temperature" child devices (Temp, Low-Temp, High-Temp) depending upon what you needed.

@LibraSun, some of the data you want is available in the underlying feed from Google.  I didn't bother presenting it, as there was no "clean" visualization for it.  They have "codes" for the various weather types, along with some image URLs, but you'd likely want to normalize them just in case the underlying feed/implementation ever needs to change.  Unfortunately I dont see a way for a "Device" to present the URL to the UI/Render layer, otherwise I'd have presented the Cloud-layer info in the icon XML element.

This is the type of data that's presented, for reference:

    http://www.google.com/ig/api?weather=11937

This feed was the only one I could find that could take Lat-Long parameters, to make it auto-config for users, and have World-Wide coverage.
Title: Re: Plugin for Web: weather.com et al
Post by: Chimpware on August 31, 2009, 12:38:50 pm
guessed:  I am running 878, and it was a clean install from the download you listed above about 3 or 4 posts.
Title: Re: Plugin for Web: weather.com et al
Post by: guessed on August 31, 2009, 01:29:40 pm
ok, I'll take a crack at it tonight to try and work out why it would render like that.  It doesn't for me, but I take my screenshots from the Devices tab of the Design time.
Title: Re: Plugin for Web: weather.com et al
Post by: Chimpware on August 31, 2009, 02:46:19 pm
guessed, before you spend nay time on it, let me upgrade to 886, and get my new dongle working, then if it still has same result I will post back.
Title: Re: Plugin for Web: weather.com et al
Post by: madas on August 31, 2009, 07:17:57 pm
guessed,

I'm thinking something along the lines of if daily high temp > 80 then turn on the AC in the house to say 74.  If High is less than 80 then disable the AC.  Or even use the current temp to always keep the house say X degrees below the outside temp.  Might lower my electric bill a bit!

No point running AC when the temp is not going to get too high.  I'm sure there are plenty of other uses as well, i'll post as I think of them!

G
Title: Re: Plugin for Web: weather.com et al
Post by: Chimpware on August 31, 2009, 09:57:58 pm
Guessed, behavior is exactly the same after upgrade to 886 for me.  Unfortunately I could not upgrade the dongle as I had planned as Vera is not creating a backup for me.
Title: Re: Plugin for Web: weather.com et al
Post by: guessed on August 31, 2009, 10:29:18 pm
@Chimpware, I've sent you a PM for a few extra items I need to debug this.  Feel free to post results here as needed for any screenshots (etc) as we debug offline.

Strangely, it's working fine for me in both Device and Dashboard displays so I must have messed up the packaging somewhat or there's a Legacy version of the D_Weather.xml file floating around.
Title: Re: Plugin for Web: weather.com et al
Post by: madas on August 31, 2009, 11:00:24 pm
guessed,

your zip worked on my box and I don't see the same as Chimpware.  I just have the temps without the additional "current temperature=" string.

Perhaps its something with the local zip?

G
Title: Re: Plugin for Web: weather.com et al
Post by: guessed on September 01, 2009, 05:53:07 pm
For reference, the Weather Plugin uses the [unofficial] Google Weather feed for source data.

In more than a few cases, I've seen anomalies in the data.  Here are some examples, for a rather nice place to live...


The first two, by ZIP code, are "in sync" from the data they report.

The 3rd one, by Lat/Long, has different values for some reason.  The 4th is just there in case folks are dreaming about vacations, but represents what's "at" the Lat-Long presented for the ZIP...

The Weather plugin uses the Lat/Long values that are derived when you configure the Location in Vera.  Unfortunately there are times these differ from those presented for the ZIP code.

If anyone has a better [worldwide] feed, let me know and I'll make the changes.  For now it's probably "near enough" for most uses, except for the Humidity values, which seem to diverge a bit.

(Updated to use the correct LL parameters from the Google Maps URL for the 3rd URL per LibraSun's comments below)
Title: Re: Plugin for Web: weather.com et al
Post by: LibraSun on September 01, 2009, 06:12:13 pm
The first two URL's obviously point to East Hampton (NY).
[Edited] So does the third ... East Hampton's coordinates are 40°57′25″N 72°11′56″W.
Title: Re: Plugin for Web: weather.com et al
Post by: Chimpware on September 01, 2009, 06:35:09 pm
If I modify your first URL for my zip code 08844, this humidity that is shown does not match the humidity that comes from your plugin.

(http://img.skitch.com/20090901-ixp5p5punfwrij1h18ruxp9gm.jpg)
(http://img.skitch.com/20090901-tchfrpea323u176bu2587ke856.jpg)



BTW, are you located on LI in the Hamptons?
Title: Re: Plugin for Web: weather.com et al
Post by: guessed on September 01, 2009, 07:02:55 pm
What does the 3rd URL report if you change the LL parameters to match those for your ZIP code?

You can also check these against the current settings under Vera's Location tab, but you have to (Edit) to see them since it typically displays a formal/textual name, and not the components (including LL)

... I live in California, but chose "nice" random locations for most of my examples, so they're typically all over the map.  I've also corrected the 3rd example above, since I'd use the wrong LL pair from the Google Maps request (also changed)
Title: Re: Plugin for Web: weather.com et al
Post by: Chimpware on September 01, 2009, 07:58:02 pm
Using 3rd URL and LL from Vera settings I get the same humidity data as I get substituting my zip code in the first URL.  Data in Vera still reports wrong humidity for me:

(http://img.skitch.com/20090901-5k3dr2yep42rb6nhpau66sa8e.jpg)

(http://img.skitch.com/20090901-m5ptsru71ama3fib8y8iyi4fj4.jpg)


(http://img.skitch.com/20090901-j3m1hpmbm1datpgmxcm74q83ra.jpg)

Current Temperature is however correct.  I scanned the data for an instance of 14 in the XML data and there was none, so not sure where Vera is getting Humidity Level data from.
Title: Re: Plugin for Web: weather.com et al
Post by: guessed on September 02, 2009, 09:10:26 am
Cool, thx!  I'll  run it through my parser tonight to ensure there are no parsing problems with extracting the Humidity values using your XML snippet (although I'll have to re-type it).  The service polls on ~30 min intervals, so there's also the chance that any of the values might change in between when you run it and when the plugin does, but most changes should be minimal.
Title: Re: Plugin for Web: weather.com et al
Post by: Chimpware on September 02, 2009, 11:50:44 am
You can just click:

http://www.google.com/ig/api?weather=,,,40499500,-74629000 (http://www.google.com/ig/api?weather=,,,40499500,-74629000)

to regenerate it if you want to.
Title: Re: Plugin for Web: weather.com et al
Post by: guessed on September 03, 2009, 12:37:05 am
@Chimpware, If I hover over the "add to iGoogle link" in

   http://www.google.com/#hl=en&source=hp&q=weather+in+08844

it's reporting that 08844 is at:

    http://www.google.com/ig/api?weather=,,,40512504,-74663464

current humidity 62%, which is different from the one you gave, which is

    http://www.google.com/ig/api?weather=,,,40499500,-74629000

reporting current humidity of 93%.

How did you derive the Lat/Long values used in the link above?  Are these the ones that Vera auto-populated into the Location tab?


I'm beginning to feel like the Humidity stuff wont work correctly for people, in all geo-locations.  If the data is unreliable, then I'll need another source or I can pull out the capability.

@madas, is it reporting correctly for you?  I need a few extra install data points to work out if the Humidity values are systematically incorrect or not.
Title: Re: Plugin for Web: weather.com et al
Post by: Chimpware on September 04, 2009, 04:41:32 am
LL data was taken from Vera auto population, but you have me thinking.  I checked the exact LL of my house on Google Maps and the coordinates Vera auto-populates with is less than 5 miles from my house according to Google maps (by road route).

It appears there is an issue with the humidity data interpolation that Google is using for weather as I get similar results to what you found using coordinates that are relatively close to one another with vastly differing humidity results.

Alas Vera will not let you input LL data directly, so my next choice was to put in a different town, close to where I live and I found a number that reported incorrect humidity data, but eventually found one that was correct.

Thanks for looking into this for me, it appears the data from Google has issues in some cases.  I think based on exploration that in some cases humidity is being reported as 100% and then the interpolation algorithm for locations near that data point report inaccurate results.



Title: Re: Plugin for Web: weather.com et al
Post by: LibraSun on September 04, 2009, 06:13:44 am
Chimpware, this is probably not germain to the issue at hand, but it bears noting:

When I first researched how to obtain weather information from National Weather Service using their URL-based facilities, it quickly became clear that their data points were limited to very specific "stations" throughout the U.S.

See: http://www.weather.gov/xml/current_obs/
for a list of stations by state.

The "current conditions" weather report for each station shows a specific Latitude & Longitude pair, and I later found that trying to submit random lat/lon-based queries through NWS' feed services failed ... the lat/lon HAD to be in their database to work properly.

Is it possible that Google is using NWS as a back-end and therefore has similar constraints?  I wonder if your plug-in might generate more reliable results if users were asked to first look up their nearest NWS-listed "weather station" lat/lon pair, and enter that instead of what Vera (or other source) tells them.

Again, just a thought...
Title: Re: Plugin for Web: weather.com et al
Post by: LibraSun on September 04, 2009, 06:31:30 am
FYI, I pinged the following two URLs against Google's API and they produced vastly different weather reports, even though the geo-locations are mere miles apart:

Used random lat/lon pair "near New Orleans, Louisiana":
http://www.google.com/ig/api?weather=,,,30980465,-90212690

Used (rounded) lat/lon pair defined by NWS for "New Orleans Int'l Airport":
http://www.google.com/ig/api?weather=,,,29980000,-90250000

Results:
Temp_F = 67 vs 77
Humidity = 94 vs 84
Low Temp = 67 vs 72
Conditions = Clear vs Cloudy, etc.

Interesting (to me) how the deltas happened to be multiples of 5 deg. F.

Title: Re: Plugin for Web: weather.com et al
Post by: LibraSun on September 04, 2009, 06:46:58 am
Final note for the morning...

Seems Google isn't the only weather-data service experiencing bogus data problems.

See: http://hunter.pairsite.com/wx-status.html

for copious notes about NWS' database issues (and its effect on this guy's software development) over the past two months.

Title: Re: Plugin for Web: weather.com et al
Post by: Chimpware on September 05, 2009, 08:45:00 am
Hey thanks for pointing out WX I am checking it out and it is pretty cool.

On weather data results, I checked around my area a bit with Google Weather and there are some towns with 100% RH reported around me so that is the culprit once interpolated.
Title: Re: Plugin for Web: weather.com et al
Post by: husky on September 05, 2009, 01:34:19 pm
I don't know what I'm doing wrong here, I installed the LUUP files. In my LUUP files I see there are 3 files called something like "C%3A%5CUsers%5Cadmin%5CDesktop%5CWeather%5CD_Weather.xml" and the other 2 files have the same format.

In devices -> LUUP plugins I added a device with "D_Weather.xml" called weatherstation.
But there is no output like you all have.

My FW is 899.

What am I doing wrong here? Do I need to rename the XML file into D_Weather.xml? How do I do that?

Thanx for you help!
Title: Re: Plugin for Web: weather.com et al
Post by: Chimpware on September 05, 2009, 01:46:32 pm
You need to add it as a Zwave device at the bottom of the page there is a spot that looks like this:

(http://img.skitch.com/20090905-ppphayte8p6wk6my3j4nhph4rk.jpg)

Type "D_Weather.xml" there and it should work.
Title: Re: Plugin for Web: weather.com et al
Post by: husky on September 05, 2009, 02:09:27 pm
I did, after that it shows in the Luup plugins section but no output like the weather. It looks like a dead node.

Don't I have to rename the .XML file?
Title: Re: Plugin for Web: weather.com et al
Post by: guessed on September 05, 2009, 03:09:13 pm
There are a few steps, including:


At that point the device should startup cleanly and present the 4 values (Current Temp, High Temp, Low Temp and Humidity) based upon your Location data.

If your Location is not specified, then the device will not start.  The newer Luup builds visually indicate this with a Red Cog at the top and some text.
Title: Re: Plugin for Web: weather.com et al
Post by: husky on September 05, 2009, 03:24:09 pm
It's running, first time I added the files with IE, second time with FireFox.
IE is messing with the file name, FF doesn't.

Can you tell me how to set the temp on Celcius?

I changed the I_GoogleWeather file the following:

local currentTemp = extractElement(rss, "temp_f")["attrs"]["data"]

into:

local currentTemp = extractElement(rss, "temp_c")["attrs"]["data"]

Now only the current temp is in Celcius and the High and Low are in F.
Title: Re: Plugin for Web: weather.com et al
Post by: guessed on September 05, 2009, 04:38:41 pm
I've added a general Wiki page for the component here to start formalizing things a little:

    http://wiki.micasaverde.com/index.php/Weather_Plugin

@husky, if you change the feel URL to "google.co.uk" instead of "google.com", then I believe the values will change over.  I haven't tried it, but that's what all the online references indicate.

This currently requires hand-editing (as you've experienced) of the I_GoogleWeather.xml file.

I have it on the books to build that in, once the respective "luup" API's are available to tell me whether the Location data is in Imperial or Metric.
Title: Re: Plugin for Web: weather.com et al
Post by: husky on September 05, 2009, 04:58:02 pm
google.co.uk doesn't do the job, the xml input is metric but the output is Imperial.
Title: Re: Plugin for Web: weather.com et al
Post by: guessed on September 05, 2009, 05:37:27 pm
I wasn't planning on working out the Metric stuff until the associated luup.xxx variable was available to automate it (@MCV: hint, hint)

In the meantime you have a few options in the code, but I haven't tried these.


Once the Luup variable is available, I'll make the relevant mods per the above if I can't get the feed itself to give me the "futures" data in metric.  Until then you can likely apply these changes manually.

Note that some of the Devices you "attach" to might require the data in Imperial.  I  recall a few discussions where [certain] components would not behave correctly according to the ZWave spec... if not told data in degF, but cant remember the details.
Title: Re: Plugin for Web: weather.com et al
Post by: 325xi on September 05, 2009, 08:57:35 pm
Being myself interested in Metric output, I would suggest to make it a parameter of Weather device  - if set, it would override the system setting (the luup.xxx value). This way users would be able to get Celsius values without waiting for implementing luup.xxx thing, and set it to Imperial for devices that require it. 
Title: Re: Plugin for Web: weather.com et al
Post by: LibraSun on September 05, 2009, 10:08:43 pm
I want to thank Guessed for such a great effort with the wiki pages, notably these:

http://wiki.micasaverde.com/index.php?title=Special:RecentChanges&from=20090904020737&days=1&hideminor=0
Title: Re: Plugin for Web: weather.com et al
Post by: Ap15e on September 06, 2009, 06:58:15 am
---------------------------------------------------------------------------------------------------------
        local status, rss = luup.inet.wget(url)
        local currentTemp = extractElement(rss, "temp_f")["attrs"]["data"]
        local forecastLowTemp = extractElement(rss, "low")["attrs"]["data"]
        local forecastHighTemp = extractElement(rss, "high")["attrs"]["data"]
        local currentHumidity = extractElement(rss, "humidity")["attrs"]["data"]

currentTemp=math.floor((currentTemp-32)*5/9+0.5)
forecastLowTemp=math.floor((forecastLowTemp-32)*5/9+0.5)
forecastHighTemp=math.floor((forecastHighTemp-32)*5/9+0.5)
---------------------------------------------------------------------------------------------------------

The last three lines should do the trick.
Title: Re: Plugin for Web: weather.com et al
Post by: 325xi on September 06, 2009, 09:32:07 am
Right, but unless guessed adds it as configurable option our changes will be lost when he updates his plugin... you know how it works...

Should we put this stuff into Google Code?..
Title: Re: Plugin for Web: weather.com et al
Post by: guessed on September 06, 2009, 11:00:27 am
I've uploaded a new version to Box.net at the same address:

    http://www.box.net/shared/b7z6s9j9md

which has this code, and a "local" variable called metric (default "false").  This is a placeholder for us once MCV implements the UI/Rendition(s) for Luup Service declaration(s) in the Device/Luup configuration UI's.

The service declaration (S_Weather.xml) now also has a Metric Service variable, type boolean. 

I'm avoiding putting in the parameter hacks that result in configurable parameters in order to encourage MCV's team to complete this work... then we all get it, along with a nicer UI for config.

Once that's available, I'll make the mods to wire it up to the override services for Location and Metric (as spec'd in S_Weather.xml) to give people the ability to override stuff.


In the interim, you only have to edit the source, change "false" to "true" and re-upload.

NOTE: Vera's UI will display "F" at the end of the values, even if Metric, until you change the settings under Location to indicate Metric units, so the two are kinda lock-stepped anyhow, as there's no other [standard, non-hack] way for me to present "up" that the data is in Celcius
Title: Re: Plugin for Web: weather.com et al
Post by: mversluis on September 06, 2009, 05:54:14 pm
Hi All,

I did have the same problem with IE , after installing firefox and start uploading again everything will work.

Only the wron files with the variable paramaters ( IE created then ) are still located in my overvieuw.

Is there some way to deleted those files ..?


Thanks
Best regards,
Marco
Title: Re: Plugin for Web: weather.com et al
Post by: mversluis on September 12, 2009, 04:34:53 pm
Hi all.

Just curios.

I have try to get the humidity working but it wont work.

Pls advise me
See screen dump

The temperature is working
Also the low and high
Humidity is not showing any data , but the data is provide in the current level tab.
So it looks like the variable for the current tab is not copying it to the device.

Would be grateful if any one would help

Second question would it be possible to intergrate the windspeed / winddirection into this plugin ..?

Thanks
Best regards.
Marco
Title: Re: Plugin for Web: weather.com et al
Post by: guessed on September 12, 2009, 05:23:39 pm
For Humidity, Vera doesn't provide a UI/Rendition of the Humidity Sensor Device (urn:schemas-micasaverde-com:device:HumiditySensor:1) so it has the value, but no special UI for it.  For Temperature, Vera has a UI, which is why it's rendering correctly.
Title: Re: Plugin for Web: weather.com et al
Post by: mversluis on September 13, 2009, 07:51:48 am
HI guessed,

Can you explain why it would work with some users and why it would not work witch others.
Is this depending on geo location ore Vera settings.?

Can it be possible to use a other setting , not the humidity one but generic or temperature.
The last one I tested and vera comes up with N/a value. So that doesn’t work

Thanks
Best regards,
Marco
Title: Re: Plugin for Web: weather.com et al
Post by: guessed on September 13, 2009, 11:36:28 am
@mversluis, using the screenshot you previously posted, it looks like it's working as expected.  Humidity is captured from the value in the underlying Google feed (see URL's discussed earlier in this thread to see how it's doing that).

It won't work if:


If you have a situation where it's not working, please provide:
Title: Re: Plugin for Web: weather.com et al
Post by: mversluis on September 13, 2009, 11:52:37 am
Hi uessed,

Thanks for the response.

Proberly I missed something in my explanation. ( sorry , i am a dutch Guy  :) )

When I looked in my dashboard of vera it shows me :
5 icons

1 the plugin
2 temprature
3 low value forecast tempr
4 high value forecast tempr
5 humiity

within the 2,3 ,4 i can see the parameters from google
the 5the  I dont see the any information

--
when I looked into the devices tab.
I can see the same information as showed above.
when I click the huminity + sign , the menu will expand.
Here in the current level the right value is stated.

But you want to see the current level also in the dashboard view.

So my explanation would be :
- The google feeds works ( because all data is showed in current level )
- The data is correct ( checked with igoogle)
- all tempr settings are filled in the current levels and also the view in the dashboad
- the huminity settings are filled in the current levels , BUT not into the dashboard.

It seems like there is a setting the data from current levels , to showing the data in the dashboard.
Some varibable is missing or not set / not corrent.

Do you agree my explemantions ..?
Did i do something wrong ..?

Thanks for youre helping out

Best Regards,
Marco
Title: Re: Plugin for Web: weather.com et al
Post by: guessed on September 19, 2009, 05:19:14 pm
Hey Marco,
Yeap, same problem as I've listed above.  To my knowledge Vera doesn't have a UI/Rendition for Humidity.  It has a Device defn for it, and the backend Service defn, so it can "capture and display" the raw value in the (Setup) mode, but not in the (Dashboard) mode.  You'll see that in Setup mode, a whole lot of extra "internals" information is displayed when compared to Dashboard mode...

At this time, without a rendition from Vera itself, the Humidity values generated by the Plugin would only be useful for Luup-based Scripting....

... at least until Vera opens up the ability for folks to write UI/Rendition plugins...  :)


Sorry about the long delay in responding here, I had a busy week in the day job...
Title: Re: Plugin for Web: weather.com et al
Post by: Anthony420 on September 19, 2009, 05:43:58 pm
Not sure what I'm doing wrong, but I could not upload the files as shown in the Wiki.   Nothing happens when I click go, other than the red circle indicating something is not allowed.  Do I need to be on the local network?  I'm attempting this from NY and my Vera is in SC.

Advice?  Thanks,
Anthony

PS  Running 1.0.918
Title: Re: Plugin for Web: weather.com et al
Post by: bennynations on September 22, 2009, 11:45:29 am
Same issue at Anthony420... I am in TN and vera is in FL.
Title: Re: Plugin for Web: weather.com et al
Post by: guessed on September 22, 2009, 12:13:13 pm
That would be a problem with FindVera.


@MCV: Do you know if FindVera.com completely implements File upload Proxying?
Title: Re: Plugin for Web: weather.com et al
Post by: Vali on September 24, 2009, 05:49:33 am
Not sure what I'm doing wrong, but I could not upload the files as shown in the Wiki.   Nothing happens when I click go, other than the red circle indicating something is not allowed.  Do I need to be on the local network?  I'm attempting this from NY and my Vera is in SC.

Advice?  Thanks,
Anthony

PS  Running 1.0.918
It was an issue regarding file upload via remote access server, I fixed it so now you can upload your files remotely.
Title: Re: Plugin for Web: weather.com et al
Post by: guessed on October 04, 2009, 04:09:44 pm
@Chimpware, I just uploaded a new version to Box.net, and added some doco to the Wiki, to cover two new parameters

    http://wiki.micasaverde.com/index.php/Weather_Plugin

The key one for you is the new Location variable.  This allows you to override the settings I was auto-calculating from Vera's Location information.

Where I would calculate a string like ",,,40512504,-74663464" based upon your Lat/Long so I could build the URL:

     http://www.google.com/ig/api?weather=,,,40512504,-74663464

You can now type in an override string like "New York, USA" or a ZIP code like "10027" and it'll generate a request more like:

     http://www.google.com/ig/api?weather=New+York,USA   OR;
     http://www.google.com/ig/api?weather=10027

You can also use strings like "Sydney,Australia" to get international ones like

     http://www.google.com/ig/api?weather=Sydney,Australia
Title: Re: Plugin for Web: weather.com et al
Post by: bennynations on October 04, 2009, 04:25:24 pm
I tried this plugin and then took it off.  It left a temperature setting under my schlage lock.  I do not know how to remove this.  Any ideas???
Title: Re: Plugin for Web: weather.com et al
Post by: guessed on October 04, 2009, 07:19:46 pm
@bennynations, I have absolutely no idea how that happens, but a few questions:


My Weather device fetches content every 30 minutes (or so).  The only thing I can think of is when the "Device" is removed, that these "Jobs/Tasks" aren't removed along with the code and that's [somehow] causing the problem.
Title: Re: Plugin for Web: weather.com et al
Post by: bennynations on October 04, 2009, 08:30:25 pm
I followed the path and, to my surprise, there is a temperature setting for the door lock.  STRANGE, but true.  Not sure how 74 was inserted there, but I did erase it and all is back to normal.

Thanks for the advice.
Title: Re: Plugin for Web: weather.com et al
Post by: LibraSun on October 05, 2009, 09:25:01 am
This wouldn't be the first time people have noticed "Temperature" fields appearing with non-temp. devices.  In earlier threads, it was noted this happened with certain Z-Wave light switches!

Clearly a bug... have you (all) reported it to MCV?

Title: Re: Plugin for Web: weather.com et al
Post by: guessed on November 07, 2009, 02:40:02 pm
I've released a new version of the code to fix an issue, and to add a minor feature:

In another forum post, I was having problems with the Syntax in the S_Weather.xml file:
    http://forum.micasaverde.com/index.php?topic=1704.15

@RedXIII kindly found the typo, so I've fixed that so the Weather plugin no longer emits an error string in the LuaUPnP.log file during it's startup.


Whilst in there, I added stateVariables for Condition and WindCondition.  These stateVariables are attached to the Parent Device of the Weather plugin.

For Condition, you'll get values from the underlying "condition" element in the XML/Feed.  It's strings like "Sunny", "Partly Cloudy" etc.

For WindCondition, you'll get values from the underlying "wind_condition" element in the XML/Feed.  It's strings like "N at 6 mph"  (I strip out the "Wind: " prefix from the feed value)

These were more for fun than anything, but someone had mentioned wanting the "Condition" data for scripting blinds (I can't recall who).


Release updates also posted to the Wiki:

    http://wiki.micasaverde.com/index.php/Weather_Plugin
Title: Re: Plugin for Web: weather.com et al
Post by: Ap15e on November 07, 2009, 04:29:31 pm
Could you add LastWakeup (= timestamp of weather data update) to your weather device, please?

I'm logging all the data from my physical sensors (temperature, light, and age of measurement (= last wakeup of the sensor device)) and would like to do the same with your virtual weather device.
Title: Re: Plugin for Web: weather.com et al
Post by: guessed on November 11, 2009, 12:31:19 am
ok, I'll put it on my TODO to fill in the standard LastUpdate Variable (on each Device) with the TimeStamp value.  This will make it equivalent to what a ZWave device fills in.
Title: Re: Plugin for Web: weather.com et al
Post by: brsipaq on November 12, 2009, 02:55:59 pm
Guessed,

Does your weather feed include warnings?  Could an event be able to be triggered if a tornado (or some other) warning is issued?

That would be great to have a light / alarm go off in the house if this happened.

Just a suggestion.

Thanks,
Brian
Title: Re: Plugin for Web: weather.com et al
Post by: guessed on November 12, 2009, 03:06:34 pm
The underlying feed is the Google Weather API (which isn't well documented).  The nearest to what you're looking for is the Condition variable I added in the latest release.

It has these values (potentially more)

Clear
Cloudy
Fog
Haze
Light rain
Mostly Cloudy
Overcast
Partly Cloudy
Rain
Rain Showers
Showers
Thunderstorm
Chance of Showers
Chance of Snow
Chance of Storm
Mostly Sunny
Partly Sunny
Scattered Showers
Sunny
Title: Re: Plugin for Web: weather.com et al
Post by: Ap15e on November 13, 2009, 05:20:35 am
Yahoo weather has a condition code for 'tornado' (see http://developer.yahoo.com/weather/), but AFAIK Yahoo does not accept longitude/latitude as input. One could use Google's reverse geocoding (see http://code.google.com/intl/us-US/apis/maps/documentation/services.html#ReverseGeocoding) to translate longitude/latitude to a location ...
Title: Re: Plugin for Web: weather.com et al
Post by: guessed on November 13, 2009, 09:37:11 am
Go for it!  If you write the code I'll replace that part of the internal an republish it (with credits)
Title: Re: Plugin for Web: weather.com et al
Post by: Caffreyboy on November 15, 2009, 05:33:28 am
I tried to use the temperature variable to control a scene in vera, where as a test, a light would go on if a certain current temperature was reached, but it didn't work.

Any suggestions?

Thank you.
Title: Re: Plugin for Web: weather.com et al
Post by: sjolshagen on November 27, 2009, 06:01:55 pm
The underlying feed is the Google Weather API (which isn't well documented).  The nearest to what you're looking for is the Condition variable I added in the latest release.

It has these values (potentially more)

Clear
Cloudy
Fog
Haze
Light rain
Mostly Cloudy
...


guessed,

How did you identify the entries in the list? (Asking 'cause I'm looking for "Snow" "Sleet" or similar and wondering what the valid entries would be from Google)

// Thomas
Title: Re: Plugin for Web: weather.com et al
Post by: guessed on November 27, 2009, 06:57:24 pm
I found a blog posting after doing a whole bunch of searches.  I can't remember the URL but it had the most comprehensive list I'd seen so I added the full list of it's entries to the wiki for the weather plugin.

Unfortunately nothing seems Formal when using the google API.
Title: Re: Plugin for Web: weather.com et al
Post by: sjolshagen on December 08, 2009, 08:47:47 am
Found some winter/fall related condition values as well (the previous values seem to have all been captured in June/July):


Snow
Snow Showers
Flurries
Rain and Snow
Ice/Snow
Fog
Windy
Heavy Rain


The big bummer, for me, with the google weather output is the lack of accumulation related data :-[
Title: Re: Plugin for Web: weather.com et al
Post by: guessed on December 08, 2009, 10:41:15 am
Thanks for the updated list.  I've added them to the Wiki page for the plugin.
Title: Re: Plugin for Web: weather.com et al
Post by: coryj on January 12, 2010, 11:59:21 am
I seem to be missing something.  I am running through the steps on Wiki and I can't get this to work.  I originally used IE and the Plugin names look like this:

C%3A%5CDocuments%20and%20Settings%5Ccojohnson%5CDesktop%5CWeather%5CD_Weather.xml

and so on.

I then loaded firefox and tried to upload the 3 files and nothing seems to change.  Is there a way to delete the ones that are incorrect so that the new ones will work.  i can't even add them a second time.  I am new to all of this so please bear with me.  Thanks
Title: Re: Plugin for Web: weather.com et al
Post by: guessed on January 12, 2010, 12:28:58 pm
@coryj

The instructions in the Wiki indicate that the filenames extracted from the ZIP must match exactly prior to upload:

    http://wiki.micasaverde.com/index.php/Weather_Plugin

If the names matched 100% after extraction from the ZIP, but then got mangled during the upload, then that's likely a bug in Vera's upload functionality and/or the browser being used.

There is no way to "delete" bogus files via the Web Interface.  Instead you'd have to login to Vera directly, via SSH (etc), and delete them from the relevant directories.
Title: Re: Plugin for Web: weather.com et al
Post by: mversluis on January 13, 2010, 12:04:18 pm
@coryj and other forum members.

I few of us have the same problems within IE , when the plugin is uploaded true IE.
The fault would be there is a complete path ( where teh source was located) into the filename.

Till so fare i did not get my answer how to solve it.

This noon I was walking to some collegues of mine , and pointed to this problem.
He told me , this would be very easy to solve. Login in and whola 4 correpted files , he ask for 4 time are you sure , really sure , can i deleted them.

So deleted the files was so easy.

Would it be helpfull to write it down ,and maby can place it on the wiki also ..?

Marco
Title: Re: Plugin for Web: weather.com et al
Post by: rmwarren on April 30, 2010, 11:59:00 pm
I just received my Vera and tried to set up the weather plugin and I have had the same issue as coryj when uploading the files via IE. Can anyone expand on the suggestion to "login to Vera directly, via SSH" in order to delete the bad file references, I am not familiar with this.

Thanks.
Title: Re: Plugin for Web: weather.com et al
Post by: mikeholczer on May 01, 2010, 09:14:30 am
Since you are using IE, I'm going to assume you are on Windows which does not include a ssh client. You could download and use Putty. It sounds like you aren't familiar with ssh though, so I would suggest using the the OpenWRT file editor to delete files from your Vera. If you go to the following URL you should see the files you uploaded and have the option to delete them using the red "X".

http://LOCAL_IP_ADDRESS_OF_YOUR_VERA/cgi-bin/webif/system-editor.sh?path=/etc/cmh-ludl
Title: Re: Plugin for Web: weather.com et al
Post by: guessed on May 01, 2010, 03:19:53 pm
In the meantime, I've added a WARNING to the Installation section of the Plugin to let people know not to use Internet Explorer/IE to upload the plugin Files due to problems in Vera's interface.
Title: Re: Plugin for Web: weather.com et al
Post by: grybrd on May 04, 2010, 11:45:53 am
Newbie here ... thought I would try my first plugin using the documented weather plugin.   Did not have any problem up loading the xml files and can see them on my unit.  I am having a problem building the device on latest version of U13 ... in using the toolbar "plugin" I am confused as to what needs to be filled in and where to place the D_weather.xml reference ???

Thanks in advance for the help :-)
Title: Re: Plugin for Web: weather.com et al
Post by: grybrd on May 04, 2010, 10:42:14 pm
I either figured it out or lucked out ... but it is working:-)  THANKS GUESSED!!!
Title: Re: Plugin for Web: weather.com et al
Post by: guessed on May 05, 2010, 11:30:06 pm
Glad to hear you got it working ok.
Title: Noob question with weather plugin
Post by: longhorn14 on June 25, 2010, 11:54:25 am
I am just starting on all this, trying to find my way. I was going to set up a simple scene to do something (like maybe turn on a light just to test) based on the Condition being "Partly Cloudy" from the weather plugin.
When I test the following:
Code: [Select]
local lul_cond=luup.variable_get("urn:demo-micasaverde-com:device:weather:1","Condition",13)
 if( lul_cond = "Partly Cloudy" ) then
   return false
 end

I get "code failed" for the test. Any ideas?
If someone can point me in the right direction, i will learn a lot and promise to help others once I get the hang of this stuff.
Thanks,
nathan
Austin, TX
Title: Re: Noob question with weather plugin
Post by: guest4690 on June 25, 2010, 11:56:55 am
to compare values, use two '=' in a row.  the line
Code: [Select]
if( lul_cond = "Partly Cloudy" ) then should be
Code: [Select]
if( lul_cond == "Partly Cloudy" ) then
Title: Re: Noob question with weather plugin
Post by: longhorn14 on June 25, 2010, 12:27:11 pm
Awesome Javier, thanks for the rapid response. I think JS uses the same method (==). My scripting is rusty, at best.
Title: Re: Plugin for Web: weather.com et al
Post by: newb on July 01, 2010, 09:42:43 am
I either figured it out or lucked out ... but it is working:-)  THANKS GUESSED!!!

But how?! I can't add weather plugin to my vera
Can you specify making this device step-by-step (maybe with screenshot?)
Title: Re: Plugin for Web: weather.com et al
Post by: objecta on July 06, 2010, 04:25:43 am
First, thanks for this fine plugin, it's working perfectly here in Denmark.

I noticed that if I try to request weather information for my location, using IE (http://www.google.co.uk/ig/api?weather="Kerteminde, Denmark") I get the XML results back localized, see below.

Is there any way to telle Vera to act as a request for a specific language(local)?

<current_conditions>
  <condition data="Skyet" />
  <temp_f data="63" />
  <temp_c data="17" />
  <humidity data="Fugtighed: 68 %" />
  <icon data="/ig/images/weather/cloudy.gif" />
  <wind_condition data="Vind: NW og 4 m/s" />
  </current_conditions>
- <forecast_conditions>
  <day_of_week data="tir" />
  <low data="9" />
  <high data="21" />
  <icon data="/ig/images/weather/chance_of_rain.gif" />
  <condition data="Risiko for regn" />
  </forecast_conditions>
Title: Re: Plugin for Web: weather.com et al
Post by: Ap15e on July 06, 2010, 06:06:25 am
http://groups.google.com/group/Google-Desktop-Developer/browse_thread/thread/368a98b651f0fa5f
Title: Re: Plugin for Web: weather.com et al
Post by: markiper on July 06, 2010, 10:45:30 am
Installed the plugin today on a VERA1 running UI3 latest version (1.1.329), but I cannot see HUMIDITY information being displayed, only temperature information.  Does anyone know if this plugin is working correctly on UI3, or is it only UI2 for the moment.
Title: Re: Plugin for Web: weather.com et al
Post by: guessed on July 06, 2010, 11:05:02 am
Humidity values are captured, but not displayed until UI4.  Neither UI2, nor UI3, had UI Renderers built into Vera for the Humidity values.

You should be able to see the humidity values by looking at the Properties of that component.

This is listed in the "Errors" section of the documentation:
    http://code.mios.com/trac/mios_weather

Title: Re: Plugin for Web: weather.com et al
Post by: guessed on July 06, 2010, 11:16:15 am
First, thanks for this fine plugin, it's working perfectly here in Denmark.

I noticed that if I try to request weather information for my location, using IE (http://www.google.co.uk/ig/api?weather="Kerteminde, Denmark") I get the XML results back localized, see below.

Is there any way to telle Vera to act as a request for a specific language(local)?

<current_conditions>
  <condition data="Skyet" />
  <temp_f data="63" />
  <temp_c data="17" />
  <humidity data="Fugtighed: 68 %" />
  <icon data="/ig/images/weather/cloudy.gif" />
  <wind_condition data="Vind: NW og 4 m/s" />
  </current_conditions>
- <forecast_conditions>
  <day_of_week data="tir" />
  <low data="9" />
  <high data="21" />
  <icon data="/ig/images/weather/chance_of_rain.gif" />
  <condition data="Risiko for regn" />
  </forecast_conditions>


Not at the moment.  The Plugin itself "parses" some of the output (mostly the Humidity value) so it's kinda locked to English.  Also, I do intend to add Event'ing at some point, where the weather conditions can be used to trigger Events (to shut blinds, or whatever).  These will also require a fixed-list (english) so that it can be statically described to Vera's Event mechanism.

I've added:

     http://code.mios.com/trac/mios_weather/ticket/4

to track the desire to extract the i18n version of the values, and not just the English ones.
Title: Re: Plugin for Web: weather.com et al
Post by: objecta on July 07, 2010, 02:16:59 am
I did try to add the bold line to the I_GoogleWeather.xml file, to see if the Wind information did change to Danish, but no succes. I'm not sure if this is the way to add the hl= parameter.

local location = luup.variable_get("urn:upnp-micasaverde-com:serviceId:Weather1", "Location", PARENT_DEVICE)
    if (location ~= nil and location ~= "") then
    url = url .. string.gsub(location, " ", "+")
    else
    url = url .. ",,," .. luup.latitude * 1000000 .. "," .. luup.longitude * 1000000
    end

    url = url .. "%26hl=da"
Title: Re: Plugin for Web: weather.com et al
Post by: newb on July 07, 2010, 08:40:49 am
I either figured it out or lucked out ... but it is working:-)  THANKS GUESSED!!!

But how?! I can't add weather plugin to my vera
Can you specify making this device step-by-step (maybe with screenshot?)
I can't Navigate to Devices, scroll to the bottom at the Add device  form. . I can't see Devices on my Vera (i used UI3).
I find create device at MIOS developers tab. It's right place?

Thanks in advance for the help
Title: Re: Plugin for Web: weather.com et al
Post by: mario23 on July 27, 2010, 11:16:53 pm
I have a quick question.  I loaded up the latest weather build you posted.
Thanks for the step by step writeup by the way.
I noticed today that the temp values are not updating.
Did I do something wrong?
tks
Title: Re: Plugin for Web: weather.com et al
Post by: guessed on July 28, 2010, 02:15:41 am
Is this the ui2/3 build or the ui4 build?
Title: Re: Plugin for Web: weather.com et al
Post by: mario23 on July 28, 2010, 09:09:36 am
sorry...ui4
Title: Re: Plugin for Web: weather.com et al
Post by: guessed on July 28, 2010, 11:28:30 am
Definitely odd.  There was a problem in the UI2 build where it was possible for the plugin to stop refreshing every 30 minutes.  I corrected this in the UI4 codeline and I've been running it for a while now without issue, although there aren't that many people that are running it just yet, due to the limited exposure of UI4 itself,,, so it's possible you've found a new case.

Questions:

a) I'm assuming you uploaded all 3x files from the [new, UI4] Plugin, correct?
b) If you upgraded from UI2/3, were you running the [older] weather plugin prior?
c) Does it give you any values at all?
d) Any errors when it starts?  (These are usually represented in the upper Right corner of UI4)
e) If you restart (using the "reload" icon near the upper right of Vera/UI4) does the plugin begin working again?

Depending upon how the above go, I may need logs to diagnose further.  Let's get through the above first though, since Log trolling isn't easy ;-)
Title: Re: Plugin for Web: weather.com et al
Post by: mario23 on July 28, 2010, 12:44:24 pm
No Problem

Definitely odd.  There was a problem in the UI2 build where it was possible for the plugin to stop refreshing every 30 minutes.  I corrected this in the UI4 codeline and I've been running it for a while now without issue, although there aren't that many people that are running it just yet, due to the limited exposure of UI4 itself,,, so it's possible you've found a new case.

Questions:

a) I'm assuming you uploaded all 3x files from the [new, UI4] Plugin, correct?  [font=Verdana]All 4 files that were in the zip[/font]
b) If you upgraded from UI2/3, were you running the [older] weather plugin prior?  Yes
c) Does it give you any values at all? Yes, all values are there...just not updating
d) Any errors when it starts?  (These are usually represented in the upper Right corner of UI4) None
e) If you restart (using the "reload" icon near the upper right of Vera/UI4) does the plugin begin working again? Everything stays the same

Depending upon how the above go, I may need logs to diagnose further.  Let's get through the above first though, since Log trolling isn't easy ;-)

By the way, how hard is it to just delete everything and re-install.  Its possible that when I removed the old weather plugin then installed this one, that this may have caused the error...

Thanks again for your help...
Title: Re: Plugin for Web: weather.com et al
Post by: guessed on July 28, 2010, 10:52:41 pm
When you upload the new files, they should just taek the place of the existing ones, and any existing Device will just take on the new personality.... in theory... as that's how I developed the [UI4] extensions.

The only other thing that really comes to mind is whether you have your Location information set, perhaps this got nuked somehow in the upgrade process?  In UI4, Location is spec'd in the Toolbox item called "Location" and you need to have it set (I'm thinking you do, but would like to double check due to the upgrade involvement)

Past that, I'm going to need a copy of your log file (which you have to get by logging onto your box shortly after kicking off a "Reload" operation (the Weather plugin emits a few messages during it's startup that I'd need to see to determine how it's failing)


Without deleting your existing Device, you can also create a new one (two Weather Devices, in effect).  Can you cycle through that perhaps and see if there's an upgrade-related issue in my code?
Title: Re: Plugin for Web: weather.com et al
Post by: mario23 on July 28, 2010, 11:08:30 pm
Ok, I checked the location and its still good.
I also re-installed with the same results.

I did notice one thing though that I recall happening the first time I tried.
It may not be important but in step 13 of your install procedure, it says to "Close the MiOS developers dialog, and click (Save)".
When I close the mios dialog box, there is no option at that point to save.
I don't know but that may have something to do with it.

I can run a log too if you prefer.  Is that written up in the forum here somewhere?
I'd give it a shot...
Title: Re: Plugin for Web: weather.com et al
Post by: mario23 on July 30, 2010, 11:33:07 am
Something else I noticed...

When I try to poll Google Weather, it fails advising "no implementation"

Title: Re: Plugin for Web: weather.com et al
Post by: guessed on July 30, 2010, 12:23:32 pm
Yeah, that's more of a method not being implemented, something that never has so it's not new.  I added http://code.mios.com/trac/mios_weather/ticket/5 to add it, since it would likely be useful to have it for "manual" refreshes.

That said, you shouldn't see that button if the Plugin is working correctly. 

Normally, you'd see this in the Dashboard mode:
    http://code.mios.com/trac/mios_weather/attachment/wiki/WikiStart/WeatherDeviceUI4.png

and you'd see this in it's Edit Dialog:
    http://code.mios.com/trac/mios_weather/attachment/wiki/Installation-UI4/WeatherDialogUI4.png

so there's no way to get to the "(Poll)" button, as I disabled it in the D_Weather1.json file.  Since you've already valudated that you have all 4x files in "MiOS Developers -> Luup files", perhaps a screenshot of the Weather Device's "Advanced" tab?


I'm still trying to work out how to best "describe" getting the logs out of Vera, or a smarter way to get them, since you'd have to "ssh root@<yourVera>" to go get them, and that's typically unfriendly for people that don't know what "ssh" is.
Title: Re: Plugin for Web: weather.com et al
Post by: strangely on July 30, 2010, 03:39:58 pm
Maybe if he submits a trouble ticket and MCV forwards them to you?

MCV should have a button for log collection and local download really!
Title: Re: Plugin for Web: weather.com et al
Post by: mario23 on July 30, 2010, 11:52:26 pm
Whatever is best, I would be willing to do.

Something weird I noticed tonight...the current temp finally changed on its own from 85 to 84 though nothing else changed and that temp is quite a bit off from the correct temp.  

In the meantime I'll post that screenshot and thanks for the help...
(http://i102.photobucket.com/albums/m95/atemiryu/screen.jpg)
(http://i102.photobucket.com/albums/m95/atemiryu/screen2.jpg)
Title: Re: Plugin for Web: weather.com et al
Post by: guessed on August 03, 2010, 03:52:09 am
@mario23,
I've sent you a PM with a link to a file to test.  It basically increases the timeout to 10 seconds, from 5, "just in case.  Given your description of it working "sometimes", this is my next shot.  If it works, then I'll repackage it into the larger form for everyone else.

If that doesn't work reliably then I'll need to get you to Set Verbose Logging on, then Click the "Restart" Button on the Dashboard, and then file a Ticket to MCV and team with some instructions at the top indicating that:

   "User Guessed requires a copy of the LuaUPnP.log file to debug the Weather plugin"

or something to that effect.  Hopefully they'll do it, if not, it'll certainly help drive the case for a better remote logging ability ;)
Title: Re: Plugin for Web: weather.com et al
Post by: mario23 on August 03, 2010, 10:23:37 am
PM replied...we'll give this a shot.
Thanks
Title: Re: Plugin for Web: weather.com et al
Post by: guessed on August 05, 2010, 09:46:02 pm
ok, I've bundled this 10second timeout change in the new version UI4-version, downloadable from Box.net
Title: Re: Plugin for Web: weather.com et al
Post by: mario23 on August 05, 2010, 11:47:17 pm
It does seem to be working for me.
Thanks
Title: Re: Plugin for Web: weather.com et al
Post by: mario23 on August 07, 2010, 01:27:25 pm
Only thing I've noticed is it does not seem to be very accurate.
Current reading for here shows 82.
When I check online, its 91 degrees.

I don't know if its refreshing when its supposed to.  Maybe that's why?
I'll keep playing with it...
Title: Re: Plugin for Web: weather.com et al
Post by: strangely on August 07, 2010, 02:13:12 pm
@mario23, You should also try to check it directly on Google weather to see if it correlates?! Stupid question but I assume you have the right city set up in the location tab, or have entered it directly into the plugin?

FYI, mine currently matches what Google displays, and my actual temp gauge is showing 2 F lower, which is close enough I guess.
Title: Re: Plugin for Web: weather.com et al
Post by: mario23 on August 14, 2010, 10:25:41 am
I haven't given up.
Location is correct.  It just seems to be off by quite a bit.
I'm still playing with  it...
Title: Re: Plugin for Web: weather.com et al
Post by: shady on August 15, 2010, 12:57:27 am
Does anyone notice the ambient temperature and low temperature readings are transposed.  It could just be a fluke, but here are my readigs compred to Google weather:

Cond = Clear
T  = 63 F
T High = 78 F
T Low = 60

Edit: as I was writing this it seems to have corrected and everything matches Google now.
Title: Re: Plugin for Web: weather.com et al
Post by: strangely on August 15, 2010, 02:09:11 am
@shady, what did you type that the spam catcher caught?
Title: Re: Plugin for Web: weather.com et al
Post by: shady on August 15, 2010, 08:55:33 pm
At first I was thinking, "What are you talking about Strangely?"

Then after seeing what you meant, I had to think..."What did I type?"

It was A-M-B-I-E-N-T, which if you leave off the "T" you get a brandname insomnia treatment, lol.
Title: Re: Plugin for Web: weather.com et al
Post by: guessed on August 16, 2010, 05:21:20 pm
fixed...  (ambient) that is ;-)
Title: Re: Plugin for Web: weather.com et al
Post by: techsan on August 20, 2010, 01:16:15 pm
@Guessed I loaded the plugin last night on UI4. All of the metrics come up as devices but no information is displayed. I set my location to Dallas knowing this location would be in Google and still nothing.  :-\ Very new to Vera but excited to learn, anything you ocan do to help would be VERY appreciated! Also when I save anything, top right states "starting LUA engine" so I think I'm good there as well.
Title: Re: Plugin for Web: weather.com et al
Post by: guessed on August 20, 2010, 08:27:49 pm
Ok, you'll probably first want to check Network connectivity from Vera itself (to the Internet)..

In UI4, goto

Code: [Select]
    Advanced -> Net & Wifi -> (TroubleShoot Network)
It'll produce output that, when formatted, will look something like:

Code: [Select]
=== IP Configuration ===
br-lan Link encap:Ethernet HWaddr 00:C0:02:9C:xx:00 inet addr:192.168.81.1 Bcast:192.168.81.255 Mask:255.255.255.0
eth0 Link encap:Ethernet HWaddr 00:C0:02:9C:xx:01
eth0.0 Link encap:Ethernet HWaddr 00:C0:02:9C:xx:01
eth0.1 Link encap:Ethernet HWaddr 00:C0:02:9C:xx:01 inet addr:192.168.x.yyy Bcast:192.168.x.255 Mask:255.255.255.0 inet addr:127.0.0.1 Mask:255.0.0.0
wl0 Link encap:Ethernet HWaddr 00:C0:02:9C:xx:00 Interrupt:2 Base address:0x5000
========================
External IP: xx.xx.x.xxx
=== Testing Gateway: 192.168.x.1 ===
..... GATEWAY:OK
=== Testing DnsServer: 192.168.x.1 ===
..... DNSSERVER1:OK
========================
=== Testing External Servers ===
..... GOOGLE.COM:OK
..... sta1.mios.com:OK
..... evt1.mios.com:OK ts1.mios.com TUNNEL CONN:OK
..... fwd1.mios.com:OK fwd1.mios.com TUNNEL CONN:OK
=== SSH_TUNNELS: === Found 2 ssh sessions running Tech Support Tunnels are running Remote Control Tunnels are running
== DONE ==

In particular, the bits at the bottom are testing connectivity to Google, which is where the Weather Plugin currently gets it's data from.

In your case, it's running a URL like:

    http://www.google.com/ig/api?weather=Dallas

which is working for me, but I suspect there is some sort of Vera -> Internet connectivity problem that's preventing it from reaching out to Google correctly.  The above "Test" should let you know if it can contact them or not, whether there are DNS problems (etc)

Failing that, it would be handy to know how you're connected to the Net (What ISP, What Router, Whether Vera is wired (Eth1) or Wireless to your Router (etc)
Title: Re: Plugin for Web: weather.com et al
Post by: clfleener on August 21, 2010, 11:33:40 am
I have the same problem.  I opened ssh on vera (vera2  1.1.1047), executed the info.sh script and received the following message:

/usr/bin/lua: can't load library 'liblua.so.5.1.4'.
Title: Re: Plugin for Web: weather.com et al
Post by: guessed on August 21, 2010, 01:15:10 pm
Looks like my refreshCache routine isn't firing via luup.call_timer in 1.1.1047 for some reason.  Will have to look at that this weekend.

It'll be most noticeable in new deployments, as existing ones will show the old values until the refreshCache runs
Title: Re: Plugin for Web: weather.com et al
Post by: techsan on August 21, 2010, 03:11:26 pm
Ok found my error. I was under the assumption that the global location setting on the Vera would propagate to the plugin. Once I entered the plugin location details it fired right up. Thanks all.
Title: Re: Plugin for Web: weather.com et al
Post by: guessed on August 21, 2010, 04:30:59 pm
@techsan, the local location will override anything specified at Veras global location.  I use the global location setting only (local was added for some in order to get better fine tuning than Veras location)

In looking at my logs this morning, I saw that sometimes my startup refreshCache isn't firing so I need to look into why, as that would also cause what you were seeing esp if it's intermittant
Title: Re: Plugin for Web: weather.com et al
Post by: guessed on August 22, 2010, 01:04:41 pm
Ok, so I found the problem.  Many thanks to @mario23, @techsan and @clfleener for the clue(s).

Turns out that under UI4, with Vera2, there's a difference in the "default" output format for floating-point variables that resulted in the breakage for Vera2/UI4 users.

Vera1/UI4 users would not have seen this problem, and up until about 2 days ago, that's what I was using to develop the plugin.

For those interested, the gory details are available in:
    http://code.mios.com/trac/mios_weather/ticket/6

and the "fix" is available in:
    http://code.mios.com/trac/mios_weather/export/13/I_GoogleWeather.xml


I've just gotta repackage it into the ZIP file, and then repush (which I'll announce once done).

I've let it run overnight on my Vera2 and everything is fine.


@techsan, you can now also go back to using Vera's global Location setting, instead of using the override.  The override was effectively "bypassing" the problem since I no longer had to format the lat/long from Vera's location.
Title: Re: Plugin for Web: weather.com et al
Post by: guessed on August 22, 2010, 01:12:01 pm
ok, fixes formally released as Weather-1.42.zip here:

     http://www.box.net/shared/jun1lydysh
Title: Re: Plugin for Web: weather.com et al
Post by: mario23 on August 22, 2010, 02:24:41 pm
Great news...I new you would figure it out ;)
Tks
Title: Re: Plugin for Web: weather.com et al
Post by: strangely on August 22, 2010, 02:31:44 pm
Right now thats fixed...back to the CEC stuff! ;)
Title: Re: Plugin for Web: weather.com et al
Post by: guessed on August 22, 2010, 02:46:56 pm
kinda, just working on some tweaks for the Paradox, under UI4, so it handles Armed/Bypass correctly, then I'll go back to the HDMI-CEC...
Title: Re: Plugin for Web: weather.com et al
Post by: techsan on August 25, 2010, 06:30:11 pm
@guessed Thanks for the followup. As usual with your tweeks...IT WORKS!
Title: Re: Plugin for Web: weather.com et al
Post by: guessed on August 25, 2010, 06:36:41 pm
You're welcome!  Sorry for the short disruption. 

Luckily this is the only discernible difference in coding Vera1 vs Vera2.  It's better coding practice to Explicitly format it this way, rather than what I was previously using.



NOTE: I haven't fixed the UI2/UI3 Version, so folks upgrading Vera to UI4 will really need to update the Weather Plugin to the UI4 version.  It adds a few new UI bells, so probably worthwhile doing anyhow.
Title: Re: Plugin for Web: weather.com et al
Post by: myhomeserver on September 10, 2010, 06:24:45 pm
excellent work on this...

So, can we now use these features in scenes.  I want to create some heating/cooling/ventilation for my crawlspace based on temp and humidity.  Sorry if this has been asked before....Im using UI4 Beta.  thanks for all the hard work on this plugin!
Title: Re: Plugin for Web: weather.com et al
Post by: guessed on September 10, 2010, 07:01:44 pm
unfortunately no, it's still waiting on the Bug that I filed against the Plugin framework:

     http://bugs.micasaverde.com/view.php?id=1038


MCV was nice enough to grant me permissions to assign and move things around in Mantis, so I've pushed it to the Web Team, and the UI4 Queue, to get visibility..   8)

Quote
thanks for all the hard work on this plugin!

You're welcome, it's a fun little side-line!  Once the scene stuff is ready, I can imagine all sorts of crazy automation going on...  My wife is waiting for the day that Vera locks her out of the house, aka 2001.
Title: Re: Plugin for Web: weather.com et al
Post by: myhomeserver on September 11, 2010, 12:09:36 am
Great to hear, I'll be keeping a close eye on this. Thanks again for the help!
Title: Re: Plugin for Web: weather.com et al
Post by: anthonyris on October 15, 2010, 01:31:14 am
Just installed the newer Weather plugin on Vera2. Nice work.

Works well with SQ Remote as well. Be great if the weather conditions could be pulled in. I can't find an SQ Remote module that takes the variable text for conditions tho.

.//A.

unfortunately no, it's still waiting on the Bug that I filed against the Plugin framework:

     http://bugs.micasaverde.com/view.php?id=1038


MCV was nice enough to grant me permissions to assign and move things around in Mantis, so I've pushed it to the Web Team, and the UI4 Queue, to get visibility..   8)

Quote
thanks for all the hard work on this plugin!

You're welcome, it's a fun little side-line!  Once the scene stuff is ready, I can imagine all sorts of crazy automation going on...  My wife is waiting for the day that Vera locks her out of the house, aka 2001.
Title: Re: Plugin for Web: weather.com et al
Post by: guessed on October 15, 2010, 12:22:27 pm
Just installed the newer Weather plugin on Vera2. Nice work.

Thanks, it's always a work-in-progress, but it's nice to be able to publish up some of the weather condition stuff to the Dash in UI4.

Quote
Works well with SQ Remote as well. Be great if the weather conditions could be pulled in. I can't find an SQ Remote module that takes the variable text for conditions tho.

I use SQRemote so it gets healthy testing there.  Their current editor lets users bind Controls to a Device, rather than an attribute (variable) of a Device.  For simplicity, that's what most people need, but their engine is a lot more flexible than that.

If you want to see what I mean, check out the XML version of your SQRemote configuration, after a "Save/Backup" operation to Box.net

You might poke them on their forums to add functionality.  I'm also open to "copying" all the Weather attributes to the parent device (as a dup of what's in the Children), and adding URL's to the Image/GIF Versions, if any Control Point want to display a pretty UI for the Weather Plugin.

Given the Multitasking of these phones, and the proliferation of cheap Weather apps, it's probably not high on anyone's list, relative to some other items, so I've never pushed it. 

I have some Enh's against UI4's Plugin Framework to support this type of thing so I can help make a better, more graphical, Dashboard experience for the Weather Plugin.
Title: Re: Plugin for Web: weather.com et al
Post by: myhomeserver on January 03, 2011, 01:56:30 pm
Thanks for all the help on this plugin, it rocks!

I have a scene setup but want to add more conditions instead of just Snow Showers, I want to add Ice, Snow, and other snowy and icy conditions

My code works here, but can I add an OR statement for multiple conditions?  Sorry, Im not very good at this stuff!

=================================================

local lul_tmp = luup.variable_get("urn:upnp-micasaverde-com:serviceId:Weather1","Condition",58)
if (lul_tmp=="Snow Showers") then
   luup.call_action("urn:upnp-org:serviceId:SwitchPower1","SetTarget",{ newTargetValue="1" },32)
else
   luup.call_action("urn:upnp-org:serviceId:SwitchPower1","SetTarget",{ newTargetValue="0" },32)

end

================================


Title: Re: Plugin for Web: weather.com et al
Post by: guessed on January 03, 2011, 02:19:23 pm
You can use an "or" to join these conditions together, and use the find method, available on all String variables, to look for a partial "Snow" or "Ice" in the Weather condition string, to save you listing all the combinations. 

The result will be something like:

Code: [Select]
local tmp = luup.variable_get("urn:upnp-micasaverde-com:serviceId:Weather1", "Condition", 58)
if ((tmp.find("Ice") ~= nil) or (tmp.find("Snow") ~= nil)) then
   luup.call_action("urn:upnp-org:serviceId:SwitchPower1", "SetTarget", {newTargetValue="1"}, 32)
else
   luup.call_action("urn:upnp-org:serviceId:SwitchPower1", "SetTarget", {newTargetValue="0"}, 32)
end

Title: Re: Plugin for Web: weather.com et al
Post by: Ap15e on January 03, 2011, 02:48:51 pm
The weather conditions as defined by Google are kind of inconsistent:

Light snow
Rain and Snow

To make sure you don't miss a snow condition, always check for 'snow' and for 'Snow' - and you should check that 'Chance' isn't part of the condition ...

Edit:
... and 'chance' ...
Title: Re: Plugin for Web: weather.com et al
Post by: myhomeserver on January 03, 2011, 03:30:54 pm
thanks so much, you two are a huge part of the success of these boards...
Title: Re: Plugin for Web: weather.com et al
Post by: JOD on January 03, 2011, 08:17:21 pm
thanks so much, you two are a huge part of the success of these boards...

I'll DITTO that....

JOD.
Title: Re: Plugin for Web: weather.com et al
Post by: MNB on January 03, 2011, 10:46:59 pm
Slow question (newbie).. Where does one get the latest plugin and secondly how does one install it.  :-\  I don't see it in the MiOS marketplace is there some other place one should look? thanxs in advance
Title: Re: Plugin for Web: weather.com et al
Post by: MNB on January 03, 2011, 10:58:26 pm
Never mind.. found the procedure on WIKI pages
Title: Re: Plugin for Web: weather.com et al
Post by: BartEv on January 04, 2011, 08:58:39 am
Thanx for the nice Plug-in you made!!!

I've found 3 problems with the Weather plugin:
(Found with Vera v2 using UI4 V1.1.1047)

1)
When creating an Event trigged by the Weather plugin, the input fields "Name for thus event" and "Condition" does not populate.
Looking more in detail the problem can traced back in in the  file: D_Weather.json. The allowedValueList contains spaces and one slash in the index-fields.
After replacing these spaces and slash by an under-score "_", the input fields does populate. Of course the file "I_GoogleWeather.xml" needs to be adapted as well so that the condition field generated the correct spelled condition. I've added these two lines after line 158

Code: [Select]
condition = string.gsub(condition, " ", "_")
condition = string.gsub(condition, "/", "_")

2)
Google has two fields for sending the current temperature.
"temp_f" for Imperial measurements and "temp_c" for metrics.
Currently the Weather-plug always uses the Imperial value, so when a Metric unitSystem is detected the value is wrongly scaled.

My solution to solve this problem is replacing line 121:
Code: [Select]
local currentTemp = extractElement(rss, "temp_f")["attrs"]["data"]with these two lines
Code: [Select]
local currentTempF = extractElement(rss, "temp_f")["attrs"]["data"]
local currentTempC = extractElement(rss, "temp_c")["attrs"]["data"]

and add rephrase the if statement below like this:
Code: [Select]
     if (metric == true) then
              --
              -- Scale the values from Imperial to Metric
              --
              if (unitSystem == "US") then
                  forecastLowTemp = math.floor((forecastLowTemp-32) * 5/9 + 0.5)
                  forecastHighTemp = math.floor((forecastHighTemp-32) * 5/9 + 0.5)
              end
      currentTemp = currentTempC
          else
              --
              -- Scale the values from Metric to Imperial
              --
              if (unitSystem ~= "US") then
                  forecastLowTemp = math.floor(forecastLowTemp * 1.8 + 32)
                  forecastHighTemp = math.floor(forecastHighTemp * 1.8 + 32)
              end
      currentTemp = currentTempF
          end

3)
When calling the update function: http://ip-addr:portnr/data_request?id=lu_sdata&output_format=xml
The fields "WindCondition" and "Condition" are not reported. This can be solved by adding 2 lines of code the the file "S_Weather.xml"
Code: [Select]
<shortCode>condition</shortCode>
<shortCode>windcondition</shortCode>
Within the appropriate stateVariable - block ie after the 2-lines
Code: [Select]
<defaultValue></defaultValue>

Cheers Bart
Title: Re: Plugin for Web: weather.com et al
Post by: guessed on January 05, 2011, 12:46:06 am
1)  When creating an Event trigged by the Weather plugin, the input fields "Name for thus event" and "Condition" does not populate.
Yes, that's a Bug in the Plugin Framework.  I reference it in the installation instructions.

Quote
    There's no Scene awareness, due to Vera Bug 1038...

This bug really needs to be fixed, since "any" value should be permitted on the LHS or RHS of the Scene listings, and MiOS should correctly encode these to it's scheme prior to emitting to the target Markup (HTML, XML, JSON, etc)

I don't plan on working around this bug, but instead will wait for it to be fixed correctly in the MiOS base code.

Note that if changes were made to these values, it's likely that existing Scenes scripted against the "space permitted" values would break, which is another reason we need Bug 1038 fixed.

Quote
2) Google has two fields for sending the current temperature.
There was a reason I did it this way, but I can't remember the original reasoning.

Can you provide, for your region, a copy of the XML output for the Weather XML Feed from Google?  I seem to recall some weird combo of how the values needed to be specified in Vera, and some sort of interaction with how the "Metric" flag was set at the Vera level (I'll need a copy of how you have that value set in Vera, along with the Plugin's Parameter val)

Hopefully this will jog my mind as to why I did it the current way....  something along the lines of Vera's internal data values always assuming degF or something weird like that.

Happy to make the change once we get through initial discovery, and I can have some others validate it (either Europe or Oz/Asia)

Quote
3) When calling the update function: http://ip-addr:portnr/data_request?id=lu_sdata&output_format=xml
Thanks!  Didn't know about that.  Very handy indeed.  Have added to source control for S_Weather.xml and will package into formal .ZIP once we sort out the other issues.
Title: Re: Plugin for Web: weather.com et al
Post by: myhomeserver on January 07, 2011, 09:39:03 am
You can use an "or" to join these conditions together, and use the find method, available on all String variables, to look for a partial "Snow" or "Ice" in the Weather condition string, to save you listing all the combinations.  

The result will be something like:

Code: [Select]
local tmp = luup.variable_get("urn:upnp-micasaverde-com:serviceId:Weather1", "Condition", 58)
if ((tmp.find("Ice") ~= nil) or (tmp.find("Snow") ~= nil)) then
   luup.call_action("urn:upnp-org:serviceId:SwitchPower1", "SetTarget", {newTargetValue="1"}, 32)
else
   luup.call_action("urn:upnp-org:serviceId:SwitchPower1", "SetTarget", {newTargetValue="0"}, 32)
end



Thanks, I tried this and here is the result of my code, again, Im clueless about coding so I may have messed something up.  I try to run the scene and it's sunny outside, yet it still turns on the heat/de-icing tape and it shouldn't...

Code: [Select]
local lul_tmp = luup.variable_get("urn:upnp-micasaverde-com:serviceId:Weather1","Condition",58)
if ((tmp.find("Ice") ~= nil) or (tmp.find("ice") ~= nil)) or ((tmp.find("Snow") ~= nil) or (tmp.find("snow") ~= nil))
 or ((tmp.find("icy") ~= nil) or (tmp.find("Icy") ~= nil))
 or ((tmp.find("Freezing") ~= nil) or (tmp.find("freezing") ~= nil))

then
   luup.call_action("urn:upnp-org:serviceId:SwitchPower1","SetTarget",{ newTargetValue="1" },32)
else
   luup.call_action("urn:upnp-org:serviceId:SwitchPower1","SetTarget",{ newTargetValue="0" },32)

end

Title: Re: Plugin for Web: weather.com et al
Post by: guessed on January 07, 2011, 11:38:57 am
Thanks, I tried this and here is the result of my code, again, Im clueless about coding so I may have messed something up.  I try to run the scene and it's sunny outside, yet it still turns on the heat/de-icing tape and it shouldn't...

Code: [Select]
local lul_tmp = luup.variable_get("urn:upnp-micasaverde-com:serviceId:Weather1","Condition",58)
if ((tmp.find("Ice") ~= nil) or (tmp.find("ice") ~= nil)) or ((tmp.find("Snow") ~= nil) or (tmp.find("snow") ~= nil))
 or ((tmp.find("icy") ~= nil) or (tmp.find("Icy") ~= nil))
 or ((tmp.find("Freezing") ~= nil) or (tmp.find("freezing") ~= nil))

then
   luup.call_action("urn:upnp-org:serviceId:SwitchPower1","SetTarget",{ newTargetValue="1" },32)
else
   luup.call_action("urn:upnp-org:serviceId:SwitchPower1","SetTarget",{ newTargetValue="0" },32)

end


My Bad.

It's tmp:find, not tmp.find

Also, I changed your local lu_tmp into local tmp since I'd changed that in my example

Code: [Select]
local tmp = luup.variable_get("urn:upnp-micasaverde-com:serviceId:Weather1","Condition",58)
if ((tmp:find("Ice") ~= nil) or (tmp:find("ice") ~= nil)) or ((tmp:find("Snow") ~= nil) or (tmp:find("snow") ~= nil))
 or ((tmp:find("icy") ~= nil) or (tmp:find("Icy") ~= nil))
 or ((tmp:find("Freezing") ~= nil) or (tmp:find("freezing") ~= nil))

then
   luup.call_action("urn:upnp-org:serviceId:SwitchPower1","SetTarget",{ newTargetValue="1" },32)
else
   luup.call_action("urn:upnp-org:serviceId:SwitchPower1","SetTarget",{ newTargetValue="0" },32)
end
Title: Re: Plugin for Web: weather.com et al
Post by: myhomeserver on January 07, 2011, 11:43:58 am
Thanks!  Its just about to start snowing so I wanted to get this working....thanks again Guys, loving this stuff!

Title: Re: Plugin for Web: weather.com et al
Post by: b2ent01 on January 12, 2011, 07:12:32 pm
I've installed the plugin with no problem.  I live in sacramento, CA and the temperatures are mixed.  The current temperature doesn't correlate and the humidity is wrong.  I tried Dallas and that is correct but sacramento isn't.  I've tried to use my Vera2's local location as well as override but same deal.  I actually live in Elk Grove (suburb) and same applies.  Does anybody have any thoughts?
Title: Re: Plugin for Web: weather.com et al
Post by: guessed on January 12, 2011, 10:49:58 pm
I've installed the plugin with no problem.  I live in sacramento, CA and the temperatures are mixed.  The current temperature doesn't correlate and the humidity is wrong.  I tried Dallas and that is correct but sacramento isn't.  I've tried to use my Vera2's local location as well as override but same deal.  I actually live in Elk Grove (suburb) and same applies.  Does anybody have any thoughts?
@b2ent01,
Can you run the www.google.com Weather API query that's outlined on the front of the Plugin's page (http://code.mios.com/trac/mios_weather) and attach the results?

For Sacramento proper, it'll look something like:
     http://www.google.com/ig/api?weather=,,,38581571,-121494399

But when you run it you'll use the specific Lat/Long values from your Vera.  These are in the Location settings, and if you request (Change >) it'll show you what it considers the Lat/Long values for your specific location.

Generally this will align with what you'd get from Google if you typed a search criteria like "weather in sacramento", but there may be differences for your specific Lat/Long values.

Note that the Plugin only pulls values every 30 mins, so there's often slight variances in the values returned.  It's also possible that Google is "extrapolating" the values from nearby points, as we saw that early on.  The "override" (for ZIP codes, etc) should pin it down more directly.

Given your problem description above, I'd be interested to see what Vera considers to be your Lat/Long value(s) for the Location you entered.
Title: Re: Plugin for Web: weather.com et al
Post by: weissertigerxl on January 13, 2011, 06:03:25 pm
Helllo all, i installed the newest Version of the weather Plugin, but i have Fahrenheit Not Celsius at the ui shown. What can i do?

Thank stefan
Title: Re: Plugin for Web: weather.com et al
Post by: guessed on January 13, 2011, 06:43:11 pm
Helllo all, i installed the newest Version of the weather Plugin, but i have Fahrenheit Not Celsius at the ui shown. What can i do?

Thank stefan


Check out the "Extras" section of the Installation page:
    http://code.mios.com/trac/mios_weather/wiki/Installation-UI4

The Metric option is listed in the text, and also in the Screenshot...
Title: Re: Plugin for Web: weather.com et al
Post by: BartEv on January 18, 2011, 04:37:08 pm
Regarding your questions on my post @ Jan 3, 2011

The google url to provide a decent XML ouput: http://www.google.com/ig/api?weather=waalre&hl=nl (http://www.google.com/ig/api?weather=waalre&hl=nl)

The Weather plugin value is "waalre&hl=nl"
Note: the conditions now show up in Dutch, which prevents the scene slection to work correctly.
Title: Re: Plugin for Web: weather.com et al
Post by: guessed on January 19, 2011, 12:13:58 am
@BartEV,
Actually what I need is the URL the Plugin itself would generate, based upon your [Vera defined]Location or the [Plugin Defined] Location override.

This is similar to what I was asking @b2ent01 for in this post:
    http://forum.micasaverde.com/index.php?topic=1435.msg30236#msg30236

That'll give me the exact data that the plugin itself would "see", including any English'isms in the data returned.  If you're comfortable, you can edit I_GoogleWeather.xml and change the debug mode to "true" and reload the file.  Once that's done, there's debug data emitted into the logs that shows the exact URL, including any location overrides, that's used by the code... otherwise you can calculate it manually as I indicated above.

I have a Ticket in the system that I filed to track making it so that localized strings could also be present.  So far there's not been a great demand for translation, but that's probably more of a MiOS availability thing than anything.  In this case, there would be "separate" (new) variables for any translated strings, so that scripting wouldn't be impacted.
Title: Re: Plugin for Web: weather.com et al
Post by: BartEv on January 19, 2011, 03:37:26 pm
I've done what you asked me and this is the result.
Using this tail command:
Code: [Select]
while true; do tail -f LuaUPnP.log | egrep '^5|^0[18]'; done
Code: [Select]
50      01/19/11 21:22:54.014   luup_log:8: GoogleWeather Google Weather #8 starting up with id  <0x402>
50      01/19/11 21:22:55.010   luup_log:8: GoogleWeather refreshCache called <0x402>
50      01/19/11 21:22:55.012   luup_log:8: GoogleWeather refreshCache: http://www.google.com/ig/api?weather=Waalre&hl=nl <0x402>
50      01/19/11 21:22:55.297   luup_log:8: GoogleWeather refreshCache: 0 <0x402>
50      01/19/11 21:22:55.299   luup_log:8: GoogleWeather Successful execution of URL rss=<?xml version="1.0"?><xml_api_reply version="1">
<weather module_id="0" tab_id="0" mobile_row="0" mobile_zipped="1" row="0" section="0" >
<forecast_information><city data="Waalre, North Brabant"/><postal_code data="Waalre"/><latitude_e6 data=""/>
<longitude_e6 data=""/><forecast_date data="2011-01-19"/>
<current_date_time data="2011-01-19 19:59:00 +0000"/><unit_system data="SI"/></forecast_information><current_conditions>
<condition data="Overwegend bewolkt"/><temp_f data="36"/><temp_c data="2"/>
<humidity data="Luchtvochtigheid: 100%"/><icon data="/ig/images/weather/mostly_cloudy.gif"/><wind_condition data="Wind: NW met 8 km/h"/>
</current_conditions><forecast_conditions> <day_of_week data="wo"/><low data="1"/><high data="6"/><icon data="/ig/images/weather/mostly_sunny.gif"/>
<condition data="Overwegend zonnig"/></forecast_conditions><forecast_conditions><day_of_week data="do"/><low data="-2"/><high data="6"/>
<icon data="/ig/images/weather/chance_of_rain.gif"/><condition data="Kans op regen"/>
</forecast_conditions><forecast_conditions><day_of_week data="vr"/>
<low data="1"/><high data="5"/><icon data="/ig/images/weather/mostly_sunny.gif"/><condition data="Overwegend zonnig"/></forecast_conditions>
<forecast_conditions><day_of_week data="za"/><low data="0"/><high data="7"/>
<icon data="/ig/images/weather/chance_of_rain.gif"/><condition data="Kans op regen"/>
</forecast_conditions></weather></xml_api_reply> <0x402>
50      01/19/11 21:22:55.665   luup_log:8: GoogleWeather At [51.443500 ,5.447000  ], it's currently 2(SI) and Overwegend bewolkt.  Humidity
is 100%.  Low is 1 High is 6.  Condition is Overwegend bewolkt, Wind Condition is NW met 8 km/h <0x402>

Something i've noticed before in this log-file, but at that time not seriously enough to mention.
When you print the "For demo, print a set of values showing them individually pulled out." You do not use the correct location information, when the location has been overriden still de Vera location settings are being used.

The location variable has been set to: "Waalre&hl=nl"


UPDATE: 20Jan (guessed): Modified code block so as not to be "wide" as it's causing the whole forum to scroll.
Title: Re: Plugin for Web: weather.com et al
Post by: guessed on January 19, 2011, 03:43:13 pm
Ok, so I'm not correctly "encoding" the data value supplied for Location.  I will add that to the TODO list, and that will then prevent the additional parameter being interpreted.  (&hl=nl in your case).

It was not intentional to provide that ability, and it's likely interfering with the results returned.

What I need is the un-changed version, where you're not using the Location override, since you mentioned that you were having problems with that also, and it returning "metric" information when it should have returned imperial units.

(http://code.mios.com/trac/mios_weather/ticket/8)
Title: Re: Plugin for Web: weather.com et al
Post by: BartEv on January 19, 2011, 04:16:06 pm
Without the language override (&hl=nl) Google always returns is values in SI format.

So your right about the interfering with the results, it just a trick to have the weather conditions shown in Dutch



Title: Re: Plugin for Web: weather.com et al
Post by: tt55du on January 24, 2011, 05:07:10 pm
So I'm one of the last hold outs using Vera 1 and UI2 on 995.

Is the pluggin still being developed for UI2/3?  I pulled mine from
http://code.mios.com/trac/mios_weather/wiki

Just wanted to make sure I get the latest version and the box.net links I found to appear to UI4.
Title: Re: Plugin for Web: weather.com et al
Post by: guessed on January 24, 2011, 05:22:39 pm
@tt55du,
There are two downloads, from distinctly different "Installation" Wiki pages covering "UI2/3" and "UI4" resp.  You'll see both these install instructions linked from the Wiki page you've listed.

The original ("UI2/3") version of the Weather Plugin hasn't changed changed since Nov '09.

The UI4 version is the one I apply fixes and features to, such as the UI/Rendition developed for UI4.  All feature requests will only be put into the UI4 version.
Title: Re: Plugin for Web: weather.com et al
Post by: tt55du on January 24, 2011, 05:47:38 pm
@guessed,  Just as I figured.  I installed the pluggin and it works quite well even with the documented quirks.  It should serve my needs just fine.  Would like to program an event that closes the awning in high wind.  Thanks for your contribution and hard work

I suppose I'll wallow in UI2 purgatory until I feel confident enough about UI4.  One thing is for sure, I'm not getting rid of Vera1 anytime soon.

One last thing, can you direct me to some pointers on creating a plug-in itself.  I'm starting to read about lua and have a couple scenes that run extremely simple scripts just fine, but I would like to take it the next level and create a plugin for my ip thermostat.

I've read the light wiki info, but need more to bite on so that I can understand the luup framework conceptually and how lua works with in it.

Sorry to take this thread off topic

Thanks
Title: Re: Plugin for Web: weather.com et al
Post by: guessed on January 24, 2011, 10:26:43 pm
@tt55du,
Based upon the questions being asked, you might want to pair up with @digitialperk to see what they're doing, and perhaps get some starter code.

From this discussion:
    http://forum.micasaverde.com/index.php?topic=5332.0

It looks like they're trying to build the same thing, so you'll likely run into the same challenges.  The real differences are theirs is RS-485, and yours is Ethernet (use DirectTV Plugin and Weather Plugin for code references)

Haven't heard of anyone who's built a complete Luup Thermostat yet, so will definitely be interesting (esp with the new IP/Wifi Thermostats coming on the Market).

Anyhow, getting some samples of @digitalperk's work would likely be the best starting point.   You may want to PM them to see if they'll share their stuff, as others have done here.
Title: Re: Plugin for Web: weather.com et al
Post by: strangely on January 25, 2011, 12:14:14 am
Would like to program an event that closes the awning in high wind.  Thanks for your contribution and hard work

@tt55du, for your awning, I wouldn't rely solely on the weather data in case its a bit out of date, or there are some random gusts! Anyway to keep this on topic I'll resurrect the old thread below with what I've done with mine, and another option I'm thinking about.

http://forum.micasaverde.com/index.php?topic=3245.15
Title: Re: Plugin for Web: weather.com et al
Post by: fdebuck on February 17, 2011, 07:42:34 am
After installing the weather plugin last week, I noticed that the plugin was not always updating correctly.

F.I. this morning, I saw that the temp and humidity values had not changed since last night.

When I looked at the "last updated" value in the "advanced" tab, the UNIX timestamp was (translated to normal date/time) 16 feb 11 18:08 while at that moment the date/time was 17 feb 11 11:15

After refreshing the dashboard, the temp/humidity values suddenly changed, and the "last updated" value was OK again (meaning that the plugin updated itself with the refresh of the dashboard).

I'll keep an eye on this for a while to see if there is a repeating pattern in this...


Frederik.
Title: Re: Plugin for Web: weather.com et al
Post by: MNB on February 20, 2011, 02:13:33 pm
Guessed, what is the latest version and is available when I go the weather plugin Wiki page? Somewhere reading the many forums it was implied that it is already in UI4 latest version is that true?
Title: Re: Plugin for Web: weather.com et al
Post by: guessed on February 20, 2011, 02:36:06 pm
Guessed, what is the latest version and is available when I go the weather plugin Wiki page? Somewhere reading the many forums it was implied that it is already in UI4 latest version is that true?

You still have to download from the links referenced in code.mios.com.  There are UI2 and UI4 versions, per this posting:

    http://forum.micasaverde.com/index.php?topic=1435.msg31301#msg31301

At this time nothing is built into Vera (any version)
Title: Re: Plugin for Web: weather.com et al
Post by: guessed on February 21, 2011, 11:59:05 pm
After installing the weather plugin last week, I noticed that the plugin was not always updating correctly.

F.I. this morning, I saw that the temp and humidity values had not changed since last night.

When I looked at the "last updated" value in the "advanced" tab, the UNIX timestamp was (translated to normal date/time) 16 feb 11 18:08 while at that moment the date/time was 17 feb 11 11:15

After refreshing the dashboard, the temp/humidity values suddenly changed, and the "last updated" value was OK again (meaning that the plugin updated itself with the refresh of the dashboard).

I'll keep an eye on this for a while to see if there is a repeating pattern in this...


Frederik.
Hmm, haven't seen that behavior in a while now. 

I had (in a prior release) put in some guards to stop that sort of thing going on.  The only other "odd" behavior I've seen relates to not being able to resolve Google.com in DNS (which, is really, really odd) but usually it sorts itself out, and I've only seen that "at startup" assumed it was due to CPU load, and DNS timeouts.  It's one of the reasons I'd like to see faster CPU's (my startup pegs the CPU for all the Plugins I have)

Let me know if you see it again, there are a few other things I can do to force my timing loop to execute "no matter what" but I hate to be that heavy handed.
Title: Re: Plugin for Web: weather.com et al
Post by: fdebuck on February 23, 2011, 09:41:32 am
@Guessed : thanks for your reply !

To be true, I have to say that after I have written this question, the issue does not seem to be there anymore. Maybe there was a temporal glitch with my internet connection, but when I compare the values I see in Vera with what I can seen in my iGoogle are the same.

The only thing I did was deleting and re-setting the Location Override parameter (since the location Vera was giving me was not accurate enough, I could only choose a city which is 10 km away).

Thanks again for your plug-in !

Frederik.
Title: Re: Plugin for Web: weather.com et al
Post by: huogas on March 09, 2011, 06:52:21 am
Great idea. Just installed the plugin.

This installation seems ok and the new device is there, but I don't see any information.

What else should be displayed, and where ?

Tks

Gast
Title: Re: Plugin for Web: weather.com et al
Post by: m0jon on March 21, 2011, 10:56:02 am
Need a little help with some Lua code for a scene.

I'm trying to get a push message sent to my phone whenever the wind speed gets to or above 20mph for my location. And have tried to following

--Weather

local lul_tmp = luup.variable_get("urn:upnp-micasaverde-com:serviceId:Weather1","WindCondition",7)
   
if (lul_tmp>="20mph") then

However once i add the >= it send a message regardless of conditions. If i use == it has to read exactly before sending a message. Has anyone got any ideas or am i trying to achieve the impossible.

Cheers


m0jon
Title: Re: Plugin for Web: weather.com et al
Post by: fdebuck on March 21, 2011, 10:59:28 am
"local lul_tmp = luup.variable_get("urn:upnp-micasaverde-com:serviceId:Weather1","WindCondition",7)
   
if (lul_tmp>="20mph") then
"

It looks as if you're trying to treat a text variable as a numeric one. That for sure won't work.
You would need to find a way to convert the text into a number...

Frederik.
Title: Re: Plugin for Web: weather.com et al
Post by: m0jon on March 21, 2011, 11:20:53 am
Good point, thanks,

for now i've just added a lot of "or"

if (lul_tmp=="W at 15 mph") or
(lul_tmp=="W at 16 mph") or
(lul_tmp=="W at 17 mph") or
(lul_tmp=="W at 18 mph") or
(lul_tmp=="W at 19 mph") or
(lul_tmp=="W at 20 mph") or
(lul_tmp=="W at 21 mph") or
(lul_tmp=="W at 22 mph") or
(lul_tmp=="W at 23 mph") or
(lul_tmp=="W at 24 mph") or
(lul_tmp=="W at 25 mph") or
(lul_tmp=="W at 26 mph") or
(lul_tmp=="W at 27 mph") or
(lul_tmp=="W at 28 mph") or
(lul_tmp=="W at 29 mph") or
(lul_tmp=="W at 30 mph") or
(lul_tmp=="SW at 15 mph") or
(lul_tmp=="SW at 16 mph") or
(lul_tmp=="SW at 17 mph") or
(lul_tmp=="SW at 18 mph") or
(lul_tmp=="SW at 19 mph") or
(lul_tmp=="SW at 20 mph") or
(lul_tmp=="SW at 21 mph") or
(lul_tmp=="SW at 22 mph") or
(lul_tmp=="SW at 23 mph") or
(lul_tmp=="SW at 24 mph") or
(lul_tmp=="SW at 25 mph") or
(lul_tmp=="SW at 26 mph") or
(lul_tmp=="SW at 27 mph") or
(lul_tmp=="SW at 28 mph") or
(lul_tmp=="SW at 29 mph") or
(lul_tmp=="SW at 30 mph")  then


crude but works for now

Cheers

m0jon
Title: Re: Plugin for Web: weather.com et al
Post by: guessed on March 21, 2011, 11:38:55 am
If it's always in that format (and I'm not sure it is) you can use string.match(...) to parse out the numeric value.  The syntax/format isn't correct, but it'll look something like the following with a "capture" of %d to extract the numeric value:

Code: [Select]
   local direction, speed = tmp:match("^(.*) at (%d+) mph$")

You'll probably have to play with it a little, but it'll be something like that (assuming english language strings)
Title: Re: Plugin for Web: weather.com et al
Post by: robinnes on April 11, 2011, 12:30:39 pm
Very useful plugin guessed, thanks!
Works perfectly on Vera2 UI4, fw 1.1.1234
Title: Re: Plugin for Web: weather.com et al
Post by: mtf on April 13, 2011, 09:27:31 am
When I looked at the "last updated" value in the "advanced" tab, the UNIX timestamp was (translated to normal date/time) 16 feb 11 18:08 while at that moment the date/time was 17 feb 11 11:15

After refreshing the dashboard, the temp/humidity values suddenly changed, and the "last updated" value was OK again (meaning that the plugin updated itself with the refresh of the dashboard).

I have had this problem a few times, the simple answer is to change the I_GoogleWeather.xml code, look for the line:

        luup.call_timer("refreshCache", 1, "30m", "")

It will be near the bottom of the refreshCache function, so move it from there to the start of the refreshCache function.

As far as I can tell the problem is that something goes wrong in the function, maybe due to unexpected download data issues, it causes the function to crash part way through and never get to the bottom of the function to set up the next call, it then never runs again and your data goes stale until you restart luup.

In the ideal world you wouldn't need to do this and the function would be error trapped to the point where it couldn't fall over, but luup can be unreliable at times and things do fail.  The risk you run when moving this function call to the start of the function is that if your Vera takes over 30 minutes to run the function then you could end up with more and more processes running at the same time, but it seems pretty unlikely to me!
Title: Re: Plugin for Web: weather.com et al
Post by: guessed on April 15, 2011, 12:39:34 am
@mtf, thanks for the idea!  I've been meaning to convert it over to using pcall() blocks, but your model is simpler, so I went ahead and made the changes in source control.

The 1.43 version is now tagged, ZIP'd and here if you want to try it:
    http://www.box.net/shared/z0qcg3uqse

I'm going to run it for a few days before I change the regular download "link" over to use this one, as there are a few other changes in the bundle also (mostly minor)
Title: Re: Plugin for Web: weather.com et al
Post by: Ap15e on April 15, 2011, 04:53:10 am
Wouldn't it be safer to use 48 absolute timers? :)

Some questions:
Are Luup timers persistent against LuaUPnP restart/reboot/power loss?
Do 48 absolute timers consume significant resources?
Title: Re: Plugin for Web: weather.com et al
Post by: guessed on April 15, 2011, 11:25:09 am
Wouldn't it be safer to use 48 absolute timers? :)
Sometimes it just feels like that...

Quote
Are Luup timers persistent against LuaUPnP restart/reboot/power loss?
The timer type that I'm using isn't resiliant to restarts, but I reset the timer when the code is restarted anyhow, so in the worst case, the Weather plugin refreshes a little more often than needed if Vera itself is restarting.

I could use pcall() blocks to avoid the style I moved the code to, but this is simpler and lets me accurately log the problem (in the client's log files).
Title: Re: Plugin for Web: weather.com et al
Post by: guessed on April 15, 2011, 12:03:17 pm
I must be getting old, it took me until now to really know what you meant by 48 timers. 

Sometimes I have whole weeks like that 8)
Title: Re: Plugin for Web: weather.com et al
Post by: JimMac on April 23, 2011, 11:00:22 am
There seems to be files missing in 1.43.  I can't find S_Weather.xml and I_GoogleWeather.xml.
Where do I find all 4 files?
Title: Re: Plugin for Web: weather.com et al
Post by: JOD on April 23, 2011, 11:08:37 am
Download:
http://www.box.net/shared/z0qcg3uqse

JOD.
Title: Re: Plugin for Web: weather.com et al
Post by: JimMac on April 23, 2011, 11:15:36 am
I did that and the zip file only contains D_Weather.xml and D_Weather.json.
Title: Re: Plugin for Web: weather.com et al
Post by: JOD on April 23, 2011, 11:23:02 am
I just unpacked 1.43 to take a look. They are missing.
.svn
.DS_Store
.project
D_Weather.json
D_Weather.xml
tempfile.tmp

JOD.
Title: Re: Plugin for Web: weather.com et al
Post by: guessed on April 23, 2011, 11:27:49 am
I just re-packed it, please try again.
Title: Re: Plugin for Web: weather.com et al
Post by: JOD on April 23, 2011, 11:29:40 am
That did it. Thanks @guessed.

JOD.
Title: Re: Weather Plugin
Post by: Intrepid on May 23, 2011, 08:30:01 am
This plugin is awesome.  I haven't even used it for any actions/scenes, but having the weather data along side my thermostat is great.

Title: Re: Weather Plugin
Post by: 325xi on May 23, 2011, 09:38:55 am
I very much liked the idea of built-in facade API, such as is_night() function - saves a lot of hassle
Is there anything like that in Weather Plugin: is_raining(), is_too_humid(n), etc?
Title: Re: Weather Plugin
Post by: huogas on May 23, 2011, 12:18:19 pm
I'm a little bit confused (a lot confused would say my daughters, but it's something else... ;)) about the "official instructions" to install the Weather plugin.

Could someone remind me where it is (some like DAD or ADD are in the first post, some are in the Mios Marketplace, some...).

Thanks
Title: Re: Weather Plugin
Post by: strangely on May 23, 2011, 12:27:16 pm
http://code.mios.com/trac/mios_weather/wiki/Installation-UI4
Title: Re: Weather Plugin
Post by: oTi@ on May 23, 2011, 12:28:11 pm
Could someone remind me where it is (some like DAD or ADD are in the first post, some are in the Mios Marketplace, some...).
Here's the new Directory (http://wiki.micasaverde.com/index.php/Luup_plugins_and_Luup_code), courtesy of @Ap15e.

(And if you follow link 298, you'll end up in similar places as @strangely just pointed out. Yeah; it works! ;D )
Title: Re: Weather Plugin
Post by: huogas on May 23, 2011, 12:49:39 pm
 :o Wow!

Thanks @Ap15e. Wonderfull!

Do you think it could be feasible to add the last edition date for each plugin in the tables ?
How do I know if I have the last version installed in my Vera ?
Title: Re: Weather Plugin
Post by: nkakita on May 28, 2011, 08:44:50 pm
Great plug-in!  I was wondering if anyone has modified it yet to display the Wind Condition as it's own child similarly to how the main 4 child boxes are displayed in the UI?
Title: Re: Weather Plugin
Post by: oTi@ on May 28, 2011, 08:46:31 pm
@nakakita,
Did you check out GWC (http://forum.micasaverde.com/index.php?topic=6553.msg40466#msg40466)?
Title: Re: Weather Plugin
Post by: utz on June 18, 2011, 01:15:53 pm
When selecting "Google Weather" in a scene as event source I could not select a weather condition as input. The problem is that the system cannot deal with spaces in the weather condition value list.

entries such as

Code: [Select]
"Chance of Showers": "Chance of Showers",
"Chance of Snow": "Chance of Snow",
"Chance of Storm": "Chance of Storm",

can be

Code: [Select]
"ChanceOfShowers": "Chance of Showers",
"ChanceOfSnow": "Chance of Snow",
"ChanceOfStorm": "Chance of Storm",

The attached file contains repairs that allow me to use Google Weather as event source. There might be a better way that allows us to preserve the problematic characters (maybe a "\" works instead of a space).
Title: Re: Weather Plugin
Post by: guessed on June 18, 2011, 02:36:43 pm
@utz,
See my comments on your other thread...

Looks like that Bug has been put into the UI5 queue.
Title: Re: Weather Plugin
Post by: williaj on July 19, 2011, 09:57:57 am
I've just loaded this plugin and it looks really good. I'm in Australia so was wondering if the issue with showing the temperature in centigrade was going ot be fixed?
Title: Re: Weather Plugin
Post by: guessed on July 19, 2011, 11:55:24 am
I've just loaded this plugin and it looks really good. I'm in Australia so was wondering if the issue with showing the temperature in centigrade was going ot be fixed?
Can you be more specific on the problem you're seeing? 

There's a parameter that's used to force the display [manually] into Centigrade (listed in Extras of the installation page), but there's a bug out there for us to get the data so we can do it directly from the Location information that Vera already has.

Title: Re: Weather Plugin
Post by: williaj on July 23, 2011, 06:26:15 am
My location is set for my city in australia but the temperatures all show in fahrenheit but shoul be centigrade
Title: Re: Weather Plugin
Post by: oTi@ on July 23, 2011, 07:20:39 am
My location is set for my city in australia but the temperatures all show in fahrenheit but shoul be centigrade
Even after setting the Metric variable to 1 (Advanced tab of the parent device) as per the Extras section on the installation page, as indicated by @guessed?
Title: Re: Weather Plugin
Post by: williaj on July 24, 2011, 12:07:55 am
Yes I had done that and it still wasn't showing centigrade so I deleted and started over and re-installed. It is now showing the numerics for Centigrade but is not showing any text after it like C for centigrade but I can live with that.....

I notice that where you set metric or imperial that the wind speed is shown, That is shown in MPH not KPH.

All in all a pretty nifty plugin  :)

Title: Re: Weather Plugin
Post by: guessed on July 24, 2011, 12:32:22 am
Data for Humidity, Wind condition (etc) all comes back as a text-string with the value somewhat embedded in the middle. 

So far, for the ones like Wind-condition, I've not found a request-level parameter that'll trigger the results to come back in Metric.  The other metric conversions you see, for the temp, happen because the code is manually doing those translations.  In the case of Wind condition, the format of that string is all over the map, so it would be hard to "extract-and-translate" the values.

Think of is as Australia in the 60's  ;)
Title: Re: Re: Weather Plugin
Post by: computerjohn on July 25, 2011, 03:16:12 am
Good read

Title: Re: Weather Plugin
Post by: williaj on August 11, 2011, 09:25:34 am
Hi, Thanks for the information, it was very illuminating.

I didn't reply earlier to thank you as I was on holiday in Bali and didn't need a conversion to know it was hot with a gentle breeze.  :)
Title: Re: Weather Plugin
Post by: Ap15e on August 11, 2011, 05:59:07 pm
Quote
In the case of Wind condition, the format of that string is all over the map, so it would be hard to "extract-and-translate" the values.

Excerpt from GWC:

Code: [Select]
     local wind_direction, wind_speed = string.match( condition_wind, '([NSEW]+) at (%d+) mph')

     if wind_speed_metric == "1"
      then

       wind_speed = math.floor( ( tonumber( wind_speed ) or 0 ) * 1.609344 + 0.5 )

      end

GWC provides wind speed and wind direction as UPnP variables.
Title: Re: Weather Plugin
Post by: guessed on August 12, 2011, 01:21:57 am
Yes, I'm aware that when it's in that format it can be parsed.  The problem was, when I did the initial research to cutover from Yahoo to Google as the DS, I found a number of references to folks seeing lines in this output in other formats.

Admittedly, they were odd cases like Hurricanes and the like, but they existed - similar to how some of the Conditions values have been determined over time.  Without clear documentation of described output behavior, in all cases, I err'd on the side of being conservative and not parsing that specific format, lest people begin to think that it handled every value combination possible.

It tends to avoid the problem of "why didn't my shutters go down, there was a hurricane outside and the Wind meter didn't show it"  :)

Generally speaking, I prefer to go by documented behavior, not hacks or tricks to get things done.  Unfortunately, the entire Google feed is a little undocumented in this respect...

Now, if folks are ok with parsed values of "N/A" (or similar) in the cases where it cannot be parsed out, then I'm more than happy to have that (as opposed to the last value, which is what the [unguarded/example] code snippet would do)

Also interesting to note that the "mph" is flexible, even in hl=en (but certainly more predictable in that form).  It seems to depend upon which localized Google endpoint you're serviced by, but I never chased that further once I started seeing differences (metric vs US units) - mostly as they appeared to infer the UoM by a combination of hl and the Google endpoint... which tended to make things unpredictable.
Title: Re: Weather Plugin
Post by: Ap15e on August 12, 2011, 05:00:03 am
Why not add a data collector to the plugin that transfers the weather data to a centralized server? Let the instances of your plugin do the reverse engineeering of the API for you (if the user agrees).  :)
Title: Re: Weather Plugin
Post by: garrettwp on August 12, 2011, 09:58:31 am
I have a question. When using the lu_sdata api and not the user_data api, I noticed that the forecast does not show up. Here is what the lu_sdata output looks like for the weather plugin. Can this be fixed?

{
         "name":"Google Weather",
         "altid":"",
         "id":29,
         "category":0,
         "subcategory":-1,
         "room":12,
         "parent":0,
         "condition":"Clear",
         "windcondition":"W at 4 mph"
      },
      {
         "name":"High Temperature",
         "altid":"Weather-Forecast-HighTemperature",
         "id":32,
         "category":17,
         "subcategory":0,
         "room":12,
         "parent":29,
         "temperature":"83"
      },
      {
         "name":"Humidity",
         "altid":"Weather-Current-Humidity",
         "id":33,
         "category":16,
         "subcategory":0,
         "room":12,
         "parent":29,
         "humidity":"63"
      },
      {
         "name":"Low Temperature",
         "altid":"Weather-Forecast-LowTemperature",
         "id":31,
         "category":17,
         "subcategory":0,
         "room":12,
         "parent":29,
         "temperature":"54"
      },
      {
         "name":"Temperature",
         "altid":"Weather-Current-Temperature",
         "id":30,
         "category":17,
         "subcategory":0,
         "room":12,
         "parent":29,
         "temperature":"67"
      },


- Garrett

Now I feel really stupid. The output is now showing. I do notice that it is not showing up on my Father's vera unit. I will have to investigate that.
Title: Re: Weather Plugin
Post by: guessed on August 12, 2011, 10:11:35 am
Why not add a data collector to the plugin that transfers the weather data to a centralized server? Let the instances of your plugin do the reverse engineeering of the API for you (if the user agrees).  :)
If you're a 'Patterns person, then Vera is essentially a giant Mediator.  The intent being that each component (aka Plugin) does a relatively simple/single task, and other components work with the Mediator (Vera) to do the work of wiring them together... so these components are fundamentally decoupled, and can be grouped in different ways (etc) - as well as scripted

In Vera's case, each Plugin either brings the data into a central format, or they take it out of that format and do something with it.

Your Data logging Plugin is an example of the latter, with a specific syslog format as it's output (it's also an Observer.

So, if Weather logging is needed, it would be better handled outside of the collection process - at least to stay within the overall model.  This allows folks to build different loggers (like one for http://pachtube.com or http://sen.se) without bloating each plugin with output and/or format-specific extensions for one-off services.
Title: Re: Weather Plugin
Post by: Ap15e on August 12, 2011, 12:20:08 pm
The idea is to collect data from instances of your Weather plugin from all over the world to get an idea about the syntax (and not about the actual wheather conditions ...) used by the Google Weather API.

The easiest/most transparent way - from the standpoint of a user of your weather plugin - would be an implementation within your weather plugin. How many users would be willing to enable remote logging and to install GDL?

I'd like to see wind speed and wind direction (and the corresponding events) added to your plugin as UPnP variables - the usual disclaimer applies: Vera doesn't support floating point values for events, etc. :-\
Title: Re: Weather Plugin
Post by: Ap15e on August 12, 2011, 12:29:28 pm
@garrettwp

You have to add <shortCode>...</shortCode> statements to the service definition of the UPnP state variables you are interested in.
Title: Re: Weather Plugin
Post by: guessed on August 13, 2011, 04:10:02 pm
@Ap15e,
I've added the variables WindDirection and WindSpeed.  These will be populated (and Metric converted as needed) IF the WindCondition comes in the expected form, per the discussion above.

If it doesn't come in that form, they get populated with "NA" and -1 respectively, so buyer-be-ware when scripting against this.

This should handle the out of band cases.  I'm currently using sloppy parsing, so it's possible that unexpected values may enter these variables.

I've tagged it as 1.44 in code.mios.com, so you can test that out, but hasn't been promoted in the Wiki until the kinks are out of it.  I suspect there will be more than a few...


The JSON in this version displays WindDirection and WindSpeed values in the Dash instead of the WindCondition, so that Metric values display correctly in the dash.

Scene scripting against this is not exposed yet, but can be added once this value-extraction is working correctly for the most common case.

This version also tightens the URL sent to Google, to ensure that the English language strings come back.
Title: Re: Weather Plugin
Post by: guessed on August 13, 2011, 04:15:35 pm
@garrettwp,
Is it possible you have an older version of the code running in one of your environments?  The shortCodes were added about 7 months back.  If the code wasn't updated since then, you might want to pickup the newer build which contains these changes.


@garrettwp

You have to add <shortCode>...</shortCode> statements to the service definition of the UPnP state variables you are interested in.
Title: Re: Weather Plugin
Post by: Ap15e on August 13, 2011, 04:39:54 pm
@guessed

Thanks a lot for the update.

Quote
If it doesn't come in that form, they get populated with "NA" and -1 respectively, so buyer-be-ware when scripting against this.

I'd recommend displaying Please report to guessed: <unparsed windCondition> instead of "NA"/-1.
Title: Re: Weather Plugin
Post by: guessed on August 13, 2011, 04:46:18 pm
I'd recommend displaying Please report to guessed: <unparsed windCondition> instead of "NA"/-1.
I was trying to avoid english strings as much as possible, esp once stuff gets into the Market (one day) and folks may not be used to using the forums.

The "NA" seemed innocuous enough that I could document the circumstances under which it might occur, along with a bag-o-disclaimers not to use this for critical decisions in any HA setup (probably should be a general disclaimer for that anyhow)

The -1 for speed is because it's declared as a Number (i4).  I wanted to avoid stuffing things in there that shouldn't fit (even if MiOS allows that, it seemed like poor form to do it)

If it comes up, then folks will likely automatically report it here somewhere (if they're technical enough).  I suspect most of them will "blow by" when people aren't watching though, and I don't have a suitable endpoint to do data-logging of the values behind the scenes to catch all the cases (per your other comment)
Title: Re: Weather Plugin
Post by: Ap15e on August 13, 2011, 05:39:28 pm
Quote
I don't have a suitable endpoint to do data-logging

You could use www.mailinator.com to send mails to a mailinator mailbox of your choice (but any given mailbox will only hold 10 messages at once and after several hours, all email is auto-deleted):
http://code.google.com/p/party-time/wiki/DeveloperGuide

There must be a more elegant solution to the data-logging problem ...
Title: Re: Weather Plugin
Post by: mhjens on October 03, 2011, 12:22:39 pm
I'm pretty new to this and have read this thread. I've installed the plugin and it's working great. But there's one thing I haven't figure out how to accomplish.

I want a wallplug to be activated when two parameters are set. For example, the wall plug should turn on then the clock is 06:00 and the outdoor temperature is below 0 (zero) degrees.

I guess it's time for some Luup-code, but don't know how to write such a simple thing. Is there anyone out here who can give me a little push in the right direction?

Hope you understand what I'm trying to accomplish! Thanks in advance :)
Title: Re: Weather Plugin
Post by: guessed on October 03, 2011, 11:38:11 pm
@mhjens,
In MiOS, "A" and "B" conditions require Luup (for now).

The simplest way to do this is to [declaratively] define a Timer-based Scene, set for 06:00am, and put in the Commands section then config to turn on the Wall Plug device.

Without anything else, this would fire, unconditionally, every day at 06:00am, so we need a little Luup to "prevent" it from firing when the CurrentTemperature is >= 0 (or to let it fire when the CurrentTemperature is < 0)

This would look like:



Code: [Select]
local WEATHER_TEMP_DEVICE = 55
local temp = luup.variable_get("urn:upnp-org:serviceId:TemperatureSensor1",
                         "CurrentTemperature",
                         WEATHER_TEMP_DEVICE)
temp = tonumber(temp)

if (temp < 0) then
    return true
else
    return false
end

The last part, the "if .. then .. else .. end" can also be short-handed to:

Code: [Select]
return (temp < 0)
Title: Re: Weather Plugin
Post by: guessed on October 03, 2011, 11:52:08 pm
This functionality has been formally added to the release version.

The Documentation now points to download version 1.44 of the Weather plugin with the parsing of the WindCondition, and the addition of new variables for WindSpeed & WindDirection

Also, I've moved the downloads to come directly from Code.mios.com, which saves me a publication step of getting it over to box.net.


@Ap15e,
I've added the variables WindDirection and WindSpeed.  These will be populated (and Metric converted as needed) IF the WindCondition comes in the expected form, per the discussion above.

If it doesn't come in that form, they get populated with "NA" and -1 respectively, so buyer-be-ware when scripting against this.

This should handle the out of band cases.  I'm currently using sloppy parsing, so it's possible that unexpected values may enter these variables.

I've tagged it as 1.44 in code.mios.com, so you can test that out, but hasn't been promoted in the Wiki until the kinks are out of it.  I suspect there will be more than a few...


The JSON in this version displays WindDirection and WindSpeed values in the Dash instead of the WindCondition, so that Metric values display correctly in the dash.

Scene scripting against this is not exposed yet, but can be added once this value-extraction is working correctly for the most common case.

This version also tightens the URL sent to Google, to ensure that the English language strings come back.
Title: Re: Weather Plugin
Post by: mhjens on October 23, 2011, 10:16:04 am
Thank you guessed!

I've inserted the luup code you provided. But I'm such a noob so I don't really get what I need to change to get it to work. Now the scene fires the wall plug every time.

Code: [Select]
WEATHER_TEMP_DEVICE = 55
temp = luup.variable_get("urn:upnp-org:serviceId:TemperatureSensor1",
                         "CurrentTemperature",
                         WEATHER_TEMP_DEVICE)

What exactly do I need to change? The first, 55, is obviously something I need to change. But what about the rest?

Is there any documentation for understanding luup?
Title: Re: Weather Plugin
Post by: guessed on October 23, 2011, 02:22:01 pm
@mhjens,
I just revised the snippet somewhat as I'd left out a call to tonumber(...) which might have been messing up the numerical comparisons later in the code.

Sorry about that.  You'll also need to adjust the "0" to whatever baseline value for temp you're comparing against (like today, in NorCal, the min is about 52F/11C)

Can you try it again?


For learning Luup for Scenes, probably best to look at the examples in the Wiki:
    http://wiki.micasaverde.com/index.php/Luup_Scenes_Events


Thank you guessed!

I've inserted the luup code you provided. But I'm such a noob so I don't really get what I need to change to get it to work. Now the scene fires the wall plug every time.

Code: [Select]
WEATHER_TEMP_DEVICE = 55
temp = luup.variable_get("urn:upnp-org:serviceId:TemperatureSensor1",
                         "CurrentTemperature",
                         WEATHER_TEMP_DEVICE)

What exactly do I need to change? The first, 55, is obviously something I need to change. But what about the rest?

Is there any documentation for understanding luup?
Title: Re: Weather Plugin
Post by: mhjens on October 23, 2011, 02:44:11 pm
Thank you guessed, that little piece of code made the difference (temp = tonumber(temp)).

Works just like a charm!
Title: Re: Weather Plugin
Post by: Sender on November 07, 2011, 11:06:42 am
Hi, what is an easy way to change to Celcius instead of Fahrenheit?
Title: Re: Weather Plugin
Post by: oTi@ on November 07, 2011, 01:00:17 pm
Hi, what is an easy way to change to Celcius instead of Fahrenheit?
There's a few posts (http://forum.micasaverde.com/index.php/topic,1435.msg45764.html#msg45764) on that earlier in the thread.
Title: Re: Weather Plugin
Post by: guessed on November 08, 2011, 08:42:29 am
It's also listed in the Installation instructions, along with a picture.

It's always possible I've broken it with newer changes, so just let me know if you're continuing to have issues   8)

Hi, what is an easy way to change to Celcius instead of Fahrenheit?
There's a few posts (http://forum.micasaverde.com/index.php/topic,1435.msg45764.html#msg45764) on that earlier in the thread.
Title: Re: Weather Plugin
Post by: Sender on November 08, 2011, 10:05:35 am
Sorry, I cannot find the installation instructions anymore (should expect in start of thread) and cannot find earlier posts...
Title: Re: Weather Plugin
Post by: JOD on November 08, 2011, 10:26:53 am
http://code.mios.com/trac/mios_weather

JOD.
Title: Re: Weather Plugin
Post by: oTi@ on November 08, 2011, 10:56:57 am
[...] and cannot find earlier posts...
Click on 'few posts' in the original post, or the quote below. Those posts call out the specific part of the installation instructions (as mentioned by @guessed and referenced by @JOD), i.e. set the Metric variable to 1.

There's a few posts (http://forum.micasaverde.com/index.php/topic,1435.msg45764.html#msg45764) on that earlier in the thread.
Title: Re: Weather Plugin
Post by: sjolshagen on December 14, 2011, 12:44:28 pm
Hi @guessed,

Up front, let me thank you for a plugin that is solely responsible for saving me a bunch of heating and electricity costs over the past couple of years (I'm using it as the arbiter for whether to enable heating or not, as well as whether to trigger my roof de-icing cables. It has been very reliable and consistent)!

From the UI5 thread:
Quote
The Weather plugin's Dashboard now has different wrapping/info display output

After upgrading to UI5 (1.5.233) on my Vera2, I had all sorts of issues leading to the removal of all 3rd party plugins. After attempting to reinstall your Weather plugin (using the "app store", I get a single device (the one with "Conditions", "Wind" and "Speed" displayed) but no High/Low/Current temperature devices which I had while on UI4. Considering all the other information missing in terms of info/variables for the device, I'm guessing this isn't expected behavior.

I manually added the implementation file (I_GoogleWeather.xml) to the single device that was created, but that did not change anything either.

Lastly, I realize you probably will have to make modifications that are beyond the fixes expected in the next (publicly available) update to UI5 so I'm not trying to add pressure. Just wanted to let you know that things (UI5) are apparently pretty broken in/for the Weather plugin.

Title: Re: Weather Plugin
Post by: guessed on December 15, 2011, 12:01:52 am
@sjolshagen,
I have a bunch of UI5 code to merge back into source control after mods were done to UI5-enable it, by the MCV Team, to get them into apps.mios.com, and functional with the UI and Event changes for UI5.

I'm slowly working through these so there'll be a single code-stream supporting both UI4 and UI5 - at least to the best of my ability to be able to do that ;-)

The heavy-use ones are Weather, Ping and then potentially DSC, then everything else.

The mods done to each plugin has it's own nuances in this respect, so it can be slow going at times... that and, well, the Christmas party drinks which appear to have started early this yr 8)

The post-merge validation testing that I'm doing has been on UI4/Vera2/1.1.1337, which is my Production box for the house, and on UI5/Vera3/1.5.215 (what a Vera3 will auto-upgrade to) which is an "empty" box that I have for this testing/validation.

So far, the Weather Plugin has been fine under these test conditions (Vera3/UI5).  Reading through the other threads on the Vera2/UI5 combinations, particularly the threads on luup.variable_get, there's a strong likelyhood that the Weather sensor is impacted by that.  I wouldn't be at all surprised if it's spewing errors into /var/log/cmh/LuaUPnP.log, just somewhat less obviously than the Ping sensor's bad behavior in this same situation.

1.5.236 is supposed to address the problems with luup.variable_get.  Once this is available, it'll be great if someone can tell me if it's addressed any problems with the Weather component.  If it doesn't, then I'll take whatever log files I can get from folks to help me identify it's issues.

Quote
    The Weather plugin's Dashboard now has different wrapping/info display output
Yeah, this was in reference to the Root/Parent weather device having a different rendition, the other/child devices (High, Low, Humidity, Current) were still expected to show up...  I've attached what Vera3/UI5 shows for this plugin so you can see the formatting differences on the parent node (as compared to the pictures from

I've pushed the merge changes for weather to SVN, and "released" it so that @mcvflorin can grant me ownership, which will let me upload this revised/merged copy, but we really need the core Vera2/UI5 fixes1.5.236 to be able to validate the baseline functionality is working before we have to worry about what I've done.
Title: Re: Weather Plugin
Post by: guessed on December 15, 2011, 12:06:06 am
Hi @guessed,

Up front, let me thank you for a plugin that is solely responsible for saving me a bunch of heating and electricity costs over the past couple of years (I'm using it as the arbiter for whether to enable heating or not, as well as whether to trigger my roof de-icing cables. It has been very reliable and consistent)!
Sorry, forgot to respond to this in all the techno babble from the other post.

You're totally welcome, it's been fun publishing things that I use, and then finding the creative ways people are using them to automate stuff I'd never considered ;)
Title: Re: Weather Plugin
Post by: automator.app on December 15, 2011, 12:12:52 am

I've pushed the merge changes for weather to SVN, and "released" it so that @mcvflorin can grant me ownership, which will let me upload this revised/merged copy, but we really need the core Vera2/UI5 fixes1.5.236 to be able to validate the baseline functionality is working before we have to worry about what I've done.

I have 1.5.236 and the weather plugin and child devices do appear and look to be working, see attached.
Title: Re: Weather Plugin
Post by: radarengineer on December 15, 2011, 12:13:49 am
@guessed, your weather plugin was completly broken on the first UI5 release for Vera2 (1.5.233). As @sjoplshagen mentioned the root/parent weather device would show up but not get populated with anything, and the child devices would not be created.

The newest build of UI5 (1.5.236) for the Vera2 seems to have fixed it. I have all four devices with proper values and seemingly no errors in the logs. Build 1.5.233 was just completely broken as far as Luup was concerned.
Title: Re: Weather Plugin
Post by: guessed on December 15, 2011, 12:30:33 am
@guessed, your weather plugin was completly broken on the first UI5 release for Vera2 (1.5.233). As @sjoplshagen mentioned the root/parent weather device would show up but not get populated with anything, and the child devices would not be created.

The newest build of UI5 (1.5.236) for the Vera2 seems to have fixed it. I have all four devices with proper values and seemingly no errors in the logs. Build 1.5.233 was just completely broken as far as Luup was concerned.

Thanks for the 1.5.236 validation @radarengineer, that's good to hear.
Title: Re: Weather Plugin
Post by: Brientim on December 30, 2011, 07:13:19 pm
Hello,

I really like is one but a change to Ui5 makes it work appear in different categories. I know, I could put it in a room e.g. Weather an pin but, this does not appear to be the best logic and I would only consider this a work around.

With  UI5 The category_num determine where it is displayed, e.g. Category number 16 = climate and category number 17 = sensors. I have modified the all the item to appear in climate as this makes it standard; however, the World Weather can not be modified as this is not part of the file.

Is there a way to do this either by modifying the file or Lua as this is the basic forecast info that I would like to have in one place....

Any help would be appreciated.
Title: Re: Weather Plugin
Post by: guessed on January 01, 2012, 04:26:16 pm
@Brientim,
From what I've seen, the Category of a given device is derived from it's DeviceType... Using the information exposed in it's Plugin files.

There is no way that I'm aware of that allows usto explicitly specify the Category information in the Plugin files, or override this default/internal mapping between DeviceType and Category.

Btw, just for reference, here is the complete lift of categories
    http://wiki.micasaverde.com/index.php/Luup_UPNP_Files#Device_Categories

I can't find any doc describing the mapping of DeviceType to these Categories though.
Title: Re: Weather Plugin
Post by: Brientim on January 01, 2012, 08:47:22 pm
@Brientim,
From what I've seen, the Category of a given device is derived from it's DeviceType... Using the information exposed in it's Plugin files.

There is no way that I'm aware of that allows usto explicitly specify the Category information in the Plugin files, or override this default/internal mapping between DeviceType and Category.

Btw, just for reference, here is the complete lift of categories
    http://wiki.micasaverde.com/index.php/Luup_UPNP_Files#Device_Categories

I can't find any doc describing the mapping of DeviceType to these Categories though.

@guessed I concur with the above and I had checked out the previous protocols and I would suggest with UI5 they have reused this differently and it is not documented the changes.

I have attached a few screen capture which show how some items can be modified to the different tabs be using the category number but this is not always an option.... Still working on this and learning every step of the way
 
Title: Re: Weather Plugin
Post by: Ap15e on January 15, 2012, 07:37:02 am
@guessed

I'm quite sure that


    <stateVariable>
      <name>Metric</name>
      <sendEventsAttribute>no</sendEventsAttribute>
      <dataType>boolean</dataType>
      <defaultValue>false</defaultValue>
    </stateVariable>


is the culprit for the non-visibiliy from DeviceSpy. Replace false with 0, recreate the device and Vera is visible again. YMMV.

BTW, is there an online validation service for UPnP files?
Title: Re: Weather Plugin
Post by: guessed on January 15, 2012, 01:27:34 pm
@Ap15e,
Interesting research.  I'm wondering which part of the Tooling is breaking with the value present.

eg. DeviceSpy, Vera, etc, etc.

I've never seen a [hosted] Validator for UPnP files, but there might be something in the Windows [non-hosted] space.  IBM seems to have a bunch of [Windows-specific] tools that are no longer supported that all operate in this area:

    http://software.intel.com/en-us/articles/intel-software-for-upnp-technology-technology-overview/

Looks like DeviceSpy itself is in the list, along with some sort of Validator toolset (no experience, since I don't run Windows at home)

According to Section 1.2.1 of the UPnP Spec, ALL consumers are expected to handle values of of 0, 1, true, false, yes and no.  Whilst they strongly recommend the use of 0 or 1, they have a specific requirement for them to all handle the above values.

Reference: www.upnp.org/specs/av/UPnP-av-AVDataStructureTemplate-v1.pdf

Quote
1.2.1 Data Types
This specification uses data type definitions from two different sources. The UPnP Device Architecture defined data types are used to define state variable and action argument data types [DEVICE]. The XML Schema namespace is used to define property data types [XML SCHEMA-2].

For UPnP Device Architecture defined boolean data types, it is strongly RECOMMENDED to use the value “0” for false, and the value “1” for true. However, when used as input arguments, the values “false”, “no”, “true”, “yes” may also be encountered and MUST be accepted. Nevertheless, it is strongly RECOMMENDED that all boolean state variables and output arguments be represented as “0” and “1”.

For XML Schema defined Boolean data types, it is strongly RECOMMENDED to use the value “0” for false, and the value “1” for true. However, when used as input properties, the values “false”, “true” may also be encountered and MUST be accepted. Nevertheless, it is strongly RECOMMENDED that all Boolean properties be represented as “0” and “1”.

Anyhow, I have no problem changing it (and dealing with backwards compatibility and the other requirements listed above) but I'd like to know which piece of the framework is breaking (aka non UPnP Compliant) first.



@guessed

I'm quite sure that


    <stateVariable>
      <name>Metric</name>
      <sendEventsAttribute>no</sendEventsAttribute>
      <dataType>boolean</dataType>
      <defaultValue>false</defaultValue>
    </stateVariable>


is the culprit for the non-visibiliy from DeviceSpy. Replace false with 0, recreate the device and Vera is visible again. YMMV.

BTW, is there an online validation service for UPnP files?
Title: Re: Weather Plugin
Post by: Ap15e on January 15, 2012, 01:48:55 pm
From 'UPnP™ Device Architecture 1.1'

Quote
boolean
“0” for false or “1” for true. The values “true”, “yes”, “false”, or “no” are
deprecated and MUST NOT be sent but MUST be accepted when received. When
received, the values “true” and “yes” MUST be interpreted as true and the values
“false” and “no” MUST be interpreted as false.

For the DeviceValidator to work, the device under test must be visible via UPnP ...
Title: Re: Weather Plugin
Post by: guessed on January 15, 2012, 01:55:15 pm
Interesting.  That implies that MiOS needs to convert "all accepted forms", per the other UPnP spec, to the normalized 0/1 values. 

What Bug# are you using to track the problem in MiOS?  I can go update it with these findings.


A little odd that the two UPnP specs are inconsistent with each other, but that's a standards body for you... ;)
Title: Re: Weather Plugin
Post by: Ap15e on January 15, 2012, 02:28:44 pm
You could add it to http://bugs.micasaverde.com/view.php?id=1487 ...

But I strongly suggest to open a few new bugs against MiOS.
- boolean 0/1 vs. false/true
- http://forum.micasaverde.com/index.php/topic,8545.msg56028.html#msg56028

... or create a new 'UPnP super bug'  :) that links to all other UPnP related bugs.
Title: Re: Weather Plugin
Post by: guessed on January 15, 2012, 02:53:23 pm
ok, the bug above doesn't represent this specific UPnP problem, so I'll create a new one that indicates that this specific construct, relating to boolean values, impacts device discovery due to the Core MiOS code being out of compliance with the UPnP sections noted above (one for what the Device must represent on the net, and another for what it must accept from a Device-file standpoint)

Then they'll have a very specific item to address, with specific parameters to determine when it's fixed or not.

Thanks for the research!
Title: Re: Weather Plugin
Post by: guessed on January 15, 2012, 03:02:55 pm
Bug 2058 (http://bugs.micasaverde.com/view.php?id=2058) filed against MiOS for this specific problem, referencing back to the conversation snippets above.
Title: Re: Weather Plugin
Post by: guessed on January 15, 2012, 03:29:43 pm
Tag 1.46-UI5 created for the required work-arounds.  This is available here for anyone that needs UPnP-based discovery of MiOS to work correctly:

    http://code.mios.com/trac/mios_weather/browser/tags/1.46-UI5

I'll make the requests to push it to apps.mios.com shortly for automated update of UI5 users.  This version works under both UI5 and UI4.

UPDATE: The changed files have been entered into the Blackhole known as the "developer interface to apps.mios.com"... no idea when they'll come out again.
Title: Re: Weather Plugin
Post by: Ap15e on January 15, 2012, 06:01:14 pm
Thanks for the update.

Unfortunately, it looks like the update doesn't fix the problem for Vera V3 ...

How to reproduce the problem:

Install Device Spy 0.0.53
Reset Vera V3 to factory default
Install firmware 1.5.265
-> Vera V3 is visible from Device Spy
Install the latest version of the Weather plugin (with fix for type boolean)
-> Device Spy loses Vera V3
Remove the Weather plugin
-> Vera V3 is visible again

So, something besides the boolean quirk must trigger it - any idea how to identify what triggers the problem?

Edit:
Stripping down the Weather plugin might be too cumbersome, checking other plugins might reveal a pattern ...
Title: Re: Weather Plugin
Post by: guessed on January 15, 2012, 06:08:12 pm
@Ap15e,
No idea what else could cause it.  There should be nothing that a Plugin can do that'll stop Vera from advertising it's UPnP services.  You'll want to augment #2058 with your latest Vera3 findings.

It's also really odd that this change worked ok for you under Vera2, but doesn't under Vera3.   It might just be co-incidence about how memory aligns, or something similarly whacked out, as I can't explain why one version would, and the other version wouldn't...
Title: Re: Weather Plugin
Post by: Ap15e on January 15, 2012, 06:15:50 pm
Would have to recheck on Vera V2 to be sure.

Tracking the problem down could take a considerable amount of time, so IMHO we should invest some time in setting up an appropriate strategy ...
Title: Re: Weather Plugin
Post by: guessed on January 15, 2012, 06:26:21 pm
Maybe.  But I'm also not convinced it isn't simply a timeout issue in DeviceSpy itself. 

I have a tool called Browse UPnP, by Oppian, that runs on my iPhone.  Both my Vera2 and my Vera3 show up in the main listings under this device and I can drill down to see some basic details. 

From time to time, they'll disappear from the listings... but so will some other UPnP devices around the house, so I'm assuming that the tool is waiting only a limited amount of time for a response before moving on with the display functions.

To know what's really going on, you'd have to be able to separate out:
a) whether Vera is sending a UPnP response
b) what that response is,
c) whether it's functionally valid,
d) whether it's consistent across calls, AND;
e) whether DeviceSpy ignored it (or not).

Have you run Wireshark (tcpdump, or similar) to see the Raw UDP request/response data whilst DeviceSpy is running from your Windows box?
Title: Re: Weather Plugin
Post by: Ap15e on January 15, 2012, 07:01:05 pm
Using Device Sniffer ('Search all devices') one could come to the conclusion that my Vera V3 - for whatever reason - doesn't manage to enumerate all devices the Weather plugin consists of, see attachments.
Title: Re: Weather Plugin
Post by: guessed on January 15, 2012, 07:29:01 pm
Looking at the traces above, the enumerations appear to stop after ~2sec.  Not sure if that's just a co-incidence or that Vera is stopping (or the tool stops looking).  There's a part of me that thinks the Tools aren't used to Large/Long lists of UPnP Services, so they bail out early.

My recommendation: Run WireShark, see what's really going on at the Network level...  Perhaps UPnP specifies that an enum should be finished in 2sec, and that's just not enough time, but the "Tools" stop collecting after that, who knows.  Either way, WireShark is protocol agnostic so it'll it'll help you isolate which part is terminating the data transmission (Vera) or collection (various UPnP Tools)

Vera is using a UPnP Toolkit/Lib under the covers so there's all sorts of scope for crazy ;-)
Title: Re: Weather Plugin
Post by: Ap15e on January 16, 2012, 07:57:19 pm
Here are the results from Wireshark for 'M-SEARCH ssdp:all':

Vera V3, no Z-Wave devices, plugins: AOO, Google Weather:
It takes about 7 seconds and 66 packets to enumerate the devices, the enumeration seems to be complete.

Vera V1, many Z-Wave devices and many Luup plugins:
It takes about 190 seconds and 1566 packets to enumerate the devices - obviously too much for Device Spy to handle ...

Edit:
Please note that Vera should enumerate all devices within 5(!) seconds; see the following excerpt from the 'UPnP™ Device Architecture 1.1':
Code: [Select]
MX
REQUIRED. Field value contains maximum wait time in seconds. MUST be greater than or equal to 1 and SHOULD be less than
5 inclusive. Device responses SHOULD be delayed a random duration between 0 and this many seconds to balance load for
the control point when it processes responses. This value MAY be increased if a large number of devices are expected to
respond. The MX field value SHOULD NOT be increased to accommodate network characteristics such as latency or
propagation delay (for more details, see the explanation below). Specified by UPnP vendor. Integer.
Title: Re: Weather Plugin
Post by: mcvflorin on January 17, 2012, 08:50:43 am
UPDATE: The changed files have been entered into the Blackhole known as the "developer interface to apps.mios.com"... no idea when they'll come out again.

I noticed that the Json file was actually the service file. Can you describe the issues you encountered?
Title: Re: Weather Plugin
Post by: guessed on January 17, 2012, 12:00:33 pm
UPDATE: The changed files have been entered into the Blackhole known as the "developer interface to apps.mios.com"... no idea when they'll come out again.

I noticed that the Json file was actually the service file. Can you describe the issues you encountered?
Here's a sampling:

a) It's WAY too easy to make a mistake in this UI.
b) Specifically, we need to upload files one at a time, and there's no feedback about which were uploaded, and whether they were correct, what the diffs were (etc).  This might be ok for toy plugins, but try uploading blind when you have 6-7 files, mistakes WILL be made.
c) Stuff can be "uploaded" and not committed.  I found a file laying around when I committed, which surprised me since I didn't upload it.  No idea what it was, but the commit told me that something else was committed.
d) In a Version # tuple like X.Y.Z (1.5.254) what is the Minor Version and what is the Major version?
e) Why would I even upload files to this UNLESS I was trying to create a new release/version, or do a minor patch on an existing release?  These are currently completely separate functions in the UI....  It's possible to upload files at any time, separate from creating a release/version.


In a lot of ways, it would be far simpler to let us upload WHOLE releases, complete with a File containing all of the required/supporting Metadata (file placement, Plugin Descriptions, Documentation URL's, Device/Implementation filename (etc).  Doing this via the existing "one at a time" UI will be painful, especially when secondary resources start getting added (GIF's, JS, etc, etc)

Do this as a ZIP file, or some sort of other container, with a specified Directory structure (where's the Metadata file, etc, etc).  Let me upload that as a single file "release/version" ready for approval.  If you need to pull it apart on your end, go for it, but there's no reason to have the Developers see this.

Sound familiar?   It should, Java works this way for a reason.
Title: Re: Weather Plugin
Post by: JOD on January 22, 2012, 02:49:18 pm
@guessed,

Is it possible to utilize the "Current Conditions XML's" from  Weather Underground?

JOD.
Title: Re: Weather Plugin
Post by: guessed on January 22, 2012, 11:14:43 pm
@JOD,
The interface is fairly simple, in terms of what data is exposed from the Weather plugin.  As long as the feed provides the same type of information, it should be possible to write another implementation file that pulls from a different data provider (like wunderground).

Originally I used google as it didn't require me (or users) to sign up for an API key, and because it also had a reasonable option for geolocation with the same URL (taking an arbitrary lat-long, ZIP code, etc,etc and just returning the right wether data)...  The last part is always available with other services, but it adds to the complexity if it's not built in.

What specifically are you looking to get/extract from winderground?


PS: the enhanced UIs are what I'd like, but the MiOS dashboard framework is too simplistic to handle that, at least without resorting to leveraging MiOS security bugs...., or hiding it away in the device dialogs.
Title: Re: Weather Plugin
Post by: lolodomo on February 05, 2012, 04:26:23 am
Hi

I received recently a VeraLite (UI5) and the weather plugin is the first plugin I tried to install yesterday.
All the devices were created but no value is dispayed/retrieved.
After reloading, here is what I can find in the log:

09      02/05/12 10:16:49.967   JobHandler_LuaUPnP::Run device 8 World Weather room 0 type urn:demo-micasaverde-com:device:weather:1 id  parent 0/0xcece20 upnp: 0 <0x2aab8000>
02      02/05/12 10:16:49.972   GetSunriseSunset error#1 sunrise: 1328339788/2012-02-04 08:16:28 sunset: 1328374406/2012-02-04 17:53:26 midnight: 1328396400/13426220 <0x2aab8000>

I have set my location (Paris), not in the plugin but in the Vera settings.
Any idea what could be wrong ?
Any experience of this plugin with UI5 ?
Title: Re: Weather Plugin
Post by: oTi@ on February 05, 2012, 06:09:50 am
Any experience of this plugin with UI5 ?
It should work on UI5. Have you tried another reload?
Title: Re: Weather Plugin
Post by: lolodomo on February 05, 2012, 01:32:26 pm
Any experience of this plugin with UI5 ?
It should work on UI5. Have you tried another reload?

Yes, I tried several reloads.
Someone on a french forum tells me he has exactly the same behaviour, meaning no data displayed.
You say 'should work". Can someone confirm it is working with UI5 ?
Should I change log levels to give more logs ?
Title: Re: Weather Plugin
Post by: JOD on February 05, 2012, 02:38:59 pm
Quote
As long as the feed provides the same type of information, it should be possible to write another implementation file that pulls from a different data provider (like wunderground)
That's what I was hoping.

Quote
What specifically are you looking to get/extract from winderground?
Well, my weather station is uploading to it ~every 1 minute, and is obviously closer to my local weather conditions than the data that Googles is pulling from, which is probably my local airport about 6 miles away. So mainly the same params as the plugins, Wind speed and direction, temp & humidity, current condition stuff.

Link to current condition xml of MLKWF1's station: http://api.wunderground.com/weatherstation/WXCurrentObXML.asp?ID=MLKWF1
This is my Wunderground Current Conditions xml data;
Code: [Select]
  <?xml version="1.0" encoding="utf-8" ?>
- <current_observation>
  <credit>Weather Underground Personal Weather Station</credit>
  <credit_URL>http://wunderground.com/weatherstation/</credit_URL>
- <image>
  <url>http://icons.wunderground.com/graphics/bh-wui_logo.gif</url>
  <title>Weather Underground</title>
  <link>http://wunderground.com/weatherstation/</link>
  </image>
- <location>
  <full>CITY&STATE</full>
  <neighborhood>The Hood</neighborhood>
  <city>CITY</city>
  <state>FL</state>
  <zip />
  <latitude>LAT</latitude>
  <longitude>-LONG</longitude>
  <elevation>60 ft</elevation>
  </location>
  <station_id>MY ID</station_id>
  <station_type>Davis Vantage Pro2............Davis Weather Envoy.............Davis IP Logger...........</station_type>
  <observation_time>Last Updated on February 5, 2:37 PM EST</observation_time>
  <observation_time_rfc822>Sun, 05 Feb 2012 19:37:46 GMT</observation_time_rfc822>
  <weather />
  <temperature_string>79.1 F (26.2 C)</temperature_string>
  <temp_f>79.1</temp_f>
  <temp_c>26.2</temp_c>
  <relative_humidity>72</relative_humidity>
  <wind_string>From the East at 6.0 MPH Gusting to 11.0 MPH</wind_string>
  <wind_dir>East</wind_dir>
  <wind_degrees>99</wind_degrees>
  <wind_mph>6.0</wind_mph>
  <wind_gust_mph>11.0</wind_gust_mph>
  <pressure_string>29.97" (1014.8 mb)</pressure_string>
  <pressure_mb>1014.8</pressure_mb>
  <pressure_in>29.97</pressure_in>
  <dewpoint_string>69.3 F (20.7 C)</dewpoint_string>
  <dewpoint_f>69.3</dewpoint_f>
  <dewpoint_c>20.7</dewpoint_c>
  <heat_index_string>82 F (28 C)</heat_index_string>
  <heat_index_f>82</heat_index_f>
  <heat_index_c>28</heat_index_c>
  <windchill_string />
  <windchill_f />
  <windchill_c />
  <solar_radiation />
  <UV />
  <precip_1hr_string>0.00 in (0.0 mm)</precip_1hr_string>
  <precip_1hr_in>0.00</precip_1hr_in>
  <precip_1hr_metric>0.0</precip_1hr_metric>
  <precip_today_string>0.00 in (0.0 cm)</precip_today_string>
  <precip_today_in>0.00</precip_today_in>
  <precip_today_metric>0.0 cm</precip_today_metric>
  <history_url>http://www.wunderground.com/weatherstation/WXDailyHistory.asp?ID=MY ID</history_url>
  <ob_url>http://www.wunderground.com/cgi-bin/findweather/getForecast?query=LAT,LONG</ob_url>
  </current_observation>
Would all the above need to be in the new I_xml in order to read it? or could it be limited to just the current conditions? Wind speed and direction, temp & humidity etc.

JOD.
Title: Re: Weather Plugin
Post by: guessed on February 05, 2012, 04:59:44 pm
@JOD,
Yes, you'd need another I_xxxx.xml file.  It would be an almost complete clone of the existing one, except there would be changes to the URL to "fire off", any substitution of parameters for Lat/Long as required by wunderground (etc), and the calls to extract_element (and probably the transformation of resulting values/formats of values.


Title: Re: Weather Plugin
Post by: guessed on February 05, 2012, 05:15:59 pm
Yes, it's working under UI5.  It's possible that there are regional differences in the way Google returns it's feed data that's tripping things up.

The UI should come up even if there's no data in it.  So the first thing is to attach a few screenshots of exactly what you're seeing in the Vera3 Dashboard UI, as well as the Spanner/Wrench/Dialog version of the device.... just to iron out any possibility of mis-install for any reason.

Next, enable Verbose logging under Setup/Logs/[ x ] Verbose Logging and save/restart Vera.  You should be able to get a snippet in the logs that looks something akin to the following (filtered to show log lines containing "weather" (in any case)):

Code: [Select]
01 02/05/12 14:03:56.179 luup_log:3: GoogleWeather: Google Weather #3 starting up with id  <0x2b767680>
11 02/05/12 14:03:56.180 Child_Devices::AddChild id Weather-Current-Temperature parent id  device type urn:schemas-micasaverde-com:device:TemperatureSensor:1 parent device: 3 devfile:D_TemperatureSensor1.xml desc:Temperature parms:  <0x2b767680>
11 02/05/12 14:03:56.180 Child_Devices::AddChild id Weather-Forecast-LowTemperature parent id  device type urn:schemas-micasaverde-com:device:TemperatureSensor:1 parent device: 3 devfile:D_TemperatureSensor1.xml desc:Low Temperature parms:  <0x2b767680>
11 02/05/12 14:03:56.181 Child_Devices::AddChild id Weather-Forecast-HighTemperature parent id  device type urn:schemas-micasaverde-com:device:TemperatureSensor:1 parent device: 3 devfile:D_TemperatureSensor1.xml desc:High Temperature parms:  <0x2b767680>
11 02/05/12 14:03:56.181 Child_Devices::AddChild id Weather-Current-Humidity parent id  device type urn:schemas-micasaverde-com:device:HumiditySensor:1 parent device: 3 devfile:D_HumiditySensor1.xml desc:Humidity parms:  <0x2b767680>
11 02/05/12 14:03:56.182 Child_Devices::Synchronize child 4 current 1 id Weather-Current-Temperature parent 3 <0x2b767680>
11 02/05/12 14:03:56.182 Child_Devices::Synchronize child 5 current 1 id Weather-Forecast-LowTemperature parent 3 <0x2b767680>
11 02/05/12 14:03:56.183 Child_Devices::Synchronize child 6 current 1 id Weather-Forecast-HighTemperature parent 3 <0x2b767680>
11 02/05/12 14:03:56.183 Child_Devices::Synchronize child 7 current 1 id Weather-Current-Humidity parent 3 <0x2b767680>
10 02/05/12 14:03:56.194 XXX-UpdateSystemMessagesTasks now 1=World Weather[3]: Running Lua Startup <0x2b967680>
10 02/05/12 14:03:56.195 XXX-UpdateSystemMessagesTasks now 1=World Weather[3]: Running Lua Startup <0x2b967680>
10 02/05/12 14:03:56.198 XXX-UpdateSystemMessagesTasks now 1=World Weather[3]: Running Lua Startup <0x2b967680>
10 02/05/12 14:03:57.102 FileUtils::ReadURL starting http://www.google.com/ig/api?weather=,,,34567800,-123456000&hl=en <0x2c167680>
10 02/05/12 14:03:57.214 FileUtils::ReadURL 0/resp:200 size 1356 http://www.google.com/ig/api?weather=,,,34567800,-123456000&hl=en <0x2c167680>
01 02/05/12 14:03:57.319 luup_log:3: GoogleWeather: At [34.567800 ,-123.456000], it's currently 16(US) and Mostly Cloudy.  Humidity is 45%.  Low is 7 High is 19.  Condition is Mostly Cloudy, Wind Condition is N at 6 mph, Direction is N, Speed is 10 <0x2c167680>
06 02/05/12 14:03:57.322 Device_Variable::m_szValue_set device: 3 service: urn:upnp-micasaverde-com:serviceId:Weather1 variable: Condition was: Mostly Cloudy now: Mostly Cloudy #hooks: 0 upnp: 0 v:0xc41630/NONE duplicate:1 <0x2c167680>
06 02/05/12 14:03:57.322 Device_Variable::m_szValue_set device: 3 service: urn:upnp-micasaverde-com:serviceId:Weather1 variable: WindCondition was: N at 6 mph now: N at 6 mph #hooks: 0 upnp: 0 v:0xc41268/NONE duplicate:1 <0x2c167680>
06 02/05/12 14:03:57.323 Device_Variable::m_szValue_set device: 3 service: urn:upnp-micasaverde-com:serviceId:Weather1 variable: WindDirection was: N now: N #hooks: 0 upnp: 0 v:0xc412a8/NONE duplicate:1 <0x2c167680>
06 02/05/12 14:03:57.324 Device_Variable::m_szValue_set device: 3 service: urn:upnp-micasaverde-com:serviceId:Weather1 variable: WindSpeed was: 10 now: 10 #hooks: 0 upnp: 0 v:0xc41288/NONE duplicate:1 <0x2c167680>

In the middle somewhere, you'll see a line like:
Code: [Select]
    10 02/05/12 14:03:57.102 FileUtils::ReadURL starting http://www.google.com/ig/api?weather=,,,34567800,-123456000&hl=en <0x2c167680>
10 02/05/12 14:03:57.214 FileUtils::ReadURL 0/resp:200 size 1356 http://www.google.com/ig/api?weather=,,,34567800,-123456000&hl=en <0x2c167680>
01 02/05/12 14:03:57.319 luup_log:3: GoogleWeather: At [34.567800 ,-123.456000], it's currently 16(US) and Mostly Cloudy.  Humidity is 45%.  Low is 7 High is 19.  Condition is Mostly Cloudy, Wind Condition is N at 6 mph, Direction is N, Speed is 10 <0x2c167680>

For the URL reported by your system, post (as an attachment) the results of that here.  That'll give me an idea of what Google is returning from your location.  It's contents should be in English as I've specifically requested that in the URL.

Any experience of this plugin with UI5 ?
It should work on UI5. Have you tried another reload?

Yes, I tried several reloads.
Someone on a french forum tells me he has exactly the same behaviour, meaning no data displayed.
You say 'should work". Can someone confirm it is working with UI5 ?
Should I change log levels to give more logs ?
Title: Re: Weather Plugin
Post by: lolodomo on February 05, 2012, 05:57:39 pm
Thanks, I will give you all required information.
First, my dashboard is ok, I have the 5 devices exactly like oTi@'s snapshot present few posts before, except that I have no value.
My installation has been done through the apps store. Version of the plugin is 1.0.
Files used are: D_Weather.xml, I_GoogleWeather.xml, ... Through UI5, I can display these files but what should I verify ?

Traces coming next.
Title: Re: Weather Plugin
Post by: lolodomo on February 05, 2012, 06:16:15 pm
Here are the two lines I found in the logs in verbose mode:

Code: [Select]
10      02/05/12 23:59:00.103   FileUtils::ReadURL starting http://www.google.com/ig/api?weather=,,,49000000,2333000&hl=en __LEAK__ this:32768 start:32768 to 0xaf5000 <0x2c9b7680>
10      02/05/12 23:59:00.183   FileUtils::ReadURL 0/resp:200 size 132 http://www.google.com/ig/api?weather=,,,49000000,2333000&hl=en <0x2c9b7680>

The result of http://www.google.com/ig/api?weather=,,,49000000,2333000&hl=en

Code: [Select]
<?xml version="1.0"?>
<xml_api_reply version="1"><weather mobile_zipped="1" mobile_row="0" tab_id="0" module_id="0"/></xml_api_reply>

I don't have a line like you in the logs with all the data (the one with "luup_log:3: GoogleWeather").
Title: Re: Weather Plugin
Post by: guessed on February 05, 2012, 06:23:41 pm
@lolodomo,
Let's go for the traces next, the 3x files (D_*.xml, I_*.xml and D_*.json) should be fine as long as you're seeing what @oTi@ posted above as a screenshot.

I suspect a feed format problem for users coming in from France... maybe Google got p'd off from the recent court fine for free maps...  ;)   (just kidding)
Title: Re: Weather Plugin
Post by: lolodomo on February 05, 2012, 06:30:09 pm
In my Vera settings, my location is set to Paris. I just checked in Google Maps, there are weather data for Paris ;-)
In the plugin settings, the only change I have done is to select "Metric" as unit.

Edit: oups my city was not Paris ! I changed it to Paris but the google URL is still the same.
Title: Re: Weather Plugin
Post by: guessed on February 05, 2012, 06:49:21 pm
I just tried to move to Berlin (Germany) and to Rome (Italy). What is strange is that the google URL is always the same. The number at the end don't change.
That's why i need to see the output of running the URL from your location, and maybe the URL itself.  The Lat/Long values are gotten from Vera, based upon the location you enter, so it's also possible they're whacked.
Title: Re: Weather Plugin
Post by: lolodomo on February 05, 2012, 06:54:54 pm
I just tried to move to Berlin (Germany) and to Rome (Italy). What is strange is that the google URL is always the same. The number at the end don't change.
That's why i need to see the output of running the URL from your location, and maybe the URL itself.  The Lat/Long values are gotten from Vera, based upon the location you enter, so it's also possible they're whacked.

You have it at the top of this page.
I made a mistake, my city was not Paris (timezone is Paris) but a city near Paris. I changed it to Paris but no change.
Now I will try to really move to Germany or Italy...
Title: Re: Weather Plugin
Post by: lolodomo on February 05, 2012, 06:57:31 pm
I moved to Berlin in Germany and now it's working !

What's going wrong in France ? :-)
I will now try another big city from France.
Title: Re: Weather Plugin
Post by: lolodomo on February 05, 2012, 07:03:32 pm
Try with Lyon, second city in France. New URL is http://www.google.com/ig/api?weather=,,,45750000,4850000&hl=en
Same bad result. It looks like there is a problem with requests from a french position ?
Title: Re: Weather Plugin
Post by: JOD on February 05, 2012, 07:04:28 pm
@JOD,
Yes, you'd need another I_xxxx.xml file.
Thanks @guessed,
I'll take a look and see if I can make the changes.

JOD.
Title: Re: Weather Plugin
Post by: Ap15e on February 05, 2012, 07:12:19 pm
Result for

http://www.google.com/ig/api?weather=,,,49000000,2333000&hl=en

from Germany:

<?xml version="1.0"?><xml_api_reply version="1"><weather module_id="0" tab_id="0" mobile_row="0" mobile_zipped="1"/></xml_api_reply>

Result for

http://www.google.com/ig/api?weather=paris&hl=en

from Germany seems to be OK.
Title: Re: Weather Plugin
Post by: guessed on February 05, 2012, 07:13:56 pm
Interesting.  For whatever reason, Google isn't returning valid weather response data when you specify Lat/Long in France (and perhaps nearby, untested)

You should be able to use the Location field, within the Weather Plugin dialog, to "override" the Lat/Long based derivation.  Try using something like "Lyon,France" in there and see if that works correctly.

Not sure why Google wouldn't return it for Lat/Long values, but the override permits text-based locations.  I just tried that from the US and it's giving me the correct response.

Try with Lyon, second city in France. New URL is http://www.google.com/ig/api?weather=,,,45750000,4850000&hl=en
Same bad result. It looks like there is a problem with requests from a french position ?
Title: Re: Weather Plugin
Post by: lolodomo on February 06, 2012, 08:57:43 am
Interesting.  For whatever reason, Google isn't returning valid weather response data when you specify Lat/Long in France (and perhaps nearby, untested)

You should be able to use the Location field, within the Weather Plugin dialog, to "override" the Lat/Long based derivation.  Try using something like "Lyon,France" in there and see if that works correctly.

Not sure why Google wouldn't return it for Lat/Long values, but the override permits text-based locations.  I just tried that from the US and it's giving me the correct response.

Very interesting.
These URLs give results:
http://www.google.com/ig/api?weather=Paris,,,,&hl=en
http://www.google.com/ig/api?weather=Paris,France,,,&hl=en
http://www.google.com/ig/api?weather=Paris,,,49000000,2333000&hl=en
I will verify later at home that the plugin is working when I set a city in the plugin.

Will it be possible to add a new setting to select the language of results ?
http://www.google.com/ig/api?weather=Paris,,,,&hl=fr
retrieves data with french labels.
This could be interesting if you are using "condition_data" to display conditions. We could then have the text in our natural language.
Title: Re: Weather Plugin
Post by: lolodomo on February 06, 2012, 02:22:34 pm
I can confirm that setting a city in the plugin's settings solve my problem 8)

One last thing: when I reopen the settings, the location field is empty. It should be the last value I entered ?
It may be interesting to display the "postal_code data" or "city data" somewhere in the dashboard.
Title: Re: Weather Plugin
Post by: Raynaldg on February 06, 2012, 06:30:41 pm
I installed the Google Weather Plugin in VeraLite.  The location is set to my City and the temperature format to Celcius (Metric). 
However, I don't have a good result displayed with this plugin (temperature, high, low and humidity are all wrong). 
Somebody know why ???
Title: Re: Weather Plugin
Post by: guessed on February 06, 2012, 10:58:27 pm
I installed the Google Weather Plugin in VeraLite.  The location is set to my City and the temperature format to Celcius (Metric). 
However, I don't have a good result displayed with this plugin (temperature, high, low and humidity are all wrong). 
Somebody know why ???
A few items...
a) What version of MiOS are you running on the Vera light?
b) Define "wrong" (eg. a screencap)
c) What Location do you use for Vera's settings, and if you set the Location override in the Plugin what is it set to? (exact string)
d) Per the above conversation, what is the result of running the URL  like this, that's in your log files (and has extra parameters at the end)
​http://www.google.com/ig/api?weather=...
Title: Re: Weather Plugin
Post by: guessed on February 06, 2012, 11:04:20 pm
I can confirm that setting a city in the plugin's settings solve my problem 8)

One last thing: when I reopen the settings, the location field is empty. It should be the last value I entered ?
The Location field in UI5's Config Screen, or the Device's Config dialog?

Quote
It may be interesting to display the "postal_code data" or "city data" somewhere in the dashboard.
Generally, there's less usable room in the Dashboard UI in UI5 than UI4, we've had to already to prune back what's displayed.  Also the feed doesn't always populate those values, it kinda depends upon the location information (parameters), how they're specified (Lat-Long, PostCode, etc, etc), and other regional settings.  There's no spec for the Google Weather feed, so it's a bit hard to work out the criteria of what gets displayed when for this stuff (it's very trial and error)

PS: I've also tended to avoid displaying information that may not be available from other feeds (like Wunderground, Yahoo! Weather etc) or would require "mapping" of the string formats from one system to another.
Title: Re: Weather Plugin
Post by: guessed on February 06, 2012, 11:09:08 pm
Will it be possible to add a new setting to select the language of results ?
http://www.google.com/ig/api?weather=Paris,,,,&hl=fr
retrieves data with french labels.
This could be interesting if you are using "condition_data" to display conditions. We could then have the text in our natural language.
That's this item, or the latter part of it at least:
    http://code.mios.com/trac/mios_weather/ticket/4

It's been on the burner for quite a while now, so likely won't get addressed unless we get some folks volunteer to author/add the required fixes.  When impl, it'll take a hit on performance since every "non-native" Weather request will actually become 2x URL calls (one for English so that the data, and parsing can work) and one for the native-language request.

It might work without doing that, but we've observed cases where the data itself is regional (like Metric/Imperial) based upon this type of parameter.
Title: Weather Plugin
Post by: Raynaldg on February 07, 2012, 12:05:17 pm
A few items...
a) What version of MiOS are you running on the Vera light?
b) Define "wrong" (eg. a screencap)
c) What Location do you use for Vera's settings, and if you set the Location override in the Plugin what is it set to? (exact string)
d) Per the above conversation, what is the result of running the URL  like this, that's in your log files (and has extra parameters at the end)
​http://www.google.com/ig/api?weather=...
Thank you for the feedback but I correct the situation by changing the city by a biggest one near mine.
It's not very far and the temperature is almost identical.  ;)
Title: Re: Weather Plugin
Post by: lolodomo on February 07, 2012, 03:05:06 pm
I can confirm that setting a city in the plugin's settings solve my problem 8)

One last thing: when I reopen the settings, the location field is empty. It should be the last value I entered ?
The Location field in UI5's Config Screen, or the Device's Config dialog?

Field from the config dialog of the World Weather device is empty when reopening the dialog.
PS: City in the UI5 config screen is ok.
Title: Re: Weather Plugin
Post by: cokeman on February 07, 2012, 03:46:00 pm
Hi,

is it posible to get the wind speed in meters per second ? (Thats what we use in denmark) :-)

/Cokeman
Title: Re: Weather Plugin
Post by: guessed on February 07, 2012, 10:51:39 pm
@lolodomo,
It does "set" the value behind the scenes, but it can't be seen until after you've Reload'd and you have to see it under the "Advanced" tab.  As you've noted, it's not displaying in the Field under the Settings tab.


I can confirm that setting a city in the plugin's settings solve my problem 8)

One last thing: when I reopen the settings, the location field is empty. It should be the last value I entered ?
The Location field in UI5's Config Screen, or the Device's Config dialog?

Field from the config dialog of the World Weather device is empty when reopening the dialog.
PS: City in the UI5 config screen is ok.
Title: Re: Weather Plugin
Post by: guessed on February 07, 2012, 10:54:42 pm
@Cokeman,
The plugin displays the results in either kph, mph depending upon whether you have it set to metric or to US Units.  This follows the pattern for the underlying data feeds (which also use mph or kph).

I have no plans to change this  8)

Hi,

is it posible to get the wind speed in meters per second ? (Thats what we use in denmark) :-)

/Cokeman
Title: Re: Weather Plugin
Post by: lolodomo on February 08, 2012, 02:17:41 pm
That's true. Ok.

@lolodomo,
It does "set" the value behind the scenes, but it can't be seen until after you've Reload'd and you have to see it under the "Advanced" tab.  As you've noted, it's not displaying in the Field under the Settings tab.


I can confirm that setting a city in the plugin's settings solve my problem 8)

One last thing: when I reopen the settings, the location field is empty. It should be the last value I entered ?
The Location field in UI5's Config Screen, or the Device's Config dialog?

Field from the config dialog of the World Weather device is empty when reopening the dialog.
PS: City in the UI5 config screen is ok.
Title: Re: Weather Plugin
Post by: lolodomo on February 12, 2012, 03:15:53 pm
I have a question regarding update of variables in the advanced tab of the devices. I have discovered the problem with the devices of the weather plugin but the problem may be more general (not verified).
What I noticed is that, the variables in the advanced tab of the plugin's devices are not updated. To have updated values, I have to reopen a new dashboard. Would it be possible to update them at the same time the devices are updated with fresh values (humidity, temperature, ...) ?

I have discovered the variable "lastUpdate" that gives us the time of last request to Goggle weather. It is a number of seconds since first January 1970. The display of this date in the dashboard could be interesting to have an information how recent are the data.

The plugin seems to interrogate Google weather every 30 minutes. Do we know what is the frequence of refresh used by Google to update their data ?
Title: Re: Weather Plugin
Post by: guessed on February 12, 2012, 03:40:18 pm
I have a question regarding update of variables in the advanced tab of the devices. I have discovered the problem with the devices of the weather plugin but the problem may be more general (not verified).
What I noticed is that, the variables in the advanced tab of the plugin's devices are not updated. To have updated values, I have to reopen a new dashboard. Would it be possible to update them at the same time the devices are updated with fresh values (humidity, temperature, ...) ?
There's a few different things going on.  The first is that Vera caches some values displayed in the UI, and doesn't write them out (to avoid frequent writing to Flash RAM, which can burn it out), but keeps these values "in memory".

The other is that I don't think I've ever seen the [Dialog] UI of a component refresh as the underlying data changes - at least not without using Javascript as some of the dialog panes (for some plugins) do.

Bottom line: The data is updating, but the MiOS Dialog framework doesn't seem show these underlying updates.

Quote
I have discovered the variable "lastUpdate" that gives us the time of last request to Goggle weather. It is a number of seconds since first January 1970. The display of this date in the dashboard could be interesting to have an information how recent are the data.
With the generic MiOS Dashboard framework, there's no way to indicate "this is a date" and have it display it as such (including all Regional translations).

It's possible to do if the Dashboard page is written in Javascript, but I've avoided doing that so far.  If someone would like to contribute a fully and complete, UI4/5 compatible, MiOS Dialog page that fully implements this functionality, then it can be included into the codebase - once it's been reviewed etc, of course.  That does bring other problems with it, as there are issues with the custom Javascript panes...

Quote
The plugin seems to interrogate Google weather every 30 minutes. Do we know what is the frequence of refresh used by Google to update their data ?
The Google Weather feed/service isn't well documented.  I've not come across anything indicating a [generalized] frequency of update.  I suspect if you looked at the returned feed data, the detailed version of it would contain when it was captured from the source system... but I've never followed that over time to see what the pattern is... quite possible it's regional anyhow.
Title: Re: Weather Plugin
Post by: TimAlls on February 12, 2012, 04:43:26 pm
@Guessed,
I am using a stripped down Vera to do some development on a Modbus Plugin as you know. I removed my weather plugin, rebooted Vera several times and the UI4 still shows it running in the start up Lua (UI4 upper right notification).....logging shows nothing. Could there still be remnants of code running even when the plugin has been removed?
Thanks
Tim
Title: Re: Weather Plugin
Post by: guessed on February 12, 2012, 05:59:14 pm
Technically, removing the Device should remove the execution of code.  The Pluin files will still be there, but nothing should be using them.

No idea why it would behave otherwise.  You can remove the plugin files if you really want to force it :)
Title: Re: Weather Plugin
Post by: ocean_engineer on February 18, 2012, 09:59:15 pm
If JOD figured out the files to use wunderground, I would love to see them. 
I have been using the awesome google weather plugin for a few months on UI4, and using it to adjust my thermostat. Unfortunately I have been seeing several hour delays between when temps move over/under threshold and when the plugin recognizes it.   Not a show stopper with thermal constant of the house, but enough to make me nervous.  I have been considering bringing in a few sources, polling every 30 minutes,(wunderground couple of stations and google weather), then averaging (with dropping a source if significantly away from average) and using that result to try and get more accurate.

Thanks for all the hard work.
Title: Re: Weather Plugin
Post by: guessed on February 18, 2012, 11:31:35 pm
The plugin itself updates from the Google feed every 30minutes, but depending upon how frequently the underlying feed is there could be quite a delay.

If folks would find it useful, I can parameter use the polling interval, similar to how the ping sensor works, so it could be configured for more frequent polling... Obviously just lessens the gap between what the plugin reports and what google would report... Still relies on Google being accurate.   But some could then chart the (regional) discrepancies or whatever of the feed.
Title: Re: Weather Plugin
Post by: ocean_engineer on February 19, 2012, 09:08:27 am
I think more control over when polling occurs would be helpful.  Especially in troubleshooting where the delay's and discrepancies are coming from, because I have seen where a google weather search in IE reports a temp different from the plugin for a significant period of time.
Am I correct in assuming that if you made this change than a command like:

Code: [Select]
luup.call_action("urn:micasaverde-com:serviceId:HaDevice1","Poll",{}, WTHR_DEV)

would work to poll?  Then I could poll the plugin just before I make a decision to adjust the thermostat.   In the past, this hasn't worked for me  on the Weather device. 

As an aside... If you updated the plugin, would I be required to upgrade to UI5 or is there a little more forward/backward compatibility than that?

Thanks for all the hard work.
Title: Re: Weather Plugin
Post by: guessed on February 19, 2012, 11:56:04 am
I think more control over when polling occurs would be helpful.  Especially in troubleshooting where the delay's and discrepancies are coming from, because I have seen where a google weather search in IE reports a temp different from the plugin for a significant period of time.
Am I correct in assuming that if you made this change than a command like:

Code: [Select]
luup.call_action("urn:micasaverde-com:serviceId:HaDevice1","Poll",{}, WTHR_DEV)
Right, I'd make that change at the same time as adding an Interval configuration parameter (default 30m).   It's actually a separate change to implement Poll, but it's been on the books for a while now:
    http://code.mios.com/trac/mios_weather/ticket/5

Note that the above would become a request to Poll, not the actual Poll itself, since I'd set that to be async like the rest of the logic.  This is consistent with setting lights on (etc), where it's the request to turn them on and not a guarantee they're on when call_action returns.

Quote
As an aside... If you updated the plugin, would I be required to upgrade to UI5 or is there a little more forward/backward compatibility than that?
So far, I've kept the code functioning for both UI5 and UI4, using a single code-stream.  Once UI5 is stable*, I'll start a 6 month counter that I'll use to determine when to freeze/branch UI4 changes, and add stuff that's UI5 specific.  At that point, UI4 would only get minor bugfix changes, and no new functionality.


* I'll know it's stable when I stop seeing forum messages of people using Vera2 that upgrade, then downgrade shortly afterwards...  8)

Quote
Thanks for all the hard work.
You're welcome, it's a fun toy.
Title: Re: Weather Plugin
Post by: RichardTSchaefer on February 19, 2012, 12:27:07 pm
I LUV this plugin!
I have an event based on the the temperature > 36. This event seems to falsely trigger on a regular basis ... and not correlated with reboots. It has done this a few times today and the temperature has never been close to 36 in the last day. I am suffering network glitches ... do you reset on network failures or retain the last good values ?
Title: Re: Weather Plugin
Post by: guessed on February 19, 2012, 01:58:07 pm
I LUV this plugin!
I have an event based on the the temperature > 36. This event seems to falsely trigger on a regular basis ... and not correlated with reboots. It has done this a few times today and the temperature has never been close to 36 in the last day. I am suffering network glitches ... do you reset on network failures or retain the last good values ?
The Plugin only sets the values when it receives a valid HTTP Response status.  It does no further validation of the response content before "setting" the extracted values against the child devices (Temp, Humidity, etc, etc) so if something is amiss (or widely varying) in the datastream then it will get pushed into the fields.

If an error is gotten, it [silently] skips over that update and waits for the next scheduled event to occur (currently 30 minutes later).. where [hopefully] the communications error sorts itself out.

If Vera restarts, then the Plugin is restarted and the 30min intervals are all reset.

All weather data is unconditionally logged to LuaUPnP.log, via this line of code:
    http://code.mios.com/trac/mios_weather/browser/trunk/I_GoogleWeather.xml#L199

So you should be able to track-back via log lines like:
01   02/19/12 10:47:42.574   luup_log:29: GoogleWeather: At [6.860304,158.223724], it's currently 66(US) and Crazy Cloudy.  Humidity is 0%.  Low is 66 High is 67.  Condition is Crazy Cloudy, Wind Condition is N at 99 mph, Direction is N, Speed is 99 <0x402>

and see where it went amiss (assuming you still have enough of the log around, and it hasn't been rotated to MCV's servers...)

Title: Re: Weather Plugin
Post by: guessed on February 19, 2012, 06:58:11 pm
Posted version 1.47 of the Plugin at:
    http://code.mios.com/trac/mios_weather/browser/tags/1.47

(Instructions on the Wiki updated also to link to the new file).  This version supports both UI4 and UI5.  This version includes support for:

a) urn:micasaverde-com:serviceId:HaDevice1::Poll action on the Parent node to force a one-time, manual, pull of the weather feed data.
b) urn:upnp-micasaverde-com:serviceId:Weather1::SetPeriod on the Parent node, to alter the frequency at which updates are pulled.
c) UI mods to expose Weather1::Period as a user settable value (between 10 and 3600 seconds)
d) UI mods to show any existing "override" of the default Weather1::Period (1800s)
e) UI mods to show any existing "override" of the default Weather1::Location (from System settings)
f) Updates to it's wiki page on code.mios.com (UI4 Install instructions) to illustrate the new functionality)

The changes will be submitted to the UI5/apps.mios.com catalog shortly.


Thanks to everyone that provided the feedback upon which these changes are based. 

As usual, use at your own risk ;)
Title: Re: Weather Plugin
Post by: RichardTSchaefer on February 20, 2012, 03:54:21 pm
Some confusion on events.
With an event  temperature > 36

The event indicates it will fire when the temperature goes above the specified threshold.
It actually fires every time the temperature changes and is above the specified threshold.
Title: Re: Weather Plugin
Post by: guessed on February 20, 2012, 04:24:37 pm
Some confusion on events.
With an event  temperature > 36

The event indicates it will fire when the temperature goes above the specified threshold.
It actually fires every time the temperature changes and is above the specified threshold.
They're marked with the "norepeat": "1" flag in the corresponding JSON file, so as I understand it they shouldn't do that...

There have been instances in the past where it's reported, but it doesn't seem to go anywhere:
Title: Re: Weather Plugin
Post by: RichardTSchaefer on February 20, 2012, 05:39:27 pm
I will play around with it ... I wonder where it keeps the state of last evaluation.
I have two events in the same scene:
      Temperature > 36
      Temperature < 36
I wonder if that is causing the problem.
Title: Re: Weather Plugin
Post by: guessed on February 20, 2012, 05:45:54 pm
I wouldn't be surprised if they kept the same state bit/field per-device, instead of a per-device-scene state to keep track of this stuff... 

I will definitely follow your findings on this.
Title: Re: Weather Plugin
Post by: RichardTSchaefer on February 22, 2012, 07:26:47 am
Attached is a little less miopic look at what is happening.
Code: [Select]
01 02/22/12 3:16:04.532 luup_log:61: GoogleWeather: At [30.592600 ,-98.284798], it's currently 63(US) and Cloudy.  Humidity is 82%.  Low is 59 High is 79.  Condition is Cloudy, Wind Condition is SW at 9 mph, Direction is SW, Speed is 9 <0x402>
06 02/22/12 3:16:04.535 Device_Variable::m_szValue_set device: 63 service: urn:upnp-org:serviceId:TemperatureSensor1 variable: CurrentTemperature was: 64 now: 63 #hooks: 2 upnp: 0 v:0x9d0b20/NONE duplicate:0 <0x402>
07 02/22/12 3:16:04.536 Event::Evaluate 1 Warming scene Warming skipping repeat <0x402>
08 02/22/12 3:16:04.537 JobHandler_LuaUPnP::HandleActionRequest device: 78 service: urn:richardgreen:serviceId:VeraAlert1 action: SendAlert <0x402>
08 02/22/12 3:16:04.538 JobHandler_LuaUPnP::HandleActionRequest argument AlertTokens= <0x402>
08 02/22/12 3:16:04.539 JobHandler_LuaUPnP::HandleActionRequest argument AlertMessage={2}Freeze Event Over <0x402>
06 02/22/12 3:16:04.540 Device_Variable::m_szValue_set device: 78 service: urn:richardgreen:serviceId:VeraAlert1 variable: AlertMessage was: {2}Freeze Event Over now: {2}Freeze Event Over #hooks: 0 upnp: 0 v:0xa3ce38/NONE duplicate:1 <0x402>
06 02/22/12 3:16:04.541 Device_Variable::m_szValue_set device: 78 service: urn:richardgreen:serviceId:VeraAlert1 variable: AlertTokens was: mv8rax7fggjr now: mv8rax7fggjr #hooks: 0 upnp: 0 v:0xa3ce18/NONE duplicate:1 <0x402>
50 02/22/12 3:16:04.543 luup_log:78: VeraAlert  Sending http://vera-alert.appspot.com/stat?msg=AlertTone2Freeze%20Event%20Over&recipient=mv8rax7fggjr <0x402>
50 02/22/12 3:16:04.961 luup_log:78: VeraAlert Status: 200 OK
07 02/22/12 3:16:04.965 Event::Evaluate 7 Temperature Warming scene Vera Alerts Manager skipping repeat <0x402>
The non relevant stuff has been removed.

Note that right after it says
Quote
Event::Evaluate 1 Warming scene Warming skipping repeat
it runs my Event Luup code (VeraAlert notification).
Is this a bug or a design feature, that Event based Luup code gets a chance to run ?
Title: Re: Weather Plugin
Post by: weissertigerxl on March 08, 2012, 03:45:40 pm
Hi all,

want to automate something with weather plugin. And I am sure I saw the possible conditions and so on, which I can check reading out the varaibles.. but it is a pitty, so much infos and I don't find theses infos again!

Can anybody post me a link where I can find a list of this conditions and so on?

Wan to run a scene

a) when special conditions are reached
b) temperature of one device is...

Thanks
Title: Re: Weather Plugin
Post by: lolodomo on March 10, 2012, 06:38:35 am
Can anybody post me a link where I can find a list of this conditions and so on?

Here is an extract of the D_Weather.xml file:

Code: [Select]
"allowedValueList" : 
40                 {
41                     "Clear": "Clear",
42                     "Cloudy": "Cloudy",
43                     "Fog": "Fog",
44                     "Haze": "Haze",
45                     "Overcast": "Overcast",
46                     "Rain": "Rain",
47                     "Showers": "Showers",
48                     "Thunderstorm": "Thunderstorm",
49                     "Sunny": "Sunny",
50                     "Snow": "Snow",
51                     "Flurries": "Flurries",
52                     "Windy": "Windy"
53                 },
Title: Re: Weather Plugin
Post by: guessed on March 10, 2012, 09:51:04 am
http://code.mios.com/trac/mios_weather

Contains the list under installation/extras, and has a pointer to scene scripting example as well.
Title: Re: Weather Plugin
Post by: guessed on March 20, 2012, 01:55:35 am
I've been considering changing this Plugin to use HTTPS (SSL), instead of HTTP, to fetch the Weather data...  this being a step in providing an extra layer of sensitivity to the Private (Lat/Long) data that's being transmitted over the Internet.

Once this is done, UI5 users will auto-update.  Everyone else will be able to pickup the change when they next update.

I don't foresee any problems, but if anyone sees an issue with the proposed change, just let me know.
Title: Re: Weather Plugin
Post by: guessed on March 25, 2012, 04:51:02 pm
I've submitted tag 1.48 to MCV for apps.mios.com (UI5) approval.  This has the changes to move over to HTTPS for fetching content from Google's Weather feed.

It'll be automatically applied to those with UI5, once it's approved by the MCV Team.
Title: Re: Weather Plugin
Post by: lolodomo on March 25, 2012, 05:21:23 pm
It'll be automatically applied to those with UI5, once it's approved by the MCV Team.

How ? Plugins are now automatically updated ?
Title: Re: Weather Plugin
Post by: guessed on March 25, 2012, 05:23:13 pm
UI5 Plugin installed from apps.mios.com will automatically update once new versions are approved.  There's no "off switch" for this functionality, so we can't control it.

If it was manually installed, then it needs to be manually updated
Title: Re: Weather Plugin
Post by: lolodomo on March 25, 2012, 05:30:07 pm
UI5 Plugin installed from apps.mios.com will automatically update once new versions are approved.  There's no "off switch" for this functionality, so we can't control it.

I don't like that >:(
They should propose the update but not do it without any control.
Title: Re: Weather Plugin
Post by: guessed on March 25, 2012, 05:31:34 pm
Agreed, we've given them that feedback before... a few times now.
Title: Re: Weather Plugin
Post by: guessed on March 25, 2012, 05:42:08 pm
FYI: Here is @futzle's formal bug requesting it...
    http://bugs.micasaverde.com/print_bug_page.php?bug_id=2124
Title: Re: Weather Plugin
Post by: lolodomo on March 28, 2012, 12:29:19 pm
Hi guessed.

I see in your code (startup function) this part of code:

Code: [Select]
        --
320         -- Handle all potential values received for a boolean-type UPnP Variable, and
321         -- convert them to their "strongly recommended" values of "0" or "1".
322         --
323         local metric = luup.variable_get(WEATHER_SERVICE, "Metric", parentDevice)
324         if (metric == "0" or metric == "1") then
325             -- Do nothing, value is correct
326         elseif ((metric == "true") or (metric == "yes")) then
327             luup.variable_set(WEATHER_SERVICE, "Metric", "1", parentDevice)
328         elseif ((metric == nil) or (metric == "false") or (metric == "no")) then
329             luup.variable_set(WEATHER_SERVICE, "Metric", "0", parentDevice)
330         else 
331             -- For all other values, silently default to Metric, to make it idiot proof. 
332             luup.variable_set(WEATHER_SERVICE, "Metric", "1", parentDevice)
333             debug("Metric parameter silently converted to 1, oldValue=" .. metric)
334         end


Is it the proper way to manage all boolean variables ?
You do that in case of the variable is modified by another application than your plugin ?


Other question: you have managed through a device variable the choice of unit, including for the temperature. Why not taking into account the choice made by the user in the Vera settings for the temperature ? We can choose between Celcius and Fahrenheit.
How to access the selected unit with luup code ?

I am interesting in your choices because I have to implement more or less the same thing for the RFXtrx plugin.

Last question: mph (miles per hour) is the preferred unit to use in US/UK for wind speed ?
Title: Re: Weather Plugin
Post by: guessed on March 28, 2012, 12:42:10 pm
Is it the proper way to manage all boolean variables ?
You do that in case of the variable is modified by another application than your plugin ?
At one point in time I was using one style, and @Ap15e pointed out that UPnP uses another.  I wrote code that handled either for backwards compatibility as well as the UPnP spec indicating that both-styles should be accepted (as input).  Bug 2058 covers the MiOS part of this.

See the following change for details of before/after:
    http://code.mios.com/trac/mios_weather/changeset/35

Quote
Other question: you have managed through a device variable the choice of unit, including for the temperature. Why not taking into account the choice made by the user in the Vera settings for the temperature ? We can choose between Celcius and Fahrenheit.
How to access the selected unit with luup code ?
There's no API for getting it, so I do it this way.  I could read the JSON, but that would be a little over-the-top as a work-around  8)

Quote
Last question: mph (miles per hour) is the preferred unit to use in US/UK for wind speed ?
MPH for the US, presumably for the UK & Northern Ireland.  Republic of Ireland also uses it (I think they have both) and there are probably a few others.  I just rely upon the setting to compute it either way.
Title: Re: Weather Plugin
Post by: holt on April 12, 2012, 11:51:53 am
Hello guys,

I am new in here and just got my Vera Lite a week ago. I am trying to control a couple of central heating pumps (on/off) because the idle heat loss is rather high due to the distance from house to boiler. I stop them completely for app 3 hours at the time during the summer.

Wondering if it would be possible to use this plugin to make it a little more clever. I am thinking about using the temperature from Google Weather to trigger some more "pumps on" periods if below let us say 10 degress C. How do I do that ?

Title: Re: Weather Plugin
Post by: Ap15e on April 12, 2012, 01:42:00 pm
http://wiki.micasaverde.com/index.php/Luup_Scenes_Events#Walk-through_.231_--_At_12_noon.2C_turn_off_the_interior_lights_if_the_temperature_is_over_80_degrees should get you started.
Title: Re: Weather Plugin
Post by: holt on April 13, 2012, 06:16:46 am
It got me started but I am not there yet  :P

I understand in general terms the code :
Code: [Select]
  local lul_temp = luup.variable_get("urn:upnp-org:serviceId:TemperatureSensor1","CurrentTemperature", 3)
  if (tonumber(lul_temp) < 26.6) then
    return false
  end

Looking her : http://wiki.micasaverde.com/index.php/Luup_Variables#Weather_Plugin      I found that in order to get the outside temperature from the weather plugin I need this line :     

Code: [Select]
local outsideTemp = luup.variable_get("urn:upnp-org:serviceId:TemperatureSensor1", "CurrentTemperature", 5)
Then I thought okay let us also copy in line 2 to 4 :

Code: [Select]
if (tonumber(lul_temp) < 26.6) then
    return false
  end

The 4 lines of code the look like this as an example :

Code: [Select]
local outsideTemp = luup.variable_get("urn:upnp-org:serviceId:TemperatureSensor1", "CurrentTemperature", 5)
if (tonumber(lul_temp) < 26.6) then
    return false
  end

But when testing the code in "Test Luup code" I get a failure. If testing only line 1 it is okay but as soon I add the other 3 lines it fails. What am I doing wrong ?
Title: Re: Weather Plugin
Post by: oTi@ on April 13, 2012, 06:57:46 am
@holt,

Welcome!

The Code failed message (confusingly) also pops up when you return false (i.e. when the temperature was below the threshold when you tested this).

The following snippet returns either false or true. The commands in the scene to control devices are only run when true is returned by the code. (So you may actually want to swap true and false for your application)

Code: [Select]
local lul_temp = luup.variable_get("urn:upnp-org:serviceId:TemperatureSensor1","CurrentTemperature", 3)
if (tonumber(lul_temp) < 26.6) then
  return false
else
  return true
end
Title: Re: Weather Plugin
Post by: holt on April 13, 2012, 02:05:06 pm
Got it working now  :)

Thanks Ap15e and oTi@
Title: Re: Weather Plugin
Post by: amg0 on April 18, 2012, 05:57:13 pm
Hello
I am using veralite with 1.5.346 and just installed the GoogleWeather plugin from the App Catalog.
I do see 5 new devices now but it does not display any data in it.
My lua log file says:

01   04/18/12 23:43:51.714   luup_log:14: GoogleWeather: Google Weather #14 starting up with id  <0x2ba03680>
01   04/18/12 23:43:52.410   LuaInterface::CallFunction_Timer-5 function refreshCache failed [string "..."]:144: attempt to index field 'attrs' (a nil value) <0x2c403680>
02   04/18/12 23:43:56.724   luvd_get_info mg conn can't read /etc/cmh-ludl//toolbox.js or /etc/cmh-lu//toolbox.js from filename /toolbox.js pPtrFile (null) <0x2d803680>


any idea what could be the issue ? did I miss something during install ?
thank you
Title: Re: Weather Plugin
Post by: amg0 on April 18, 2012, 06:39:27 pm
replying to myself. I think I found something... it worked when I overrided the "location" in the plugin to be my town : "grenoble".  But my Vera is properly setup with its location properly filled and I understood the plugin was taking this as a default value if the user did not override with something else in the location field of the plug in in so I am not sure what the issue is/was.

I still get the issue in the log but maybe it is a different issue => [33;1mluvd_get_info mg conn can't read /etc/cmh-ludl//toolbox.js or /etc/cmh-lu//toolbox.js from filename /toolbox.js pPtrFile (null) <0x2d11d680>
Title: Re: Weather Plugin
Post by: guessed on April 22, 2012, 01:24:26 pm
replying to myself. I think I found something... it worked when I overrided the "location" in the plugin to be my town : "grenoble".  But my Vera is properly setup with its location properly filled and I understood the plugin was taking this as a default value if the user did not override with something else in the location field of the plug in in so I am not sure what the issue is/was.
Recently we've noticed that there are some Locations that just don't work with the Google feed, and you have to override [locally] with the name of the location.  Haven't found a pattern to these just yet, but for whatever reason some "location" settings don't have the right lat-long, or have odd values, which causes the call to Google Weather to return an error page (which I don't handle gracefully)

Quote
I still get the issue in the log but maybe it is a different issue => luvd_get_info mg conn can't read /etc/cmh-ludl//toolbox.js or /etc/cmh-lu//toolbox.js from filename /toolbox.js pPtrFile (null) <0x2d11d680>
That's something amiss with Vera itself.  I don't use js files in the Weather plugin.
Title: Re: Weather Plugin
Post by: Ap15e on April 22, 2012, 01:56:19 pm
IIRC, all geographic coordinates pointing to locations in France do not work - even from France (a patent issue?).
Title: Re: Weather Plugin
Post by: guessed on April 22, 2012, 02:41:04 pm
I've updated the Wiki install instructions to include a clause about users in France:
    http://code.mios.com/trac/mios_weather/wiki/Installation-UI4
Title: Re: Weather Plugin
Post by: agoodman82 on May 04, 2012, 09:45:11 am
Hi all,

I'm completely new to Vera and just got a Vera Lite. So far, the only z-wave device I have added to my z-wave network is a Trane thermostat, which works great.

Anyway, I installed the weather app, and scattered in various categories on my 'devices' section of my vera web portal (sensors, climate & others) I have the 5 embedded weather readouts from the weather app (current temp, low temp, high temp, humidity & current conditions). Is there a way to consolidate the 5 weather stats under one sub-category (I'd like them all under "climate"). Also, I am using the full version of the iVera app on my iPhone, which also isn't displaying all of the plugin's weather stats. Is there any way to modify the app stats to show up on the mobile iVera app? Thanks... I've got a lot of learning to do with this advanced system lol.
Title: Re: Weather Plugin
Post by: guessed on May 04, 2012, 09:52:13 am
In the Device dialog, under the Advanced Tab, you can manually change the Category_Num field to match the one you want, then it'll be put into a different bucket in the UI,
Title: Re: Weather Plugin
Post by: agoodman82 on May 06, 2012, 08:43:05 pm
Thanks guessed. I guess I'll pick up plenty of things as I go along. These forums are very helpful.
Title: Re: Weather Plugin
Post by: resq93 on May 17, 2012, 11:10:37 am
I have the following as a LUUP on a trigger for a scene that turns on the A/C

Quote
local t = os.date('*t')
local dayOfWeek = t.wday
away = luup.variable_get("urn:upnp-org:serviceId:VSwitch1","Status",19)
outside = luup.variable_get("urn:upnp-org:serviceId:TemperatureSensor1", "CurrentTemperature", 5)


if (away=="0") and (t.hour > 7) and (t.hour < 18) and (outside > 60) then

return true
else
return false
end


Right now my outside temp per the plugin is only 55 and yet this trigger turned the A/C on anyway - is something wrong with my code?


---Update---

I think i fixed it - the temp value needs to be in quotes -
Quote
and (outside > "60") then
Title: Re: Weather Plugin
Post by: capjay on May 17, 2012, 12:27:29 pm
I think i fixed it - the temp value needs to be in quotes - and (outside > "60") then

you are comparing a string to another, which is wrong (because, for example "100" < "60"), you should convert the value into an integer:

Code: [Select]
if (away=="0") and (t.hour > 7) and (t.hour < 18) and (tonumber(outside) > 60) then
...
Title: Re: Weather Plugin
Post by: resq93 on May 17, 2012, 12:37:25 pm
Thank you. I will make the changes.

m
Title: Re: Weather Plugin
Post by: HakanSoderbom on July 01, 2012, 07:32:25 pm
Struggling with getting the Weather Plugin to work and looking for any advice. I have it working on one installation (Vera Light, f/w 1.5.346) however on my second installation (also Vera Light, f/w 1.5.346) it wont configure. The installation that is working is local. The installation that is causing me grief is remote.

The z-wave units on the problematic installation are all Jasco light switches and wall receptacles with the exception of one EZmotion 3-in-1 sensor. Since that has a thermometer I figured there may be a conflict, but even after uninstalling it, Vera still throws the same error.

See the two images for the error messages. I have tried the proverbial "everything" however I am at a loss.

Any ideas what I should try?
Title: Re: Weather Plugin
Post by: mcvflorin on July 02, 2012, 06:00:34 am
@HakanSoderbom

What plugin version do you have? Have you selected a location in Setup >> Location >> Longitude/Latitude?
Title: Re: Weather Plugin
Post by: HakanSoderbom on July 14, 2012, 01:46:03 am
As seen in the screenshot, when I try to enter a value for metric/US or location I get a "device not ready" error.
Title: Re: Weather Plugin
Post by: Brientim on July 14, 2012, 03:55:53 am
As seen in the screenshot, when I try to enter a value for metric/US or location I get a "device not ready" error.

Try manually configuring in the Advanced Tab. After changes are made, click either Save or Reload in the top right of your browser.
device_file = D_Weather.xml
impl_file = I_GoogleWeather.xml

Metric = 1 for metric or 0 for US Units
Title: Re: Weather Plugin
Post by: HakanSoderbom on July 15, 2012, 09:21:23 pm
Thanks for the ideas!

The device_file = D_Weather.xml and impl_file = I_GoogleWeather.xml were already set after the installation. I managed to set the Metric and Location variables manually, but it doesn't solve the problem.

The first image shows that I was able to set the Location and Metric variables, but it also shows the Communication Failure response. What about that? Any clue?

The second image shows that the variables do not turn up on the main settings page after saving + refreshing. (but they do stay in the Advanced panel).

The third image shows my working Vera, confirming that Location and Metric are the same as the "broken" one.

Thoughts, ideas?
Title: Re: Weather Plugin
Post by: futzle on July 15, 2012, 09:30:59 pm
Struggling with getting the Weather Plugin to work and looking for any advice.

I can reproduce the "Device not ready" error by having a rogue space at the end of the Implementation file field (look carefully at the screenshot after the ".xml").

Vera is very very picky about white space, so make sure that you haven't accidentally done this while copy-and-pasting.
Title: Re: Weather Plugin
Post by: HakanSoderbom on July 15, 2012, 09:55:05 pm
I double checked and there are no white spaces. Note that those two variables were set up correctly during the automatic install. But I also double checked the Location and Metric variables (however the problem appears before I manually give them).

I have attached the error message that is visible on the devices page that says "Lua startup failure" . Maybe this gives some further clue...?

I didnt do anything manually to start with so it is a mystery why one installation fails on the Weather Plugin. Everything else works just fine on both installations.
Title: Re: Weather Plugin
Post by: Brientim on July 15, 2012, 09:57:46 pm
The first image shows that I was able to set the Location and Metric variables, but it also shows the Communication Failure response.
Try the fix that @futzle identies first. Hopefully, once you have chech this and rectified any issues found, you will be able to just click on Metric and save. This will restart.
The image displays Metric = 0 and thus US Units. This is an identifer used to conducted the conversions.

Title: Re: Weather Plugin
Post by: futzle on July 15, 2012, 10:05:17 pm
I have attached the error message that is visible on the devices page that says "Lua startup failure" . Maybe this gives some further clue...?

If you can get to the Luup log (/var/log/cmh/LuaUPnP.log) on the remote machine and catch the error message at startup then we'll be able to zoom in on it pretty quick.

I'm leaning towards the issue being one of your world location containing unexpected content and breaking the plugin at startup.  Thinking out loud here, does your location have a space or apostrophe or other non-alphabetic character in it?  (What have you set your city to, in the Vera setup?) (A question that mcvflorin already asked (http://forum.micasaverde.com/index.php/topic,1435.msg78233.html#msg78233) but you haven't answered.)
Title: Re: Weather Plugin
Post by: Brientim on July 15, 2012, 10:11:13 pm
Try this in sequential steps.
1. Uninstall
2. Ensure you location is set up through Setup > Location. Please change it to another location. Ensure you click save after changes are made.
3. Reinstall, when the World Weather dialogue box is diplayed, close it immediately by clicking on the black X. Do not enter any details.
4. Wait until your screen refreshes and displays the World Weather devices.

Screen capture what is displayed as per your last and the Advanced tab.

Googles API does have errors with certains location and this may be the case. If the above now dispalys correctly, try changing back to your original location and see what occurs.

Modified:
Follow @futzle instruction in the first instance.
Title: Re: Weather Plugin
Post by: Brientim on July 15, 2012, 10:22:45 pm
Can you confirm the Location set up as per the attachment? If it is, it should not need the location override in the device.

Also I just noticed you placed a what appears to be a zipcode in the Advanced Tab. If you haven't uninstalled already removed this and type in Redmond and click save.

Updated to include change from zipcode to name. I have tested this with the location set up, override location set to zipcode and set to name and all three returned the correct details...
Title: Re: Weather Plugin
Post by: HakanSoderbom on July 16, 2012, 12:59:10 am
YES! It works!

Many thanks to Futzle and Brentim for helping me fix it! And thanks for your patience!

In this case Brentim identified the problem correctly: I hadn't set the location in Setup -> Location. I was so caught up with the Weather Plugin that it never struck me that my basic installation wasn't complete.

After setting the unit's location (to USA, WA, Redmond, where I am) the plugin stopped throwing errors and after restarting it as Brentim suggested it started behaving correctly. I was then able to set the override to zip 85266 (Scottsdale, AZ where the property is) and it worked straight away.

I am happy again!
 ;D
Title: Re: Weather Plugin
Post by: Brientim on July 16, 2012, 01:03:56 am
It is a matter of stepping through one thing at a time and well done, you have solved your problem.
Enjoy the rest of your day.
Title: Re: Weather Plugin
Post by: dforster on August 02, 2012, 10:59:45 pm
Just installed on my Vera 3's, wonderful plugin, worked first time... Excellent job.

With the Google World Weather plugin, could something like the threat of severe weather be added? I use one of my units in a house in the Caribbean and the area occasionally gets a hurricane close by... I could then close storm shutters etc. on the house automatically in my absence.

Many many thanks. You make this wonderful little box so easy to use...

Dan
Title: Re: Weather Plugin
Post by: localuser on August 10, 2012, 03:03:05 pm
This a great plugin, I like it a lot. 

One suggestion that I made to the plugin was to make it scene aware.
In the json file I modified my version of it and made it "inScene": "1" and added an update button to the dashboard.

I then removed the luup.call_timer code from the refreshcache and the interval variable.

These changes gave me the ability to instead setup a Scheduled Scene that updates the weather, which shows up in my schedule.

I replaced the spot with the interval settings with the last updated date time instead.    With the authors permission I can either post the code and/or send it to the author to review.

Title: Re: Weather Plugin
Post by: guessed on August 13, 2012, 12:50:29 pm
@localuser,
I'm a bit busy for the next month or so, but go ahead and post the code and I can look to update it when I get cycles.

I'd recommend a few changes to what you've outlined, mostly to ensure compatibility for all the existing users:

a) Move to support a "period=0" for disabling the internal refresh interval.
This will avoid needing to remove the internal call_timer code, which the bulk of the existing users depend upon.  It'll still let you [effectively] disable the internal timers, and let you initiate manually as needed via the pre-existing Poll ACTION, as you've discovered.  I just need to add the [UI5 introduced] inScene attr so you can use it ;)

b) Last updated time.
The Last Updated timestamp is already present.  You'll see it's populating the HaDevice1:LastUpdate with a timestamp value when the Weather is fetched via the refreshCache block.  You shouldn't need to change anything to get this working.
Title: Re: Weather Plugin
Post by: localuser on August 13, 2012, 01:48:44 pm
@localuser,
I'm a bit busy for the next month or so, but go ahead and post the code and I can look to update it when I get cycles.

I'd recommend a few changes to what you've outlined, mostly to ensure compatibility for all the existing users:

a) Move to support a "period=0" for disabling the internal refresh interval.
This will avoid needing to remove the internal call_timer code, which the bulk of the existing users depend upon.  It'll still let you [effectively] disable the internal timers, and let you initiate manually as needed via the pre-existing Poll ACTION, as you've discovered.  I just need to add the [UI5 introduced] inScene attr so you can use it ;)

b) Last updated time.
The Last Updated timestamp is already present.  You'll see it's populating the HaDevice1:LastUpdate with a timestamp value when the Weather is fetched via the refreshCache block.  You shouldn't need to change anything to get this working.

Yes good suggesions.   I will make the change for part a.  For b, yes I am re-using that variable and just putting a human readible formatted time in that place.   

I found a great advantage for calling the poll from a scene this weekend.   I added it to my my water lawn scene, so now I can be guaranteed to have the most current weather before the sprinkers start.   Also, I can update my weather from my phone because all I need to do is trigger the update weather scene.

I still have my vera2 with UI4 (as I have not mailed it back in for my $150 rebate yet) and will test the plugin on that version to make sure no breaking changes.

I am currently working on windows 8 metro app for vera that I hope to be releasing this week in the windows 8 app store (when it opens) so I am hanging onto my vera2 for as long as I can to make sure the app is compatible with both system.
Title: Re: Weather Plugin
Post by: guessed on August 13, 2012, 10:53:10 pm
Dan,
You can create one or more Triggers, for a given Scene, that reference a pre-defined Weather condition.  The complete list of the ones we know about is listed on the wiki:
    http://code.mios.com/trac/mios_weather/wiki/Installation-UI4

this may not be the complete list, since the underlying feed (from Google) isn't well documented...


As always, use caution with this stuff since it's relying upon a Google feed that may not always reflect reality.


Just installed on my Vera 3's, wonderful plugin, worked first time... Excellent job.

With the Google World Weather plugin, could something like the threat of severe weather be added? I use one of my units in a house in the Caribbean and the area occasionally gets a hurricane close by... I could then close storm shutters etc. on the house automatically in my absence.

Many many thanks. You make this wonderful little box so easy to use...

Dan
Title: Re: Weather Plugin
Post by: swunderlich on August 16, 2012, 06:13:11 pm
OK - you guys are fantastic!!  :D

I had selected a time zone and lat and long, but apparently, it did NOT want the manual entry of the lat and long. It wanted me to go through the region/state/city and it came up with it's own lat and long. - now the scenes indicate they will execute at the proper times AND the google weather app now works - YEA!!

Thanks, thanks and more thanks!!
Title: Re: Weather Plugin
Post by: kbmcguire on August 27, 2012, 09:53:30 am
Anyone else having problems with the google weather plugin today? 

I noticed it stopped updating around 5am EST last night.  Even if I try the web link http://www.google.com/ig/api?weather=Miami,%20FL&hl=en , I get "Unsupported API" as a result where it used to give me the XML data.  Could this be Google finally abandoning this "unsupported" API?  Might be time to update the plugin for use with a different weather provider??  ???

Edit: Actually, not sure about the time but it was sometime overnight.

Update:
Now I'm getting this message when accessing the API via the web link: 
"We're sorry...
... but your computer or network may be sending automated queries. To protect our users, we can't process your request right now."

I remembered that I had changed the polling time in the plugin to 60 secs for testing yesterday and forgot to change it back.  They may have blacklisted me now.  :(
Title: Re: Weather Plugin
Post by: amg0 on August 27, 2012, 10:22:34 am
Same issue here in france, last update for me was 8/27th 8am Central European Time... :(
Title: Re: Weather Plugin
Post by: TheAce on August 27, 2012, 10:53:45 am
Same issue here in france, last update for me was 8/27th 8am Central European Time... :(

Same here at approx 3pm GMT 8/27/12 in Chicago, whereas querying google manually yields proper result

http://www.google.com/search?as_q=weather (http://www.google.com/search?as_q=weather)

(you must be logged into a google account for that to work)
Title: Re: Weather Plugin
Post by: parkerc on August 27, 2012, 03:35:10 pm
Hi, yes i noticed that it was not updating too, so i was just checking here to see if i was not alone, which it sadly seems I'm not :(

OK, does anyone have any ideas on what do I / we need to do to get it working again?
Title: Re: Weather Plugin
Post by: amg0 on August 27, 2012, 04:21:35 pm
It seems Google detected the regular and frequent requests made by the plugin to their XML API. Maybe the plugin could make use of a different provider (yahoo) and randomize a little bit the update requests frequencies... I am not a programmer so I could hardly suggest how to do this unfortunately but I d like really need this plug in to work, I was using it to decide to open my stores or not  :(
Title: Re: Weather Plugin
Post by: kbmcguire on August 27, 2012, 05:14:42 pm
I don't think it is isolated to Vera users only.  A quick google search of "google weather api" for the last 24 hours yields plenty of other users having problems too.  Even android users are complaining.  :-\

I've been hearing that google was going to discontinue the igoogle service which I believe is where this API originated out of.  Not to mention the API was never officially supported by google.  Maybe this is just part of the impending shutdown of igoogle?

In any case, I think it might be time to move on to a different provider.  If I recall correctly, I believe @JOD was working on tweaking this plugin to work with wunderground http://www.wunderground.com/weather/api/ .  I wonder if he ever got it to work??

Edit: Nevermind about wunderground, it seems they want to charge for using their api, as do most services it appears.  The only free options I found were Yahoo http://developer.yahoo.com/weather/ or World Weather Online http://www.worldweatheronline.com/free-weather.aspx .  Personally I like World Weather Online, it gives you weather at the neighborhood level which would be more useful when using the data for scenes, etc.  If I knew anything about coding I would jump right in on this but the best I can offer is to be a beta tester if someone else could take the ball on developing it.  Any takers out there?  ;D  MCV?

 
Title: Re: Weather Plugin
Post by: guessed on August 28, 2012, 01:07:44 am
The original version of this plugin used Yahoo! Weather for the feed, but it didn't do any form of geoCoding, so was hard to get "right" without a number of manual configuration steps (which were prohibitive to a larger set of users)

Looking around now, most of the remaining feed suppliers have either a key/registration requirement or no lat-long/geoCoding API.

If anyone has experience using a specific, public, free Weather API then feel free to chime in with the alternatives.  It should be an API, and not a weather web-page, since we'll need some service stability (stuff that screen scraping won't provide) and the service needs to work world-wide for the broadest usage.
Title: Re: Weather Plugin
Post by: kiwi on August 28, 2012, 05:20:21 am
I don't think it is isolated to Vera users only.  A quick google search of "google weather api" for the last 24 hours yields plenty of other users having problems too.  Even android users are complaining.  :-\
(...)

I can confirm that there is an issue I think with google API. I currently graph using MRTG what I get from Weather plugin and since yesterday 6am (CEST time, eg Paris France), plugin stop to update the weather (see my graph).

Maybe we should have a look in other opportunities, like for example local weather in France :
http://www.meteofrance.fr/FR/mameteo/prevVille.jsp?LIEUID=FR75015 (FR + Postalcode). Problem is to find open API stuff... :/
Title: Re: Weather Plugin
Post by: Brientim on August 28, 2012, 05:33:51 am
See the post below. Last month I received and email from them informing me they were closing down the service and to enrol in their new service and if I remember correct it came with a  monthly fee.

http://thenextweb.com/google/2012/08/28/did-google-just-quietly-kill-private-weather-api/
Title: Re: Weather Plugin
Post by: parkerc on August 28, 2012, 01:31:19 pm
On the plus side, Google's primary line is still in the search engines business so, a quick search and I found this..

http://blog.programmableweb.com/2012/01/11/12-json-weather-apis/

Not sure if this will help?
Title: Re: Weather Plugin
Post by: guessed on August 28, 2012, 01:54:50 pm
@parkerc,
I was looking for data from someone that had worked with a specific API, to narrow the list down somewhat based upon their practical/usage experience with it.

There's a ton out there, as any google search will show, but most (like this list) require a Key and/or are regional and/or don't support the variety of GeoCoded inputs to drive the process.

Worst case, I can always fold it back to Wunderground, since it's common, and have everyone go sign up for their own usage Key.  There are costs associated with non-Developer licenses,  along with certain usage constraints, so that's not necessarily the best option for people.
Title: Re: Weather Plugin
Post by: sjolshagen on August 29, 2012, 02:04:45 pm
I don't think it's unreasonable to require the user to provide our own API key(s) as long as the plugin UI provides a way of setting it.

Looking at http://www.worldweatheronline.com/free-weather-feed.aspx, I think I just found my preferred method of automating my outdoor de-icing cables for this winter...
Title: Re: Weather Plugin
Post by: kbmcguire on August 29, 2012, 02:19:33 pm
I don't think it's unreasonable to require the user to provide our own API key(s) as long as the plugin UI provides a way of setting it.

Looking at http://www.worldweatheronline.com/free-weather-feed.aspx, I think I just found my preferred method of automating my outdoor de-icing cables for this winter...

I agree, signing up for the api key is free and a one-time process.  I really like what I see on http://www.worldweatheronline.com/free-weather.aspx as well.  I'm thinking I could use the precipitation amounts to control how long to run my sprinklers.   ;D
Title: Re: Weather Plugin
Post by: guessed on August 29, 2012, 03:39:01 pm
ok, seems like it has a reasonable set of data (forecasts, wind speed etc).

Can I get a few people to register with it, and report back on how accurrate, and how "current" the data is from this service?

In particular, folks from France, Germany and Australia, since these have historically given problems that we've had to sort out - esp using the internal MiOS Lat-Long values for the query.
Title: Re: Weather Plugin
Post by: kbmcguire on August 29, 2012, 03:57:32 pm
ok, seems like it has a reasonable set of data (forecasts, wind speed etc).

Can I get a few people to register with it, and report back on how accurrate, and how "current" the data is from this service?

In particular, folks from France, Germany and Australia, since these have historically given problems that we've had to sort out - esp using the internal MiOS Lat-Long values for the query.

FYI, According to their usage policy http://www.worldweatheronline.com/free-weather-feed.aspx?menu=usage (http://www.worldweatheronline.com/free-weather-feed.aspx?menu=usage), the weather is only updated every 3-4 hours.   :-\  Google seemed more up to date than that...
Title: Re: Weather Plugin
Post by: martinkalis on August 31, 2012, 02:30:52 am
Hello guys,
I am trying make the google weather plugin work for some time, and still it is showing the same results (current temperature=22, ...) - it just won't update...

I was wondering if the problem is my location - Slovakia (Central Europe), overriden value of location field: 48588160,17859130.

Do you have any idea what the problem might be?

Martin
Title: Re: Weather Plugin
Post by: PurdueGuy on August 31, 2012, 02:43:53 am
Marin,

Google stopped providing the service.  The recent posts in this thread are brainstorming on what to do.

Stay tuned.
Title: Re: Weather Plugin
Post by: Brientim on August 31, 2012, 04:12:48 am
ok, seems like it has a reasonable set of data (forecasts, wind speed etc).

Can I get a few people to register with it, and report back on how accurrate, and how "current" the data is from this service?

In particular, folks from France, Germany and Australia, since these have historically given problems that we've had to sort out - esp using the internal MiOS Lat-Long values for the query.

@guessed,
I have used this before and can verify for Melbourne, Australia it is accurate and I suspect for "Major" cities here it would be the same. I just checked the feed against my weather station and it is very close or close enough not to be a concern...   
Title: Re: Weather Plugin
Post by: amg0 on August 31, 2012, 07:24:00 am
@guessed

I registered and asked for town Meylan in france which is rather small. it found it.

REQUEST
http://free.worldweatheronline.com/feed/weather.ashx?q=Meylan,france&format=xml&num_of_days=2&key=xxxxxxx ( you have to put your own key here)

RESPONSE
result looks pretty good to me but I am not sure in what timezone the observation time value is. if it is local time then the observation is about 3 hours behind.

in XML it gave  :
    <data>
        <request>
            <type>City</type>
            <query>Meylan, France</query>
        </request>
        <current_condition>
            <observation_time>10:46 AM</observation_time>
            <temp_C>12</temp_C>
            <temp_F>54</temp_F>
            <weatherCode>353</weatherCode>
            <weatherIconUrl>
                <![CDATA[http://www.worldweatheronline.com/images/wsymbols01_png_64/wsymbol_0009_light_rain_showers.png]]>
            </weatherIconUrl>
            <weatherDesc>
                <![CDATA[Light rain shower]]>
            </weatherDesc>
            <windspeedMiles>8</windspeedMiles>
            <windspeedKmph>13</windspeedKmph>
            <winddirDegree>337</winddirDegree>
            <winddir16Point>NNW</winddir16Point>
            <precipMM>1.5</precipMM>
            <humidity>91</humidity>
            <visibility>10</visibility>
            <pressure>1018</pressure>
            <cloudcover>80</cloudcover>
        </current_condition>
        <weather>
            <date>2012-08-31</date>
            <tempMaxC>12</tempMaxC>
            <tempMaxF>54</tempMaxF>
            <tempMinC>6</tempMinC>
            <tempMinF>42</tempMinF>
            <windspeedMiles>9</windspeedMiles>
            <windspeedKmph>15</windspeedKmph>
            <winddirection>NNW</winddirection>
            <winddir16Point>NNW</winddir16Point>
            <winddirDegree>337</winddirDegree>
            <weatherCode>353</weatherCode>
            <weatherIconUrl>
                <![CDATA[http://www.worldweatheronline.com/images/wsymbols01_png_64/wsymbol_0009_light_rain_showers.png]]>
            </weatherIconUrl>
            <weatherDesc>
                <![CDATA[Light rain shower]]>
            </weatherDesc>
            <precipMM>9.2</precipMM>
        </weather>
        <weather>
            <date>2012-09-01</date>
            <tempMaxC>11</tempMaxC>
            <tempMaxF>52</tempMaxF>
            <tempMinC>2</tempMinC>
            <tempMinF>35</tempMinF>
            <windspeedMiles>9</windspeedMiles>
            <windspeedKmph>14</windspeedKmph>
            <winddirection>NNW</winddirection>
            <winddir16Point>NNW</winddir16Point>
            <winddirDegree>340</winddirDegree>
            <weatherCode>266</weatherCode>
            <weatherIconUrl>
                <![CDATA[http://www.worldweatheronline.com/images/wsymbols01_png_64/wsymbol_0017_cloudy_with_light_rain.png]]>
            </weatherIconUrl>
            <weatherDesc>
                <![CDATA[Light drizzle]]>
            </weatherDesc>
            <precipMM>6.6</precipMM>
        </weather>
    </data>
Title: Re: Weather Plugin
Post by: guessed on August 31, 2012, 11:49:02 am
I have a prototype of it using Wunderground.com (http://wunderground.com), which also requires a key.  I may end up writing two implementations, the other using worldweatheronline.com (http://worldweatheronline.com), but we'll see.

On the positive side, they have a LOT more values that can be extracted from the feed so it shows a lot of promise there for more advanced scene scripting in the longer term.

Unfortunately the "values" of some of the fields will change as a result of this cutover, so Scenes scripted against the Google implementation one may need to change (unless I can normalize against the previous weather states like "Cloudy" etc).  I'll also need to tweak the Dashboard component somewhat to ensure that it provides "credit" to WUI, or whoever the provider is.
Title: Re: Weather Plugin
Post by: Brientim on August 31, 2012, 12:08:57 pm
@guessed, Wunderground does have every single Australian weather station. This I know is extremely accurate.
Title: Re: Weather Plugin
Post by: amg0 on August 31, 2012, 12:18:59 pm
looks great api too. looking forward to it :)
Title: Re: Weather Plugin
Post by: kiwi on August 31, 2012, 02:06:06 pm
Very strange, seems that meteo stuff is coming back.

When looking around my graph, I just saw that meteo from Google seems to be live again.

Can someone else confirm this ?
Title: Re: Weather Plugin
Post by: lolodomo on August 31, 2012, 02:13:18 pm
Very strange, seems that meteo stuff is coming back.

When looking around my graph, I just saw that meteo from Google seems to be live again.

Can someone else confirm this ?

I just checked and value displayed by the plugin looks good.

PS: I did not really realize it was so cold this evening. Only 15°C !
Title: Re: Weather Plugin
Post by: PurdueGuy on September 01, 2012, 04:04:51 am
Mine is still old.   The "LastUpdate" is set to 1346048164, which is "Mon, 27 Aug 2012 06:16:04 GMT"
I have restarted LUUP a number of times today, as I was modifying things.  No change.

When I query manually, I get:
"We're sorry...
... but your computer or network may be sending automated queries. To protect our users, we can't process your request right now."


EDIT: Did I speak too soon?   It looks like temps updated, maybe humidity, but not wind/direction/condition?   Or am I seing things?
Title: Re: Weather Plugin
Post by: kiwi on September 01, 2012, 04:50:45 am
Very strange, seems that meteo stuff is coming back.

When looking around my graph, I just saw that meteo from Google seems to be live again.

Can someone else confirm this ?

I just checked and value displayed by the plugin looks good.

PS: I did not really realize it was so cold this evening. Only 15°C !
Hum... Seems we had a false alarm. The values was good when I post yesterday, but it seems that they are now "on hold", so maybe someone @google just made something that made the API open again, and closed them.

:/
Title: Re: Weather Plugin
Post by: lolodomo on September 01, 2012, 05:21:30 am
I just checked the LastUpdate variable which has value 1346044910 corresponding to 27th of August 07:21:50
So my preivous message yesterday was wrong. This was just a coincidence if the current temperature value was good.
Title: Re: Weather Plugin
Post by: parkerc on September 01, 2012, 06:31:37 am
I just checked the LastUpdate variable which has value 1346044910 corresponding to 27th of August 07:21:50

Hi @lolodomo, how do you convert that number to a date time?
Title: Weather Plugin
Post by: Brientim on September 01, 2012, 06:42:19 am
You can use http://www.epochconverter.com/ to convert time.
Title: Re: Weather Plugin
Post by: lolodomo on September 01, 2012, 07:18:38 am
You can use http://www.epochconverter.com/ to convert time.

Good to know.

On my side, I developped a very small Java program (POC) to get the value of device variables and I used it to convert the value of the Weather plguin device in a natural date format.
Something like that assuming the variable value is in str:

Code: [Select]
long seconds = Long.parseLong(str);
GregorianCalendar date = new GregorianCalendar();
date.setTimeInMillis(seconds*1000);
DateFormat dateFormat = new SimpleDateFormat("dd/MM/yyyy HH:mm:ss");
System.out.println("Last update: " + seconds + " - " + dateFormat.format(date.getTime()));
Title: Re: Weather Plugin
Post by: amg0 on September 01, 2012, 10:48:51 am
Google api is still dead for me. For converting time stamp I use various online web pages (search for "unix time stamp" in google) , or in LUA os.date("%c",times tamp) gives a reasonable human readable string.
Title: Re: Weather Plugin
Post by: guessed on September 01, 2012, 01:53:44 pm
I have a prototype version running against wunderground.com's (WUI) service.  It requires folks to register for a Key through that service, and accept their ToS agreement prior to use.

Still working out the kinks, and will let it run for a day or two before pushing the code to code.mios.com for advanced users to test. 

Once we've collectively gotten some mileage on it I'll replace the impl on apps.mios.com.  There's a ways to go to get the documentation updated also...

Setup-wise, it's nearly identical to the Google Weather, it uses all the same files except it has a different Implementation file (I_WUIWeather.xml), and has a few tweaks to let users enter the registration Key they get back from WUI.

On a Vera2 unit, it takes 0.8sec to post-process the data feed from WUI, which is a little heavy.  I've tweaked it a bit to get it down to that level, but it will require a completely different parser to do it more efficiently.  This probably isn't worth writing.

Attached is a sample of it's output.  I still also need to get an enumeration of the Weather states so that people can scene against them.  They're a little different from the ones that Google was using.

01   09/01/12 10:30:29.282   luup_log:313: WUIWeather: Requested [xx.xx3400 ,-1yy.yy1999], got [xx.xx5000 ,-1yy.yy0000]], it's currently 59.0 and Overcast.  Humidity is 75%.  Low is 52 High is 77.  Condition is Overcast, Wind Condition is Calm, Direction is SE, Speed is 0.0 <0x402>

Title: Re: Weather Plugin
Post by: guessed on September 03, 2012, 06:25:24 pm
Ok, I've built a basic implementation, for Weather Underground, and pushed a developer copy over to code.mios.com, tag 1.50.

At this time it's intended for Advanced users only so we can get any kinks out.  It hasn't undergone much testing mileage at this time, so will likely have a few problems.  I've left out detailed instructions on the specifics on how to install this right now so-as to focus the userbase to more advanced users.

Once it's working correctly, and has had other eyes over it, I'll push it to apps.mios.com as a new Plugin (to trigger folks to re-install/configure).  I'll then obsolete the Google Weather Plugin

There are 4 files, like before, but I've replaced I_GoogleWeather.xml with I_WUIWeather.xml, to handle the feed from Weather Underground.

The default implementation has been swapped over so you should only need to specify "D_Weather.xml" when creating the device via the standard/manual UI's.  I've tried it under both UI4 and UI5, and have done rudimentary upgrades to the Wiki doc.

Each person will need to register separately with Weather Underground (http://wunderground.com) to get their keys.  The UI will remind you of this when it starts up (it'll nag you until you give it keys)

A few quick notes:
a) I have not transcribed the Scene-awareness values to their WUI counterparts (yet)
So it probably won't work correctly in scenes, unless the values there "happen" to match the Google ones.

b) Location override formats have changed to use WUI's format.
Things like "US/CA/San_Francisco" work, as do ZIP codes.  See WUI's documentation to better understand what these look like for your region (you can see their doc once you register for an account)

c) I now expose ProviderURL, ProviderName and ProviderKey as variables for control point authors.
These are also displayed in the Dialog for the Weather device, but can be used by Control Point authors who want to do something better, at the Provider level.
Once we're out of the woods, in providing functional compatibility, I'll look to expose a few more URL's in the feed result itself to let CP authors "link" to the in-context weather page (for example)



Focus right now is on providing compatibility with the previous Google Weather Plugin.  Once it's stable, has functional parity, and published to apps.mios.com then we can look at absorbing some of the other functionality that's exposed (forecasts, URLs, etc)
Title: Re: Weather Plugin
Post by: guessed on September 03, 2012, 08:05:58 pm
Folks,
In the background @Ap15e did some analysis on the raw feeds from the two services, and compared them to his weather monitoring station (Europe) to see how close the feeds were...

Here are graphs of his data collection activities:

https://docs.google.com/open?id=0Bz4omZm4gYcsVTRDbmNCdVdUbGs
https://docs.google.com/open?id=0Bz4omZm4gYcsbTdVdE5KbGoza2s
https://docs.google.com/open?id=0Bz4omZm4gYcsa3VhNjN6QmFMWUU
https://docs.google.com/open?id=0Bz4omZm4gYcsYUVpRUF6MWtOZW8

Temperature peaks in sensor data are caused by exposure to sunlight.
Title: Re: Weather Plugin
Post by: futzle on September 03, 2012, 09:55:31 pm
guessed,

A couple of minor problems with the XML-matching pattern caused 1.50 to not work for me.  The fix:

Code: [Select]
34,35c34,35
<         &lt;high>&lt;fahrenheit>(%d.+)&lt;/fahrenheit>&lt;celsius>(%d.+)&lt;/celsius>&lt;/high>
<         &lt;low>&lt;fahrenheit>(%d.+)&lt;/fahrenheit>&lt;celsius>(%d.+)&lt;/celsius>&lt;/low>.*
---
>         &lt;high>&lt;fahrenheit>(%d.*)&lt;/fahrenheit>&lt;celsius>(%d.*)&lt;/celsius>&lt;/high>
>         &lt;low>&lt;fahrenheit>(%d.*)&lt;/fahrenheit>&lt;celsius>(%d.*)&lt;/celsius>&lt;/low>.*

"%d.+" won't match against single-digit temperatures.  I bet where you are it's too warm to be getting any in the forecast.

Actually I think that plenty of use of ".-" rather than ".*" in the pattern might result in better processing time, on account of the backtracking nature of regular expressions.

Also: none of these patterns will match negative temperatures.  But that was probably true of the old Google Weather matcher too, so I'll file that as a Feature Request.

I'll let you know how I fare with this patched version.
Title: Re: Weather Plugin
Post by: guessed on September 03, 2012, 10:57:25 pm
Thanks for finding that.  I'll loosen up the pattern matches across the board, as I really don't need them that tight.  Hopefully that'll help with the -ve numbers also.
Title: Re: Weather Plugin
Post by: guessed on September 03, 2012, 11:18:47 pm
Pushed these changes are 1.51, basically I just relaxed the patterns (presumably the feed is using valid numbers all the time).  I also included the changes for shortest-match patterns instead of longest-match, and perf definitely seems better.
Title: Re: Weather Plugin
Post by: futzle on September 03, 2012, 11:35:18 pm
1.51 is working well.  I've tried: no override on location, letting the plugin use my MiOS-configured location; overriding the location with pws:XXXXXXXX to get the stats from my personal weather station.  (Hooray, now I can feed my backyard weather to Vera, via the other side of the world.)
Title: Re: Weather Plugin
Post by: guessed on September 03, 2012, 11:44:27 pm
LOL, never thought of that.  I always forget about WUI's origins. :)
Title: Re: Weather Plugin
Post by: garrettwp on September 04, 2012, 12:10:04 am
Loaded up the new files and everything seems to be working well. I may need some minor tweaking in my app. But all seems well so far. Will have to see how things work out the next few days. I'll have to load my father's location in to see if his weather station shows up. I know for a fact he will like having his weather station show up in his vera.

- Garrett
Title: Re: Weather Plugin
Post by: sailhome on September 04, 2012, 01:46:44 am
Thanks guessed,

The weather underground 1.51 is working for me with vera2 UI5. I think it is more accurate than google wx was. Thank you for your work on this.

Herb
Title: Re: Weather Plugin
Post by: kiwi on September 04, 2012, 12:13:35 pm
Thanks guessed,

The weather underground 1.51 is working for me with vera2 UI5. I think it is more accurate than google wx was. Thank you for your work on this.

Herb

Just stupid question where can I found version 1.51 ? It doesn't seems to be on apps.mios.com :/
Title: Re: Weather Plugin
Post by: guessed on September 04, 2012, 12:46:17 pm
Quote from: guessed
At this time it's intended for Advanced users only so we can get any kinks out.  It hasn't undergone much testing mileage at this time, so will likely have a few problems.  I've left out detailed instructions on the specifics on how to install this right now so-as to focus the userbase to more advanced users.

It'll be put on apps.mios.com for general consumption once it's proven out, it's not ready for wider distro...
Title: Re: Weather Plugin
Post by: amg0 on September 04, 2012, 01:08:21 pm
just intalled. I tried location override with "Meylan, France" and my setting is on Metrics.
in the UI dashboard, I get temperature reported in Farenheit ,( 68 in dashboard )   but wind speed reported in km/h (3.2 )

the XML I get from calling the url manually is:

<temp_f>68</temp_f>
<temp_c>20.0</temp_c>
<relative_humidity>87%</relative_humidity>
<wind_string>From the NNE at 2 MPH Gusting to 2.0 MPH</wind_string>
<wind_dir>NNE</wind_dir>
<wind_degrees>22</wind_degrees>
<wind_mph>2</wind_mph>
<wind_gust_mph>2.0</wind_gust_mph>
<wind_kph>3.2</wind_kph>
Title: Re: Weather Plugin
Post by: guessed on September 04, 2012, 01:12:34 pm
oops, I need to swap lines 199 & 204 of I_WUIWeather.xml
Title: Re: Weather Plugin
Post by: amg0 on September 04, 2012, 01:37:17 pm
thx , will be cool;  I ll continue to play with it.

I noticed something. I use veramobile on iPhone and I can see the temperature devices as sensors. however it seems I cannot see the parent device to get the wind information. is there a standard device type for wind sensors that could be used ?

second question, I am rather newbie at vera & plugin and I wonder if there is way to have bigger dashboard tiles to see more info, would be interested in getting barometer pressure & dew points for instance.

The precipitation information ( in the xml ) could be valuable information to have to drive garden watering controllers...

sorry to feed you with so many requests :)

<precip_1hr_string>0.00 in ( 0 mm)</precip_1hr_string>
<precip_1hr_in>0.00</precip_1hr_in>
<precip_1hr_metric>0</precip_1hr_metric>
<precip_today_string>0.00 in (0 mm)</precip_today_string>
<precip_today_in>0.00</precip_today_in>
<precip_today_metric>0</precip_today_metric>
Title: Re: Weather Plugin
Post by: futzle on September 04, 2012, 05:49:04 pm
It might be time for us to start standardizing on services for Wind and Rain (and Fire*), like we already have for Temperature and Humidity.

* They call the wind "Maria".
Title: Re: Weather Plugin
Post by: resq93 on September 04, 2012, 05:52:02 pm
Once it's working correctly, and has had other eyes over it, I'll push it to apps.mios.com as a new Plugin (to trigger folks to re-install/configure).  I'll then obsolete the Google Weather Plugin

Will this change the sensor device ID as well ? I have this sensor in a few luup codes, will need to change?

m
Title: Re: Weather Plugin
Post by: futzle on September 04, 2012, 05:55:55 pm
Will this change the sensor device ID as well ?

Yeah, it will.
Title: Re: Weather Plugin
Post by: guessed on September 04, 2012, 06:09:54 pm
It would, but I've been rethinking that position....  apps.mios.com puts in restrictive file naming, so I cannot create a new plugin with [largely] the same files as the old.  As a result, I may just sub-out the implementation under the existing Plugin in the store...

... and likely freak out a few people when they get the nag UI that I've put into the new implementation.

Will this change the sensor device ID as well ?

Yeah, it will.
Title: Re: Weather Plugin
Post by: resq93 on September 05, 2012, 03:38:31 pm
Any idea when this will go live?
Title: Re: Weather Plugin
Post by: guessed on September 05, 2012, 04:09:21 pm
...when it's had sufficient feedback, and "eyes on" the code.  This is not a time-bounded criteria, as it's worked on the side as time permits  8)
Title: Re: Weather Plugin
Post by: resq93 on September 05, 2012, 04:34:34 pm
...when it's had sufficient feedback, and "eyes on" the code.  This is not a time-bounded criteria, as it's worked on the side as time permits  8)

Understood and thanks for your hard work.

M
Title: Re: Weather Plugin
Post by: kbmcguire on September 05, 2012, 08:04:58 pm
Great work @guessed!  Everything appears to be working fine for me.  I'm overriding the location with a local airport code in my area and it seems pretty accurate so far.  Will let you know if I have any issues.  Looking forward to accessing the "precip" data as well if at all possible, once the basic implementation is proven of course.
Title: Re: Weather Plugin
Post by: kiwi on September 06, 2012, 02:52:05 am
Great work @guessed, I tryed it on my own (I had to look around to find the files :p:p), work perfectly, maybe better than google before on my own (Chatou in France).

Maybe one hint is to make polling per default 120 seconds to avoid reach the 500 poll on WUI developper API, what do you think of that ?

Regards,
Xavier
Title: Re: Weather Plugin
Post by: garrettwp on September 06, 2012, 04:54:44 am
Great work @guessed, I tryed it on my own (I had to look around to find the files :p:p), work perfectly, maybe better than google before on my own (Chatou in France).

Maybe one hint is to make polling per default 120 seconds to avoid reach the 500 poll on WUI developper API, what do you think of that ?

Regards,
Xavier

The default poll is set to 1800 seconds (30 minutes).

- Garrett
Title: Re: Weather Plugin
Post by: kiwi on September 06, 2012, 08:39:40 am
(...)
The default poll is set to 1800 seconds (30 minutes).

Yes I saw that on the sources, but when "upgrading" from google weather to WUI Weather, the default was on 60 (I don't remember if I did ask the previous plugin to lower than 1800 sec), but it should, if possible, reset to it's default value...

WUI send me a mail I got thru limit, so I changed it to 300 sec, which is good for having nice data :)
Title: Re: Weather Plugin
Post by: guessed on September 07, 2012, 12:13:15 pm
Ok, so I've addressed the major defects that I've heard so far. 

The one outstanding item I need to tackle is Scene-awareness.  Given that the Scene "values" have probably changed from those previously established by Google, it's likely that some [existing] Scenes will break and/or not fire. 

I plan on adding the extra values this weekend, and I'll leave the original ones in place but annotate their labels with "Obsolete" where possible to make it more apparent that something needs to change.

Folks that scripted (Lua) their scenes may need to rework them.

Anyhow, I should be able to knock this out over the weekend sometime and push a semi-final new version.  All things going well, I'll push to the UI5 Store by Monday, and make the links more generally published for the UI4 userbase.


PS: I don't plan to tweak any frequency/refresh settings on upgrade.  If you've set them crazy low, then they'll be crazy low after upgrade, and you'll get a warning email (actually, up to 3) from WUI before they cut the service.  The setting is displayed in the UI, if it's been overridden from the default (30 minutes) so folks should check that if they've tweaked it...

PPS: The code could be cleaner, but it'll do for now 8)
Title: Re: Weather Plugin
Post by: lolodomo on September 07, 2012, 01:53:57 pm
Stupid question, sorry: where is the update ? In code.mios.com ?
Title: Re: Weather Plugin
Post by: garrettwp on September 07, 2012, 02:43:17 pm
Yes.

- Garrett
Title: Re: Weather Plugin
Post by: lolodomo on September 07, 2012, 03:51:36 pm
I just registered on wunderground.com but where can I find my provider key ?
Title: Re: Weather Plugin
Post by: kiwi on September 07, 2012, 03:55:16 pm
I just registered on wunderground.com but where can I find my provider key ?
You have to find "Weather API for developers" at bottom of the page :)

Title: Re: Weather Plugin
Post by: lolodomo on September 07, 2012, 04:31:23 pm
Ok, it is working well 8)
I tried to override location too, that looks good.
Remains to check if values are evolving every 30 minutes.


When I enter several cities near mine, it looks like the meteo station displayed at top left is always from the same city.
Does this website rely on official meteo stations or is it a database of personal meteo stations provided by you and me ?
Title: Re: Weather Plugin
Post by: lolodomo on September 07, 2012, 04:37:51 pm
It might be time for us to start standardizing on services for Wind and Rain (and Fire*), like we already have for Temperature and Humidity.

* They call the wind "Maria".

That would be a good idea.

Rain data is provided by wunderground, that would be useful to get this information.
Title: Re: Weather Plugin
Post by: guessed on September 07, 2012, 05:13:06 pm
As far as I can tell, it's a mix of official stations as well as personal ones.  Thumbing through the [geo] API's I believe there are ways to get it to filter the lists.  You can also use different naming syntax to be very specific about the station you want to use.

@futzle made an off-handed comment about that the other day  8)

Ok, it is working well 8)
I tried to override location too, that looks good.
Remains to check if values are evolving every 30 minutes.


When I enter several cities near mine, it looks like the meteo station displayed at top left is always from the same city.
Does this website rely on official meteo stations or is it a database of personal meteo stations provided by you and me ?
Title: Re: Weather Plugin
Post by: lolodomo on September 07, 2012, 06:02:07 pm
Quote
International Current Conditions

International current conditions are collected directly from more than 29,000 weather stations located in countries around the globe including:

•About 6,000 automated weather stations operating at airports. Here is a list of the stations. Typically these stations are owned by government agencies and international airports and data is updated at 1, 3, or 6 hour intervals, depending upon the station.
•Over 8,000 Personal Weather Stations (PWS's) and 16,000 MADIS stations.

http://www.wunderground.com/about/data.asp
Title: Re: Weather Plugin
Post by: Minnies on September 11, 2012, 01:25:39 pm
Any news for the weather plugin for weather underground? 
Title: Re: Weather Plugin
Post by: guessed on September 11, 2012, 01:30:10 pm
Any news for the weather plugin for weather underground?

Not yet, my main machine was trashed over the weekend, so I'm slowly restoring it before I can do any real work.
Title: Re: Weather Plugin
Post by: garrettwp on September 12, 2012, 01:32:17 am
Guessed,

Are you going to use these weather conditions in the code:

http://www.wunderground.com/weather/api/d/docs?d=resources/phrase-glossary#current_condition_phrases

I am going to convert over the code in AutHomation to comply with the weather underground conditions so that the icons in the app match the proper conditions.

- Garrett
Title: Re: Weather Plugin
Post by: futzle on September 12, 2012, 02:08:35 am
Likewise I'll have to put the same list into the Combination Switch (it's not easy to pull it from the service file).
Title: Re: Weather Plugin
Post by: guessed on September 13, 2012, 12:54:27 am
My current thinking is that the "full" list is somewhat unwieldy/low level.  There's some sort of internal grouping that's done on Current Conditions ("weather") to make it into the Icon that's displayed (and exposed via "icon")

The domain-set for "icon" is a lot smaller, so my thinking was:

a) expose "weather" as the existing MiOS Variable "Condition" (as is done today)
b) move to using a TextField for Scene entry against this value (to handle the VERY large list)
c) expose "icon" as a new MiOS Variable "ConditionGroup" (name?)
d) define a new Scene option against this new Variable, using the restricted domain outlined (http://www.wunderground.com/weather/api/d/docs?d=resources/phrase-glossary#forecast_description_phrases)

Anyhow, haven't done this yet as the machine is still being fixed up, but would definitely appreciate feedback/comments on the above model.  I'm looking not to present the user with an enormous list "up front".  I suppose I could still do that, but anyhow let me know your prefs.
Title: Re: Weather Plugin
Post by: guessed on September 13, 2012, 12:57:04 am
... the other reason for the above logic/proposal is that "weather" gets a translatable string.  If I enable that functionality, and I'd like to, then it's domain-set is per-language.  Having a free-form text field allows people to enter these in their native language, when I get around to allowing display of that.

The "icon", on the other hand, doesn't undergo any translation, so a drop-down would survive UI translation.
Title: Re: Weather Plugin
Post by: garrettwp on September 13, 2012, 12:59:36 am
My only concern is that when translating the weather condition to the appropriate icon, I am going to run into an issue with other languages. My app is english only for the time being.

- Garrett
Title: Re: Weather Plugin
Post by: guessed on September 13, 2012, 01:06:32 am
Actually that's why I'm leaning towards this scheme.  In the case of control points, they'd use the new "ConditionGroup" stateVariable, which isn't translatable, instead of the [existing] Condition stuff ... which is.  I always wanted to add translated state strings in the past, but didn't have a good way to do it.  Control points that wanted "text" to go with their icons could get the translated text from the Condition variable

The ConditionGroup would be non-translated domain values like:
    clear, cloudy, flurries, fog, mostlycloudy, partlysunny, sleet, rain, tstorms, unknown, etc

anyhow, nothing is set in stone at this point.

My only concern is that when translating the weather condition to the appropriate icon, I am going to run into an issue with other languages. My app is english only for the time being.

- Garrett
Title: Re: Weather Plugin
Post by: garrettwp on September 13, 2012, 01:15:38 am
Ahh got it. Did not have my coffee yet. Mind is starting to wake up. Sounds good to me. How do you want to go about adding this? I need to look at the weather underground data to see what is included. Wouldn't it require additional coding on your end for language translation?

- Garrett

I am finally geting it. Sorry, I am really slow today. Looking at the weather underground data, there is a variable called icon which you want to expose as ConditionGroup. This makes sense and I say we should go that route.

- Garrett
Title: Re: Weather Plugin
Post by: guessed on September 13, 2012, 01:26:35 am
When we're ready, I'd add an extra config parameter for Language.  In turn, I'd use that to build a URL including this type of info:
    http://www.wunderground.com/weather/api/d/docs?d=language-support

See this one for an example, using Arabic translations to make them really stand out within the output:
    https://api.wunderground.com/api/36c3262810218dd4/conditions/forecast/lang:AR/q/CA/San_Francisco.xml

note that "weather", "wind_dir" (etc) are translated, but "icon" is not.  The new ConditionGroup would be based upon icon (a literal copy of it's value, to keep it simple)
Title: Re: Weather Plugin
Post by: garrettwp on September 13, 2012, 01:30:47 am
Understood, would it be safe to say I can start modifying my app code with the icon values to the appropriate icons I have? I will than add the code for the ConditionGroup when the new version of the plugin is in place.

Thanks for the link to the translation, makes so much more sense when you have an example.

- Garrett
Title: Re: Weather Plugin
Post by: guessed on September 13, 2012, 01:49:01 am
Let's give it 24hrs to float other commentary.  I think it's what we'll end up with, but I'd like to give others an opportunity to comment/correct the proposal since it might not be baked enough.

I'm basically taking this time to "reset" a few of the things I did in the original, since it's already an upheaval based upon the wholesale loss of the GoogleWeather feed and people will need to make changes anyhow to use it.
Title: Re: Weather Plugin
Post by: futzle on September 13, 2012, 03:21:36 am
I suppose the bit I feel strongest about is that there are enough changes in the interface that it's now basically a new service.  I hope that we take the opportunity to bump the serviceId to 2 to reflect this.  This'll ensure that other plugins (like mine) can tell that they are operating on Weather Underground data.  (And who knows, Google might one day turn its weather API back on...)
Title: Re: Weather Plugin
Post by: guessed on September 15, 2012, 04:42:08 pm
@futzle,
I've decided to keep the serviceId the same, esp since Google has stopped the service, and people are dead in the water as a result.

Most of the changes are additive (ProviderKey, ProviderName, ProviderURL, ConditionGroup and SetProviderKey), which are benign, or relate to the domain values of some of the existing values...

The notable impacts to domain values are:
a) An increased # of potential values for Condition
b) WindDirection values now use West, North, East, South instead of W, N, E, S (resp).  All other values are unchanged.

I'm choosing to do this to avoid existing users having a set of "unused" service Variables, with largely duplicate names, as a result of the serviceId scoping.  Basically I'd like to minimize the cutover/conversion impact for users, by not forcing them to "recreate" the Weather Plugin.  I've already got folks moaning (http://apps.mios.com/all-reviews.php?id=45) in apps.mios.com comments for the plugin (oddly enough, some of the only feedback on that system for this plugin 8) )

Once I'm able to restore service I'll consider any standardization efforts we want.  They'll need to be fairly loose, given that services like Wunderground (WUI) require that you not modify their values in any manner.  That makes standardization somewhat tricky, since you'd need to use their result-codes for all the service providers (and hope they don't also require you to use their values ;)


A new version has been pushed to source control, under tag 1.52:
    http://code.mios.com/trac/mios_weather/changeset/55/tags/1.52?old_path=%2F&format=zip


I suppose the bit I feel strongest about is that there are enough changes in the interface that it's now basically a new service.  I hope that we take the opportunity to bump the serviceId to 2 to reflect this.  This'll ensure that other plugins (like mine) can tell that they are operating on Weather Underground data.  (And who knows, Google might one day turn its weather API back on...)
Title: Re: Weather Plugin
Post by: guessed on September 15, 2012, 04:43:45 pm
... for the above, the one change I haven't made yet is to convert the Scene stuff for "Condition (Detailed)" over to use a Text field.  Looks like it broke in UI4 somewhere along the way anyhow, so not sure how people have been using that option...

Title: Re: Weather Plugin
Post by: amg0 on September 16, 2012, 06:01:52 am
Thank you @guessed for this excellent work. I have installed 1.52 and so far so good. I have one question though , I do not have a logs or notifications tab despite the fact I do see the event list sections in the json file. is this work in progress ?
Title: Re: Weather Plugin
Post by: Intrepid on September 16, 2012, 08:30:37 am
guessed,

Thanks, got it back up and running.

what should be in the variable: location?  It is blank.  And my dashboard does not show the city like google used to.
Title: Re: Weather Plugin
Post by: kbmcguire on September 17, 2012, 03:57:39 pm
guessed,

Thanks, got it back up and running.

what should be in the variable: location?  It is blank.  And my dashboard does not show the city like google used to.

@Intrepid, I don't recall the weather plugin ever displaying the city on the dashboard??  Anyway, the plugin normally uses Vera's current location but you can override the location for the plugin to a local weather station or airport, etc. by typing it into the "location" field on the main settings tab. (see here for a better explanantion: http://code.mios.comtrac/mios_weather (http://code.mios.comtrac/mios_weather) )

Check here for personal weather station codes: http://www.wunderground.com/weatherstation/index.asp (http://www.wunderground.com/weatherstation/index.asp)

Hope this helps.
Title: Re: Weather Plugin
Post by: Cor on September 20, 2012, 05:32:51 pm
Hello,

I just installed the google weather app. and got a key at wunderground , but where do I insert this key?
I saw a screenshot somewhere there is a field at the "world weather" > settings>. on the right side. But this field does not show on my screen :-/

thanks for the help,
Cor
Title: Re: Weather Plugin
Post by: Aaron on September 20, 2012, 05:43:55 pm
This thread is way to difficult to follow... is there code that is working again?

If yes... PLEASE update the first post with the How-to OR start a NEW thread.
Title: Re: Weather Plugin
Post by: futzle on September 21, 2012, 12:30:30 am
This thread is way to difficult to follow... is there code that is working again?

No, there isn't, at least not that's finished and ready for Normal Users.  guessed wants feedback from users who are happy to install the plugin files by hand.  If you are not one of those users, there's nothing here for you yet.
Title: Re: Weather Plugin
Post by: Cor on September 21, 2012, 03:32:02 am
So, this  app: (Plugin 45, Title:  Google Weather Plugin, Version:  1.48)  is not working ??

crap!
Title: Re: Weather Plugin
Post by: eddiegonzales on September 21, 2012, 04:04:06 am
I'm very much looking forward to an Wunderground plugin. Then its finally possible to get data from your own Weather Station (PWS) without having to implement RFXCOM. (That won't work with my current Weather Station 868Mhz)

I upload weather data to wunderground continously.

Title: Re: Weather Plugin
Post by: teonebello on September 21, 2012, 10:20:12 am
Where can I find the key in the weather underground site?

I sign up but I cannot find any key.

Thanks for the support
Matteo
Title: Re: Weather Plugin
Post by: capjay on September 21, 2012, 10:54:17 am
Where can I find the key in the weather underground site?

http://www.wunderground.com/weather/api/
Title: Re: Weather Plugin
Post by: guessed on September 21, 2012, 11:44:28 am
Thanks!  I've now included the direct link in the Wiki install instructions to make it easier for people to find.

Where can I find the key in the weather underground site?

http://www.wunderground.com/weather/api/
Title: Re: Weather Plugin
Post by: Cor on September 21, 2012, 01:50:54 pm
But where do I insert this Api key ??


Thanks ,
Cor
Title: Re: Weather Plugin
Post by: capjay on September 21, 2012, 06:24:35 pm
But where do I insert this Api key ??

if you install the new Weather plugin, you'll get a device called "World Weather", click on the wrench, and enter the API key under "Provider Key", and click "Set"..
Title: Re: Weather Plugin
Post by: RichardTSchaefer on September 21, 2012, 08:45:22 pm
How about a new thread called: New Weather Plugin
Include the following as a sticky first entry:

And then may be lock this thread with a final post ... Thanks to GOOGLE the original Weather Plugin is dead  ... and a pointer to the New Weather Plugin


Title: Re: Weather Plugin
Post by: parkerc on September 22, 2012, 03:12:49 am
How about a new thread called: New Weather Plugin
Include the following as a sticky first entry:
  • details of where to get the code.
  • Compatibility UI4 and UI5.
  • How to install it.
  • Where to get the API Key that is needed.

And then may be lock this thread with a final post ... Thanks to GOOGLE the original Weather Plugin is dead  ... and a pointer to the New Weather Plugin

+1

The "Wunderground Weather Plugin" would a good and more specific name.

(Plus it shamelessly gives me a chance to promote my poll on the subject of plugins too http://forum.micasaverde.com/index.php/topic,11891.0.html) :)
Title: Re: Weather Plugin
Post by: mcvflorin on September 24, 2012, 09:49:59 am
I think it the name should be Weather Plugin, like it's on code.mios.com. This way the data provider can be changed without renaming the plugin.

By the way, I unpublished version 1.48 of the Google Weather Plugin from the MiOS Marketplace, because we received some tech support tickets about that plugin not working.

If @guessed agrees, I'll publish version 1.52 after I update the documentation.
Title: Re: Weather Plugin
Post by: guessed on September 24, 2012, 11:55:13 am
Florin,
Go ahead and publish the 1.52 tag.  It's parity with what's out there today.

One note though, the contracts for use for most of these services want you to ensure that people are aware that the feed data is coming from their service.

To this effect, the "default title" of the Plugin should change to "WUI Weather", and users can change this after the fact.  It should not be a generic title like "Weather" or "World Weather".  Please do NOT publish the Plugin if you're going to use that as the default title, as it may violate the ToU agreement for the API.
Title: Re: Weather Plugin
Post by: conchordian on September 25, 2012, 02:31:46 am
Anyway, the plugin normally uses Vera's current location but you can override the location for the plugin to a local weather station or airport, etc. by typing it into the "location" field on the main settings tab.

Just a note to say I couldn't get the weather plug-in to work using Vera's current location, but as soon as I put in my Australian city and state, it began updating the values.
Title: Re: Weather Plugin
Post by: mcvflorin on September 25, 2012, 10:32:30 am
I just published the plugin as Wunderground Weather Plugin with a new icon.
Title: Re: Weather Plugin
Post by: Trotsky40 on September 25, 2012, 11:02:52 am
I just installed the plug-in and so far everything works great. Thank you!

I didn't have any issues with it picking up the default location from Vera. I changed the location to a station about 4 blocks from my house. This will be a big improvement over the Google version! I am considering putting in my own weather station for some truly local weather  ;D
Title: Re: Weather Plugin
Post by: gbeeton on September 25, 2012, 07:27:24 pm
I assume you need an upgraded (I.E. paid) membership to Weather Underground in order to get the key?
Title: Re: Weather Plugin
Post by: PurdueGuy on September 25, 2012, 07:28:50 pm
I assume you need an upgraded (I.E. paid) membership to Weather Underground in order to get the key?
No, just create an a account, then at the bottom of any page, hit "Weather API for Developers - JSON" and go from there.
Title: Re: Weather Plugin
Post by: gbeeton on September 25, 2012, 07:50:36 pm
I assume you need an upgraded (I.E. paid) membership to Weather Underground in order to get the key?
No, just create an a account, then at the bottom of any page, hit "Weather API for Developers - JSON" and go from there.

Okay, got it.  Thanks.
A note to that effect on the help page for the plug-in would be helpful  :-)
Title: Re: Weather Plugin
Post by: guessed on September 25, 2012, 09:39:57 pm
@gbeeton,
The Installation Wiki page (http://code.mios.com/trac/mios_weather/wiki/Installation-UI4) provides a direct link to the WUI Registration page (http://www.wunderground.com/weather/api/?apiref=557bfbc30f6714b8).

At the very top of their page it's got this item covered:

    Create Your Free Account


I've avoided making references to cost (etc) in the Wiki as these things can change over time.  It's best to leave that information to the service provider to ensure there's a consistent message on service levels and costs.

I assume you need an upgraded (I.E. paid) membership to Weather Underground in order to get the key?
No, just create an a account, then at the bottom of any page, hit "Weather API for Developers - JSON" and go from there.

Okay, got it.  Thanks.
A note to that effect on the help page for the plug-in would be helpful  :-)
Title: Re: Weather Plugin
Post by: davedecali on September 26, 2012, 04:15:29 pm
I have attempted to download the zip file, and extracted, however the I_WUIWeather.xml file is not there.  The published plug ins in the marketplace also proved to be unhelpful and simply installed the google weather .xml

If anyone can point me in the right direction or provide proper link to download correct luup files would be greatly appreciated.

updated: correct link now directs to proper files... thanks for the quick response :)
Title: Re: Weather Plugin
Post by: guessed on September 26, 2012, 04:53:28 pm
Manual install Links corrected in the Wiki. 

UI5 users can just get it from apps.mios.com, since it's been updated there.
Title: Re: Weather Plugin
Post by: davedecali on September 26, 2012, 08:21:43 pm
Would there be a reason the luup files are not uploading after several attempts.  I am running a Vera 1 with UI4.  It is still showing the I_googleweather.xml file and this is what is pulling when I attempt to create new device.  I am probably just missing something easy, but I have refreshed, reloaded and uploaded as many ways as I know how to no avail.  Not sure why its being difficult unless its my outdated hardware.
Title: Re: Weather Plugin
Post by: guessed on September 26, 2012, 09:01:15 pm
The code works on UI4 also. 

Look for the file I_WUIWeather.xml in MiOS Developers -> Luup Files.  If this is missing, then the upload didn't complete and you'll need to redo it, and press (Go) at the end.

Would there be a reason the luup files are not uploading after several attempts.  I am running a Vera 1 with UI4.  It is still showing the I_googleweather.xml file and this is what is pulling when I attempt to create new device.  I am probably just missing something easy, but I have refreshed, reloaded and uploaded as many ways as I know how to no avail.  Not sure why its being difficult unless its my outdated hardware.
Title: Re: Weather Plugin
Post by: davedecali on September 26, 2012, 10:32:48 pm
That is exactly what I tried to do and locate the file mentioned above.  Guess I didn't press Go hard enough hahahha... sounds like something else is going on here that might be browser related.

Thanks again for all the quick replies.
Title: Re: Weather Plugin
Post by: davedecali on September 26, 2012, 10:46:53 pm
So I switched from Chrome to Safari and got the below warning when attempting upload.
Title: Re: Weather Plugin
Post by: guessed on September 26, 2012, 10:49:56 pm
Try doing it locally on the machine, not via cp.mios.com.... Which appears to have bugs...
Title: Re: Weather Plugin
Post by: davedecali on September 26, 2012, 11:03:36 pm
Everytime the upload says successful, and it prompts I would say in less than a second after pushing go.  I have refreshed the browser before and after I checked the Luup files to see if it "took" each time with no love.  I did what you recommended and tried to upload with direct access to the box.  Still at a loss.
Title: Re: Weather Plugin
Post by: davedecali on September 27, 2012, 10:53:18 pm
After trying to submit a ticket for the files not uploading, the VERA froze.  I performed a full restore and then regained access with accesses directly.  I submitted the ticket and for sh!ts and giggles attempted to upload luup files and they took.  Go figure right.  Applied the key and now everything is well again in home automation land at my humble abode.  I will leave the ticket active just to see if they come back with anything.  Thanks for the quick responses and hopefully this service stays active for a while.
Title: Re: Weather Plugin
Post by: guessed on September 27, 2012, 10:58:35 pm
Great.  Given the symptoms you were experiencing, I'd guess that Vera had filled up the file system.  When this happens, a reboot will fix it... At least until the next time :)

There is a bug in UI4, since fixed in UI5, where log rotation can cause that type of behavior.
Title: Re: Weather Plugin
Post by: Aaron on October 01, 2012, 10:46:51 am
Guys,
Thank you for remaking this plugin. It is not essential for me (not until I integrate my yard watering) but it is nice to see it working again.
Title: Re: Weather Plugin
Post by: Chris H. on October 02, 2012, 01:22:02 am
Great job guys, the google weather stopped working the day I installed it so I'm glad you gave us a replacement. Keep up the good work, it is the dedication from the users in this forum that pushed me into choosing Vera for my home automation.  MiCasaVerda should really do something extra for its contributors that are driving their sales up on your free labor and design work.

I have submitted 3 tickets to MiCasaVerda over 2 weeks ago and still have not received a single response, the only reason I stick with them is because of the user community.
Title: Re: Weather Plugin
Post by: Chris H. on October 02, 2012, 05:25:06 am
@mcvflorin

I received your private message but the system still won't let me reply. Any other ideas on how I can send you my info? I noticed that in the Tech Support Tab in the section labeled "Existing Trouble Tickets" I still have nothing there, it's like the system is not taking my tickets.
Title: Re: Weather Plugin
Post by: DaveL17 on October 06, 2012, 08:35:20 am
Cheers to all involved in updating this plugin to use Weather Underground.  I had actually been meaning to suggest this, as I find WUND to be much more accurate for my location.  I've installed the updated plugin and all seems to be working as it should be (after I corrected the part where I put my API key in as a location by mistake that is....)

Thanks again,
Dave
Title: Re: Weather Plugin
Post by: kbmcguire on October 06, 2012, 08:58:39 am
@mcvflorin

I received your private message but the system still won't let me reply. Any other ideas on how I can send you my info? I noticed that in the Tech Support Tab in the section labeled "Existing Trouble Tickets" I still have nothing there, it's like the system is not taking my tickets.

@Chris H.,
FYI, your Vera must be logged in to your MIOS account in order for the tickets to show.  Does it show you logged in at the top right corner of the Vera UI (i.e. Welcome [username], Logout)?

Title: Re: Weather Plugin
Post by: DaveL17 on October 07, 2012, 09:04:49 am
FYI:  For me, iVera displays (under the sensors tab):

current weather (parent),
low temperature (child),
humidity (child), but
NOT high temperature (child). 

To be clear, the current weather (parent) display DOES include current conditions, low, high, and humidity.  Can't seem to figure out what's causing low temp and humidity to show but not high temp...

In Square, I can get all four to show.

YMMV.
Dave
Title: Re: Weather Plugin
Post by: xben007 on October 20, 2012, 12:15:12 pm
Hi there !

I've been using the weather plugin for a while now and was actually really happy that we had to switch to WU.
I follow a local weather station trough them (and have been doing so for quite long) and I've been thinking about how to use all their data with my Vera.
One thing I would like to do is to use their UV readings (Solar radiation) to adjust my blinds (which I already control through the vera).

I'm new to this but I tried creating a "UV sensor" for WUIWeather, using "Temperature and Humidity Sensors as a model.
I created a D_UVSensor1.xml, a D_UVSensor1.json, a S_UVSensor1.xml and I modified the I_WUIWeather.xml
I uploaded the 4 files to the Vera, restarted the luup engine and crossed my fingers.

Unsurprisingly, it doesn't work although the weather station provides the info.
Can anyone tell me if I'm going in the right direction ?

Here is the sort of error messages I get in the log file :
Code: [Select]
/tmp/log/cmh$ cat /tmp/log/cmh/LuaUPnP.log | grep WUIWeather
50 10/20/12 16:21:24.587 luup_log:28: WUIWeather: #28 starting up with id  __LEAK__ this:32768 start:221184 to 0x99e000 <0x2c05f680>
50 10/20/12 16:21:26.295 luup_log:28: WUIWeather: fetchWeather returned error=Unable to parse result __LEAK__ this:286720 start:507904 to 0x9e4000 <0x2ce5f680>

Thanks in advance for your help !
Title: Re: Weather Plugin
Post by: Minnies on October 20, 2012, 05:53:25 pm
Any clues regrading inputting a local weather station. I tried to input the weather station call signs and the plugin freezes. The one I am trying to o is called "Edgehill" "Davenport KFLDAVEN5". Not sure what should go in the box.
Title: Re: Weather Plugin
Post by: garrettwp on October 20, 2012, 06:15:18 pm
You need to enter pws:xxxxxxx, where xxxxxxx is the weather station you want to use.

- Garrett

Title: Re: Weather Plugin
Post by: Minnies on October 20, 2012, 10:19:38 pm
That worked like a charm. Thanks.
Title: Re: Weather Plugin
Post by: futzle on October 21, 2012, 07:07:59 am
I'm new to this but I tried creating a "UV sensor" for WUIWeather, using "Temperature and Humidity Sensors as a model.
I created a D_UVSensor1.xml, a D_UVSensor1.json, a S_UVSensor1.xml and I modified the I_WUIWeather.xml
I uploaded the 4 files to the Vera, restarted the luup engine and crossed my fingers.

It's a pretty good attempt.

My guess is that your modified I_*.xml file isn't matching the weather XML properly.  The part you added to the pattern:
Code: [Select]
&lt;UV>(%d-%.?%d-)%%&lt;/UV>.*means that the XML must contain strings like:

On my PWS the string looks like:
No percent sign.  (Also zero because I'm too cheap to fork out the hundreds of dollars for a UV sensor.)

Try removing the %% from the pattern; I bet you copied from the humidity row which does have a percent sign.

I didn't look at your service and device files for ultraviolet.  If they've got errors then you'll encounter them once you've sorted out the pattern.
Title: Re: Weather Plugin
Post by: mhjens on October 21, 2012, 07:18:34 am
Hi guys,

I live in a cold part of the world (north Sweden) and need an engine heater to run for some time before I use the car. Currently I've a couple of scenes who runs at different times and they check the current temperature (Celsius) and the scene starts if it's below a certain temperature (luup).

Scene 1: runs at 06:30 and CurrentTemperature < 0
Scene 2: runs at 06:00 and CurrentTemperature < -5
Scene 3: runs at 05:00 and CurrentTemperature < -10
Scene 4: runs at 04:00 and CurrentTemperature < -20
Scene 5: runs at 03:00 and CurrentTemperature < -30

It was some time ago I configure this, my question is now, is it possible to merge my five scenes into just one with maybe some more advanced luup?

Thanks in advance!

Title: Re: Weather Plugin
Post by: xben007 on October 21, 2012, 11:35:26 am
Thanks Futzle, you were right, I copied this bit from the humidity sensor. The UV reading looks like <UV>1.0</UV> so I changed my code to
Code: [Select]
&lt;UV>(%d-%.?%d-)&lt;/UV>.*but I still get the same kind of message.

If anyone has some spare cycles, don't hesitate to share them ! No big deal though, just having a bit of fun here...
Title: Re: Weather Plugin
Post by: resq93 on October 21, 2012, 02:39:46 pm
Hi guys,

I live in a cold part of the world (north Sweden) and need an engine heater to run for some time before I use the car. Currently I've a couple of scenes who runs at different times and they check the current temperature (Celsius) and the scene starts if it's below a certain temperature (luup).

Scene 1: runs at 06:30 and CurrentTemperature < 0
Scene 2: runs at 06:00 and CurrentTemperature < -5
Scene 3: runs at 05:00 and CurrentTemperature < -10
Scene 4: runs at 04:00 and CurrentTemperature < -20
Scene 5: runs at 03:00 and CurrentTemperature < -30

It was some time ago I configure this, my question is now, is it possible to merge my five scenes into just one with maybe some more advanced luup?

Thanks in advance!

Create one scene and schedule it for each of the times you want it to run. Paste this code in the Luup box and replace XX with your outside sensor number. (I have not tested this with negative numbers but I imagine it should work)

Code: [Select]
local t = os.date('*t')
outside = luup.variable_get("urn:upnp-org:serviceId:TemperatureSensor1", "CurrentTemperature", XX)

local runScene = false

if ((t.hour >= 3) and (t.hour < 4)) and (tonumber(outside) <= "-30") then


runScene = true
end

if ((t.hour >= 4) and (t.hour < 5)) and (tonumber(outside) <= "-20") then


runScene = true
end

if ((t.hour >= 5) and (t.hour < 6)) and (tonumber(outside) <= "-10") then


runScene = true
end


if ((t.hour >= 6) and (t.hour < 7)) and (tonumber(outside) <= "-5") then


runScene = true
end


if ((t.hour >= 7) and (t.hour < 8 )) and (tonumber(outside) <= "0") then


runScene = true
end

return runScene
Title: Re: Weather Plugin
Post by: Meinaart on October 29, 2012, 07:49:34 am
Could you also add support for language? I see in the WeatherUnderground documentation that languages are supported:
http://www.wunderground.com/weather/api/d/docs?d=language-support

It works really simple, just add /lang:EN/ before /q/ in the request URL. Where "EN" should be a user-changable setting.

It would also be nice to expose the icon value from the WeatherUnderground JSON. That way it's easier to use a custom icon (I am using Vera's data in another webapp).
Title: Re: Weather Plugin
Post by: garrettwp on October 29, 2012, 08:18:30 am
If you read a few pages back, Guessed has plans to add support for additional languages. He wants to make sure that the plugin is stable before adding additional features.

- Garrett
Title: Re: Weather Plugin
Post by: codemnausa on December 14, 2012, 02:48:14 pm
Hi All,

I am trying to return the current condition variable and I am getting nothing   :(

I am using

Cond = luup.variable_get("urn:demo-micasaverde-com:device:weather:1", "Condition", 5)

what am I doing wrong?

Thanks
Title: Re: Weather Plugin
Post by: guessed on December 14, 2012, 03:03:41 pm
The serviceId is wrong.  Check the help page, which has an example:
    http://code.mios.com/trac/mios_weather
Title: Location Format
Post by: aecchalet on December 18, 2012, 06:55:19 pm
Very Nice Plugin but instructions difficult to locate.
What formats are acceptable for location in the Underground Weather Plugin?
The weather station choosen from my long/lat is just okay, being about 700 ft higher and more cloudy and cooler than my location.
Can I enter a code for a personal weather station (PWS)?
If so, in what format?
My preferred PWS is MPERH1
Do I enter its name, code or "pws: MPERH1"

"pws:MPERH1" - worked!
thanks
Title: Weather Plugin
Post by: futzle on December 18, 2012, 07:39:01 pm
pws:StationName works for me. No spaces.
Title: Weather Plugin
Post by: futzle on December 18, 2012, 07:43:32 pm
Duplicate post.
Title: Re: Weather Plugin
Post by: guessed on December 29, 2012, 04:41:31 pm
Install documentation updated to include more examples for the Location override parameter (as well as a more direct link to the WUI Documentation for it (http://www.wunderground.com/weather/api/d/docs?d=data/index#standard_request_url_format))
Title: Re: Weather Plugin
Post by: aderrington on January 16, 2013, 07:03:26 am
I've just found this plugin - It looks great, However i've installed it, i've got set it to my favourite PWS, and API key. However it's not updating, I can see through Wunderground that it's being requested for info, however it's not updating in the plugin. Also although i've selected Metric, It's continuing to show up as US units....

Any ideas?

Many thanks,
Andrew
Title: Re: Weather Plugin
Post by: guessed on January 16, 2013, 10:54:29 am
Which PWS?
Title: Re: Weather Plugin
Post by: allmoney.ws on May 07, 2013, 04:59:36 pm
I would like to know Condition for tomorrow. Will be rain or not. In plugin I see Condition only for now.... How can I see Condition for tomorrow? Please, help!
Title: Re: Weather Plugin
Post by: futzle on May 07, 2013, 05:30:28 pm
How can I see Condition for tomorrow?

You can't.  It isn't currently implemented by the plugin.
Title: Re: Weather Plugin
Post by: aaronclark on August 19, 2013, 02:21:06 pm
I too would very much like the plugin to include the forecast conditions.  I plan to use this with one of my GC-100 controllers to provide a "rain sensor" input to my sprinkler system.  The implementation would trip the rain sensor input on the sprinkler system if the forecast for precipitation is over ~60%.
Title: Re: Weather Plugin
Post by: garrettwp on August 19, 2013, 03:30:41 pm
One main reason why more features are not added to the weather plugin is that guessed would like to try and standardize the service / device variables so that they can be used in 3rd party apps as well as other plugins. However, this has not moved very far.

- Garrett
Title: Re: Weather Plugin
Post by: stylekyle on October 25, 2013, 10:03:20 am
I have landscape lighting that I want to turn on in rain/sleet/thunderstorms.  Having not used much scripting in vera  yet, I setup a scene that turns the lights on and used three separate triggers, one for each of the condition groups (rain/sleet/thunderstorms).  I then added a LUUP event to each trigger so it only does it during the day.

To get them to turn off when it stops raining, I added a separate off scene with triggers for each of the other weather groups (12 triggers total), and luup so it is only during the day.

I'm sure there is a much simpler way of doing this with all LUUP code.  But my question is this...  will programming it this way cause my Vera to run slower.  I think the weather app polls every 30 minutes by default.  If I go to trigger a scene while it happens to be repolling the weather, will it cause the vera to respond slower?

I believe my current method will yield the proper results... I'm just trying to figure out best practices. 
Title: Re: Weather Plugin
Post by: mal on December 12, 2013, 02:12:16 am
Great plugin


I am using program logic in conjunction with world weather to control my sprinklers it works pretty well but am having a problem with conditions updating in weather
it only shows conditions when it feels like it  if you go into advanced  ConditionGroup and Conditions are blank everything else is there

am using 1.54 world weather and have a key from weather underground and ui5
Title: Re: Weather Plugin
Post by: mal on December 14, 2013, 05:44:39 am
Update
After a lot of reading I thought I would install the 1.55 patch after learning how to use wincps which was a pain as the vera 2 was updated to a vera 3 but kept the old password, that had me stumped for a while
Wasn?t sure where to put the files so decided to check a few other things first I found that changing the location on the vera worked a treat as I am in the country and the other location is the same distance away it was not a problem
The only thing is I am in the Tropics and the weather is very localised so have found a weather station that uploads to underground weather as a PWS would it be possible to use the data ???
Here is a link
[urlhttp://www.ebay.com.au/itm/SOLAR-WEATHER-STATION-WITH-PROFESSIONAL-LED-DISPLAY-/301038169162?pt=AU_Gadgets&hash=item461745ec4a&_uhb=1][/url]
Title: Re: Weather Plugin
Post by: garrettwp on December 14, 2013, 06:25:23 am
Yes, please reread the thread how to use pws stations.

- Garrett

Title: Re: Weather Plugin
Post by: persimmonx on December 17, 2013, 02:28:47 pm
I too would very much like the plugin to include the forecast conditions.  I plan to use this with one of my GC-100 controllers to provide a "rain sensor" input to my sprinkler system.  The implementation would trip the rain sensor input on the sprinkler system if the forecast for precipitation is over ~60%.

Yes I need precipitation  too.
Title: Re: Weather Plugin
Post by: mal on December 22, 2013, 03:18:17 am
Yes, please reread the thread how to use pws stations.

- Garrett

I read the whole thread and picked up a lot thanks, don't know why search didn't pick it up
Title: Re: Weather Plugin
Post by: adamfox on December 23, 2013, 10:40:32 pm
Very new to the Vera world, but am having an issue with this plugin. I can get weather data to display by entering my API Key. However, every time I reload all the data is erased and I am once again presented with the error that a registration key is needed. Any help would be greatly appreciated.
Title: Re: Weather Plugin
Post by: guessed on June 16, 2014, 08:31:00 pm
Weather Plugin v1.46 has been released.  See the announcement thread (http://forum.micasaverde.com/index.php/topic,25618.0.html) for details.