Author Topic: Weather Plugin  (Read 72397 times)

RichardTSchaefer

  • Hero Member
  • *****
  • Posts: 1511
    • RTS Services Plugins
Re: Weather Plugin
« Reply #300 on: February 19, 2012, 09:27:07 am »
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 ?

guessed

  • Master Member
  • *******
  • Posts: 3947
  • Vera 3, UI-Broken#5
Re: Weather Plugin
« Reply #301 on: February 19, 2012, 10:58:07 am »
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...)


guessed

  • Master Member
  • *******
  • Posts: 3947
  • Vera 3, UI-Broken#5
Re: Weather Plugin
« Reply #302 on: February 19, 2012, 03: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 ;)

RichardTSchaefer

  • Hero Member
  • *****
  • Posts: 1511
    • RTS Services Plugins
Re: Weather Plugin
« Reply #303 on: February 20, 2012, 12: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.

guessed

  • Master Member
  • *******
  • Posts: 3947
  • Vera 3, UI-Broken#5
Re: Weather Plugin
« Reply #304 on: February 20, 2012, 01: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:

RichardTSchaefer

  • Hero Member
  • *****
  • Posts: 1511
    • RTS Services Plugins
Re: Weather Plugin
« Reply #305 on: February 20, 2012, 02: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.

guessed

  • Master Member
  • *******
  • Posts: 3947
  • Vera 3, UI-Broken#5
Re: Weather Plugin
« Reply #306 on: February 20, 2012, 02: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.

RichardTSchaefer

  • Hero Member
  • *****
  • Posts: 1511
    • RTS Services Plugins
Re: Weather Plugin
« Reply #307 on: February 22, 2012, 04: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 ?

weissertigerxl

  • Jr. Member
  • **
  • Posts: 73
Re: Weather Plugin
« Reply #308 on: March 08, 2012, 12: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

lolodomo

  • Hero Member
  • *****
  • Posts: 1341
Re: Weather Plugin
« Reply #309 on: March 10, 2012, 03: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                 },

guessed

  • Master Member
  • *******
  • Posts: 3947
  • Vera 3, UI-Broken#5
Re: Weather Plugin
« Reply #310 on: March 10, 2012, 06: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.

guessed

  • Master Member
  • *******
  • Posts: 3947
  • Vera 3, UI-Broken#5
Re: Weather Plugin
« Reply #311 on: March 19, 2012, 09:55:35 pm »
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.

guessed

  • Master Member
  • *******
  • Posts: 3947
  • Vera 3, UI-Broken#5
Re: Weather Plugin
« Reply #312 on: March 25, 2012, 12: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.

lolodomo

  • Hero Member
  • *****
  • Posts: 1341
Re: Weather Plugin
« Reply #313 on: March 25, 2012, 01: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 ?

guessed

  • Master Member
  • *******
  • Posts: 3947
  • Vera 3, UI-Broken#5
Re: Weather Plugin
« Reply #314 on: March 25, 2012, 01: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