Changes between Version 14 and Version 15 of WikiStart
- Timestamp:
- 2012-09-26 17:30:22 (12 years ago)
Legend:
- Unmodified
- Added
- Removed
- Modified
-
WikiStart
v14 v15 31 31 = Scene Scripting = 32 32 The Weather Plugin exposes a number of Variables: 33 * `Condition` (String) something representing the current Weather state.[[br]] 33 * `Condition` (String) something representing the current Weather state (subject to language translation).[[br]] 34 * `ConditionGroup` (String) an aggregation of weather Condititions to make scripting simpler (not subject to language translation) 34 35 * `WindCondition` (String) a value like "`W at 2 mph`". 35 36 * `WindSpeed` (Number) a value like "`2`" extracted from the `WindCondition`, specified in Local units (either kph or mph depending upon the setting of `Metric`) … … 37 38 * `Period` (Number) the number of seconds to delay before automatically polling the Weather feed. If blank, the default is 1800 seconds (30 minutes). This value cannot be < 10 or > 3600. 38 39 39 These variables can be accessed in Luup scenes using code illustrated here: 40 * [http://wiki.micasaverde.com/index.php/Luup_Variables#Weather_Plugin Weather Plugin in Scenes] 40 These variables can be accessed in Luup scenes. 41 42 == Examples == 43 To prevent a scene from firing when the weather is poor: 44 45 {{{ 46 #!div style="font-size: 80%" 47 {{{#!lua 48 local t = luup.variable_get("urn:upnp-micasaverde-com:serviceId:Weather1", "ConditionGroup", 104) 49 if ( (t == "sleet") 50 or (t == "tstorms") 51 or (t == "rain") 52 or (t == "snow") 53 or (t == "flurries") 54 then 55 return true 56 else 57 return false 58 end 59 }}} 60 }}} 61 41 62 42 63 Further examples can be found in the Discussion area referenced below. 43 64 44 65 The condition phrases are listed on the WUI site: 45 * [http://www.wunderground.com/weather/api/d/docs?d=resources/phrase-glossary#current_condition_phrases Current Condition Phrases]46 * [http://www.wunderground.com/weather/api/d/docs?d=resources/phrase-glossary#forecast_description_phrases Forecast Condition Phrases]66 * `Condition` - [http://www.wunderground.com/weather/api/d/docs?d=resources/phrase-glossary#current_condition_phrases Current Condition Phrases] 67 * `ConditionGroup` - [http://www.wunderground.com/weather/api/d/docs?d=resources/phrase-glossary#forecast_description_phrases Forecast Condition Phrases] 47 68 48 69 = Discussion =