We have moved at community.getvera.com

Author Topic: Weather Plugin  (Read 4435 times)

Offline pepebel4

  • Newbie
  • *
  • Posts: 11
  • Karma: +0/-0
Weather Plugin
« on: December 01, 2010, 05:50:04 am »
Hello,
I have installed the Google Weather plugin. This is working fine, can see all the items on the dashboard and can create an event when temperatur drops below a certain degree for example.
However, following code is not working :

local lul_cond=luup.variable_get("urn:demo-micasaverde-com:device:weather:1","Condition",6)
luup.log(lul_cond)
 if( lul_cond == "Icy" ) then
  **** do something ***
end

In the log I can see that lul_cond has value 'null'.

Has anybody some experience in checking the 'Condition' and possibly know what I am doing wrong?

Thanks in advance!
Pascal


Offline Ap15e

  • Beta Testers
  • Hero Member
  • *****
  • Posts: 1998
  • Karma: +12/-0

Offline guessed

  • Community Beta
  • Master Member
  • ******
  • Posts: 5301
  • Karma: +92/-22
  • Release compat is not a bolted-on afterthought
Re: Weather Plugin
« Reply #2 on: December 01, 2010, 03:27:04 pm »
I've tweaked both the Weather Plugin Wiki page (on code.mios.com) as well as the Luup_Variables wiki page in the Main Wiki, to better link these together.

Folks should feel free to use the main Forums post for general questions:
    http://forum.micasaverde.com/index.php?topic=1435.0

as well as updating the Luup_Variables wiki page with other examples:
    http://wiki.micasaverde.com/index.php/Luup_Variables#Weather_Plugin

Offline pepebel4

  • Newbie
  • *
  • Posts: 11
  • Karma: +0/-0
Re: Weather Plugin
« Reply #3 on: December 01, 2010, 04:46:51 pm »
Unfortunately that is also giving me null value :(

 Code=local lul_cond = luup.variable_get("urn:micasaverde-com:serviceId:Weather1","Condition",6)

luup.log(lul_cond)
 if( lul_cond == "Overcast" ) then
   luup.inet.wget("https://prowl.weks.net/publicapi/add?apikey=5319669f7f09708334d2547802a2ef4faba55e56&application=Vera&event=Sneeuw&description=Mostly Cloudy")
 end <0x2c0c>
50      12/01/10 22:44:44.713   luup_log:6: (null) <0x2c0c>
« Last Edit: December 01, 2010, 04:51:44 pm by pepebel4 »

Offline Ap15e

  • Beta Testers
  • Hero Member
  • *****
  • Posts: 1998
  • Karma: +12/-0
Re: Weather Plugin
« Reply #4 on: December 01, 2010, 05:22:44 pm »
The correct service is:
urn:upnp-micasaverde-com:serviceId:Weather1

Offline pepebel4

  • Newbie
  • *
  • Posts: 11
  • Karma: +0/-0
Re: Weather Plugin
« Reply #5 on: December 01, 2010, 05:35:31 pm »
That works!
Snowing in Belgium, now my lights outside pop on when it Snows or there is Fog.
Superb!

Offline guessed

  • Community Beta
  • Master Member
  • ******
  • Posts: 5301
  • Karma: +92/-22
  • Release compat is not a bolted-on afterthought
Re: Weather Plugin
« Reply #6 on: December 01, 2010, 05:43:00 pm »
In UI4, I corrected part of the code, so it's serviceId is now:

    urn:upnp-micasaverde-com:serviceId:Weather1

in other words, it has an extra "upnp-" bit on the front.  I believe I previously had 1/2 the code using it and 1/2 not, so the change was to align to a single serviceId, lest they every actually validate it ;-)

Offline ruster34

  • Sr. Newbie
  • *
  • Posts: 29
  • Karma: +0/-0
Re: Weather Plugin
« Reply #7 on: December 08, 2010, 11:51:41 am »
Where did you get the Google Weather Plugin?  I'm new to Luup and want to play with this to learn the ropes.

Offline pepebel4

  • Newbie
  • *
  • Posts: 11
  • Karma: +0/-0
Re: Weather Plugin
« Reply #8 on: December 08, 2010, 11:53:25 am »