%s | %s %s°C %s%% %s |
%s | %s: %s min %s°C max %s°C |
%s |
%s |
%s°C %s%% |
%s |
%s | ', $width, WeatherIconIMGTag(ReadingsVal($d, "icon", ""))); for(my $i=1; $i<$items; $i++) { $ret .= sprintf('%s | ', $width, WeatherIconIMGTag(ReadingsVal($d, "fc${i}_icon", ""))); } $ret .= '
%s | ', ReadingsVal($d, "condition", "")); for(my $i=1; $i<$items; $i++) { $ret .= sprintf('%s: %s | ', ReadingsVal($d, "fc${i}_day_of_week", ""), ReadingsVal($d, "fc${i}_condition", "")); } $ret .= '
%s°C %s%% | ', ReadingsVal($d, "temp_c", ""), ReadingsVal($d, "humidity", "")); for(my $i=1; $i<$items; $i++) { $ret .= sprintf('min %s°C | ', ReadingsVal($d, "fc${i}_low_c", "")); } $ret .= '
%s | ', ReadingsVal($d, "wind_condition", "")); for(my $i=1; $i<$items; $i++) { $ret .= sprintf('max %s°C | ', ReadingsVal($d, "fc${i}_high_c", "")); } $ret .= "
define <name> Weather <location> [<interval> [<language>]]
location
is the WOEID (WHERE-ON-EARTH-ID), go to
http://weather.yahoo.com to find it out for your location.interval
is the time between subsequent updates
in seconds. It defaults to 3600 (1 hour).de
,
en
,
nl
,
It determines the natural language in which the forecast information appears.
It defaults to en
. If you want to set the language you also have to set the interval.define MyWeather Weather 673513 define Forecast Weather 673513 1800The module provides four additional functions
WeatherAsHtml
, WeatherAsHtmlV
, WeatherAsHtmlH
and
WeatherAsHtmlD
. The former two functions are identical: they return the HTML code for a
vertically arranged weather forecast. The third function returns the HTML code for a horizontally arranged weather forecast. The
latter function dynamically picks the orientation depending on wether a smallscreen style is set (vertical layout) or not (horizontal layout). Each version accepts an additional paramter to limit the numer of icons to display.define MyWeatherWeblink weblink htmlCode { WeatherAsHtmlH("MyWeather") }
set <name> update
interval
seconds later.get <name> <reading>
city | name of town returned for location |
code | current condition code |
condition | current condition |
current_date_time | last update of forecast on server |
fc?_code | forecast condition code |
fc?_condition | forecast condition |
fc?_day_of_week | day of week for day +? |
fc?_high_c | forecasted daily high in degrees centigrade |
fc?_icon | forecast icon |
fc?_low_c | forecasted daily low in degrees centigrade |
humidity | current humidity in % |
icon | relative path for current icon |
pressure | air pressure in hPa |
pressure_trend | air pressure trend (0= steady, 1= rising, 2= falling) |
pressure_trend_txt | textual representation of air pressure trend |
pressure_trend_sym | symbolic representation of air pressure trend |
temperature | current temperature in degrees centigrade |
temp_c | current temperature in degrees centigrade |
temp_f | current temperature in degrees Fahrenheit |
visibility | visibility in km |
wind | wind speed in km/h |
wind_chill | wind chill in degrees centigrade |
wind_condition | wind direction and speed |
wind_direction | direction wind comes from in degrees (0 = north wind) |
wind_speed | same as wind |
define <name> Weather <location> [<interval> [<language>]]
location
entspricht der sechsstelligen WOEID (WHERE-ON-EARTH-ID). Die WOEID für den eigenen Standort kann auf http://weather.yahoo.com gefunden werden.interval
gibt die Dauer in Sekunden zwischen den einzelnen Aktualisierungen der Wetterdaten an. Der Standardwert ist 3600 (1 Stunde). Wird kein Wert angegeben, gilt der Standardwert.de
, en
oder nl
. Er bezeichnet die natürliche Sprache, in der die Wetterinformationen dargestellt werden. Der Standardwert ist en
. Wird für die Sprache kein Wert angegeben, gilt der Standardwert. Wird allerdings der Parameter für die Sprache gesetzt, muss ebenfalls ein Wert für das Abfrageintervall gesetzt werden.define MyWeather Weather 673513 define Forecast Weather 673513 1800Das Modul unterstützt zusätzlich vier verschiedene Funktionen
WeatherAsHtml
, WeatherAsHtmlV
, WeatherAsHtmlH
und WeatherAsHtmlD
. Die ersten beiden Funktionen sind identisch: sie erzeugen den HTML-Code für eine vertikale Darstellung des Wetterberichtes. Die dritte Funktion liefert den HTML-Code für eine horizontale Darstellung des Wetterberichtes. Die letztgenannte Funktion wählt automatisch eine Ausrichtung, die abhängig davon ist, ob ein Smallcreen Style ausgewählt ist (vertikale Darstellung) oder nicht (horizontale Darstellung). Alle vier Funnktionen akzeptieren einen zusätzlichen optionalen Paramter um die Anzahl der darzustellenden Icons anzugeben.define MyWeatherWeblink weblink htmlCode { WeatherAsHtmlH("MyWeather") }
set <name> update
interval
Sekunden später durchgeführt.get <name> <reading>
city | Name der Stadt, der aufgrund der WOEID übermittelt wird |
code | Code für die aktuellen Wetterverhältnisse |
condition | aktuelle Wetterverhältnisse |
current_date_time | Zeitstempel der letzten Aktualisierung der Wetterdaten vom Server |
fc?_code | Code für die vorhergesagten Wetterverhältnisse |
fc?_condition | vorhergesagte Wetterverhältnisse |
fc?_day_of_week | Wochentag des Tages, der durch ? dargestellt wird |
fc?_high_c | vorhergesagte maximale Tagestemperatur in Grad Celsius |
fc?_icon | Icon für Vorhersage |
fc?_low_c | vorhergesagte niedrigste Tagestemperatur in Grad Celsius |
humidity | gegenwärtige Luftfeuchtgkeit in % |
icon | relativer Pfad für das aktuelle Icon |
pressure | Luftdruck in hPa |
pressure_trend | Luftdrucktendenz (0= gleichbleibend, 1= steigend, 2= fallend) |
pressure_trend_txt | textliche Darstellung der Luftdrucktendenz |
pressure_trend_sym | symbolische Darstellung der Luftdrucktendenz |
temperature | gegenwärtige Temperatur in Grad Celsius |
temp_c | gegenwärtige Temperatur in Grad Celsius |
temp_f | gegenwärtige Temperatur in Grad Celsius |
visibility | Sichtweite in km |
wind | Windgeschwindigkeit in km/h |
wind_chill | gefühlte Temperatur in Grad Celsius |
wind_condition | Windrichtung und -geschwindigkeit |
wind_direction | Gradangabe der Windrichtung (0 = Nordwind) |
wind_speed | Windgeschwindigkeit in km/h (mit wind identisch) |