mirror of
https://github.com/fhem/fhem-mirror.git
synced 2025-03-04 11:26:55 +00:00
OPENWEATHER: docu
git-svn-id: https://svn.fhem.de/fhem/trunk@6949 2b470e98-0d58-463d-a4d8-8e2adae1ed80
This commit is contained in:
parent
e7bd3ad8a3
commit
922528307d
@ -234,7 +234,7 @@ OPENWEATHER_Set($$@)
|
||||
my ($hash, $name, $cmd, $val) = @_;
|
||||
my $resultStr = "";
|
||||
|
||||
if($cmd eq 'update')
|
||||
if(lc $cmd eq 'update')
|
||||
{
|
||||
$hash->{LOCAL} = 1;
|
||||
OPENWEATHER_Start($hash);
|
||||
@ -254,7 +254,7 @@ OPENWEATHER_Get($@)
|
||||
my $result;
|
||||
my $message;
|
||||
|
||||
if ($cmd eq "apiResponse")
|
||||
if (lc $cmd eq "apiresponse")
|
||||
{
|
||||
my $time = gettimeofday();
|
||||
$result = OPENWEATHER_Run $name;
|
||||
@ -276,20 +276,6 @@ OPENWEATHER_Get($@)
|
||||
return $message;
|
||||
|
||||
}
|
||||
# elsif ($cmd eq "jsonAnalysis") {
|
||||
# my $time = gettimeofday();
|
||||
# $hash->{fhem}{jsonInterpreter} = "";
|
||||
# $result = OPENWEATHER_Run $name;
|
||||
# my @a = split /\|/, $result;
|
||||
# if ($a[1]==0) { return $a[2]; }
|
||||
|
||||
# $result = OPENWEATHER_Done $result;
|
||||
# my @a = split /\|/, $result;
|
||||
# $time = gettimeofday() - $time;
|
||||
# $message = sprintf( "Runtime: %.2f s\n_________________\n\n", $time);
|
||||
# $message .= decode_base64($result); #$a[2]);
|
||||
# return $message;
|
||||
# }
|
||||
|
||||
my $list = "apiResponse:noArg";
|
||||
return "Unknown argument $cmd, choose one of $list";
|
||||
@ -432,7 +418,7 @@ OPENWEATHER_UpdateAborted($)
|
||||
<br>
|
||||
It requires a registration on this website to obtain the necessary parameters.
|
||||
<br>
|
||||
It requires the perl moduls HTTP::Request, LWP::UserAgent, HTML::Parse and Digest::MD5.
|
||||
It uses the perl moduls HTTP::Request, LWP::UserAgent, HTML::Parse and Digest::MD5.
|
||||
<br/><br/>
|
||||
<a name="OPENWEATHERdefine"></a>
|
||||
<b>Define</b>
|
||||
@ -440,26 +426,28 @@ OPENWEATHER_UpdateAborted($)
|
||||
<br>
|
||||
<code>define <name> OPENWEATHER <project> <cityCode> <apiKey> </code>
|
||||
<br>
|
||||
Example: <code>define wetter OPENWEATHER beispielprojekt DE0001020 3c551bc20819c19ee88c9ec94280a61d</code>
|
||||
<br>
|
||||
To obtain the below parameter a requistration of a personal project is necessary on <a href="http://www.wetter.com/apps_und_mehr/website/api/projekte/">www.wetter.com</a>.
|
||||
Example:
|
||||
<br>
|
||||
<code>define wetter OPENWEATHER projectx DE0001020 3c551bc20819c19ee88d</code>
|
||||
<br/><br/>
|
||||
To obtain the below parameter you have to create a new project on <a href="http://www.wetter.com/apps_und_mehr/website/api/projekte/">www.wetter.com</a>.
|
||||
<br/><br/>
|
||||
<li><code><project></code>
|
||||
<br>
|
||||
Name of the users 'openweather' project (create with a user account on the website).
|
||||
Name of the 'openweather' project (create with a user account on wetter.com).
|
||||
</li><br>
|
||||
<li><code><cityCode></code>
|
||||
<br>
|
||||
Code of the location for which the forecast is requested. Can be obtained from the URL of the weather forecast page of the concerned city.
|
||||
Code of the location for which the forecast is requested.
|
||||
The code is part of the URL of the weather forecast page. For example <i>DE0009042</i> in:
|
||||
<br>
|
||||
For example DE0009042 from <i>http://www.wetter.com/wetter_aktuell/aktuelles_wetter/deutschland/rostock/<u>DE0009042</u>.html</i>
|
||||
<i>http://www.wetter.com/wetter_aktuell/aktuelles_wetter/deutschland/rostock/<u>DE0009042</u>.html</i>
|
||||
</li><br>
|
||||
<li><code><apiKey></code>
|
||||
<br>
|
||||
Secret key the can be obtain after the users 'openweather' project is created on the web site.
|
||||
Secret key that is provided when the user creates a 'openweather' project on wetter.com.
|
||||
</li><br>
|
||||
</ul>
|
||||
<br>
|
||||
|
||||
<a name="OPENWEATHERset"></a>
|
||||
<b>Set</b>
|
||||
@ -475,7 +463,7 @@ OPENWEATHER_UpdateAborted($)
|
||||
<b>Get</b>
|
||||
<ul>
|
||||
<br>
|
||||
<li><code>set <name> apiResponse</code>
|
||||
<li><code>get <name> apiResponse</code>
|
||||
<br>
|
||||
Shows the response of the web site.
|
||||
</li><br>
|
||||
@ -492,16 +480,17 @@ OPENWEATHER_UpdateAborted($)
|
||||
<a name="OPENWEATHERreading"></a>
|
||||
<b>Forecast readings</b>
|
||||
<ul>
|
||||
Note! The forecast values have first to be selected on the project setup page on wetter.com.
|
||||
<br>
|
||||
<li><b>fc</b><i>0|1|2</i><b>_...</b> - forecast values for <i>today|tommorrow|in 2 days</i></li>
|
||||
<li><b>fc</b><i>0</i><b>_...<i>06|11|17|23</i></b> - forecast values for <i>today</i> at <i>06|11|17|23</i> o'clock</li>
|
||||
<li><b>fc</b><i>1</i><b>_temp</b><i>Min|Max</i> - <i>minimal|maximal</i> temperature <i>tommorrow</i> in °C</li>
|
||||
<li><b>fc</b><i>1</i><b>_temp</b><i>Min|Max</i> - <i>minimal|maximal</i> temperature for <i>tommorrow</i> in °C</li>
|
||||
<li><b>fc</b><i>0</i><b>_temp</b><i>Min06</i> - <i>minimal</i> temperatur <i>today</i> at <i>06:00</i> o'clock in °C</li>
|
||||
<li><b>fc</b><i>0</i><b>_presChange</b> - atmospheric pressure change <i>today</i></li>
|
||||
<li><b>fc</b><i>0</i><b>_valHours</b><i>06</i> - validity period of the forecast values in hours</li>
|
||||
<li><b>fc</b><i>0</i><b>_valHours</b><i>06</i> - validity period in hours of the forecast values starting at <i>06:00</i> o'clock</li>
|
||||
<li><b>fc</b><i>0</i><b>_weather</b> - weather situation <i>today</i></li>
|
||||
<li><b>fc</b><i>0</i><b>_wind</b> - wind speed <i>today</i> in km/h</li>
|
||||
<li><b>fc</b><i>0</i><b>_windDir</b> - wind direction <i>today</i> in °</li>
|
||||
<li><b>fc</b><i>0</i><b>_windDir</b> - wind direction <i>today</i> in ° (degree)</li>
|
||||
<li><b>fc</b><i>0</i><b>_windDirTxt</b> - wind direction <i>today</i> in text form</li>
|
||||
<li>etc.</li>
|
||||
</ul>
|
||||
@ -518,28 +507,32 @@ OPENWEATHER_UpdateAborted($)
|
||||
<div style="width:800px">
|
||||
<ul>
|
||||
<a name="OPENWEATHERdefine"></a>
|
||||
Das Modul extrahiert Wetterdaten über die <a href="http://www.wetter.com/apps_und_mehr/website/api/dokumentation">"openweather"-Schnittstelle</a> von <a href="http://www.wetter.com">www.wetter.com</a>.
|
||||
Das Modul extrahiert Wetterdaten über die <a href="http://www.wetter.com/apps_und_mehr/website/api/dokumentation">"openweather"-Schnittstelle (API)</a> von <a href="http://www.wetter.com">www.wetter.com</a>.
|
||||
<br/>
|
||||
Zuvor ist eine Registrierung auf der Webseite notwendig.
|
||||
<br/>
|
||||
Das Modul benötigt die Perlmodule HTTP::Request, LWP::UserAgent, HTML::Parse und Digest::MD5.
|
||||
Das Modul nutzt die Perlmodule HTTP::Request, LWP::UserAgent, HTML::Parse und Digest::MD5.
|
||||
<br/><br/>
|
||||
<b>Define</b>
|
||||
<ul>
|
||||
<br>
|
||||
<code>define <name> OPENWEATHER <Projekt> <Ortscode> <apiSchlüssel> </code>
|
||||
<code>define <name> OPENWEATHER <Projekt> <Ortscode> <apiSchlüssel></code>
|
||||
<br>
|
||||
Beispiel: <code>define wetter OPENWEATHER beispielprojekt DE0001020 3c551bc20819c19ee88c9ec94280a61d</code>
|
||||
Beispiel:
|
||||
<br>
|
||||
Um die unteren Paramter zu erhalten, ist die Registrierung eines eigenen Projektes auf <a href="http://www.wetter.com/apps_und_mehr/website/api/projekte/">www.wetter.com</a> notwendig.
|
||||
<code>define wetter OPENWEATHER projektx DE0001020 3c551bc20819c19ee88c9ec94280a61d</code>
|
||||
<br/><br/>
|
||||
Um die unteren Parameter zu erhalten, ist die Registrierung eines neuen Projektes auf <a href="http://www.wetter.com/apps_und_mehr/website/api/projekte/">www.wetter.com</a> notwendig.
|
||||
<br/><br/>
|
||||
<li><code><Projekt></code>
|
||||
<br>
|
||||
Name des benutzerspezifischen 'Openweather'-Projektes (erzeugt über ein Benutzerkonto auf der Website).
|
||||
Name des benutzerspezifischen 'openweather'-Projektes (erzeugt über ein Konto auf wetter.com).
|
||||
</li><br>
|
||||
<li><code><Ortscode></code>
|
||||
<br>
|
||||
Code des Ortes für den die Wettervorhersage benötigt wird. Er kann direkt aus der Adresszeile der jeweiligen Vorhersageseite genommen werden.
|
||||
Code des Ortes für den die Wettervorhersage benötigt wird. Er kann direkt aus der Adresszeile der jeweiligen Vorhersageseite genommen werden. Zum Beispiel <i>DE0009042</i> aus:
|
||||
<br>
|
||||
Zum Beispiel DE0009042 aus <i>http://www.wetter.com/wetter_aktuell/aktuelles_wetter/deutschland/rostock/<u>DE0009042</u>.html</i>
|
||||
<i>http://www.wetter.com/wetter_aktuell/aktuelles_wetter/deutschland/rostock/<u>DE0009042</u>.html</i>
|
||||
</li><br>
|
||||
<li><code><apiSchlüssel></code>
|
||||
<br>
|
||||
@ -561,7 +554,7 @@ OPENWEATHER_UpdateAborted($)
|
||||
<b>Get</b>
|
||||
<ul>
|
||||
<br>
|
||||
<li><code>set <name> apiResponse</code>
|
||||
<li><code>get <name> apiResponse</code>
|
||||
<br>
|
||||
Zeigt die Rückgabewerte der Website an.
|
||||
</li><br>
|
||||
@ -578,20 +571,21 @@ OPENWEATHER_UpdateAborted($)
|
||||
<a name="OPENWEATHERreading"></a>
|
||||
<b>Vorhersagewerte</b>
|
||||
<ul>
|
||||
Wichtig! Die Vorhersagewerte müssen zuerst in den Einstellungen des Projektes auf wetter.com ausgewählt werden.
|
||||
<br>
|
||||
<li><b>fc</b><i>0|1|2</i><b>_...</b> - Vorhersagewerte für <i>heute|morgen|übermorgen</i></li>
|
||||
<li><b>fc</b><i>0</i><b>_...<i>06|11|17|23</i></b> - Vorhersagewerte für <i>heute</i> um <i>06|11|17|23</i> Uhr</li>
|
||||
<li><b>fc</b><i>0</i><b>_temp</b><i>Min|Max</i> - <i>Mindest|Maximal</i>temperatur <i>heute</i> in °C</li>
|
||||
<li><b>fc</b><i>0</i><b>_temp</b><i>Min06</i> - <i>Mindest</i>temperatur <i>heute</i> um <i>06:00</i> Uhr in °C</li>
|
||||
<li><b>fc</b><i>0</i><b>_presChange</b> - <i>heutige</i> Änderung des Luftdruckes</li>
|
||||
<li><b>fc</b><i>0</i><b>_valHours</b><i>06</i> - Gültigkeitszeitraum der Prognose von <i>heute 6:00 Uhr</i> in Stunden</li>
|
||||
<li><b>fc</b><i>0</i><b>_valHours</b><i>06</i> - Gültigkeitszeitraum der Prognose von <i>heute</i> ab <i>6:00 Uhr</i> in Stunden</li>
|
||||
<li><b>fc</b><i>0</i><b>_weather</b> - Wetterzustand <i>heute</i></li>
|
||||
<li><b>fc</b><i>0</i><b>_wind</b> - Windgeschwindigkeit <i>heute</i> in km/h</li>
|
||||
<li><b>fc</b><i>0</i><b>_windDir</b> - Windrichtung <i>heute</i> in °</li>
|
||||
<li><b>fc</b><i>0</i><b>_windDir</b> - Windrichtung <i>heute</i> in ° (Grad)</li>
|
||||
<li><b>fc</b><i>0</i><b>_windDirTxt</b> - Windrichtung <i>heute</i> in Textform</li>
|
||||
<li>etc.</li>
|
||||
</ul>
|
||||
<br><br>
|
||||
<br/>
|
||||
</ul>
|
||||
</div>
|
||||
|
||||
|
@ -722,7 +722,7 @@ PROPLANTA_Html($)
|
||||
<ul>
|
||||
<br>
|
||||
<li><b>fc</b><i>0|1|2|3</i><b>_...</b> - forecast values for <i>today|tommorrow|in 2|3 days</i></li>
|
||||
<li><b>fc</b><i>0</i><b>_...<i>06|11|17|23</i></b> - forecast values for <i>today</i> at <i>00|03|06|09|12|15|18|21</i> o'clock</li>
|
||||
<li><b>fc</b><i>0</i><b>_...<i>00|03|06|09|12|15|18|21</i></b> - forecast values for <i>today</i> at <i>00|03|06|09|12|15|18|21</i> o'clock</li>
|
||||
<li><b>fc</b><i>0</i><b>_chOfRain</b><i>Day|Night</i> - chance of rain <i>today</i> by <i>day|night</i> in %</li>
|
||||
<li><b>fc</b><i>0</i><b>_chOfRain</b><i>15</i> - chance of rain <i>today</i> at <i>15:00</i> in %</li>
|
||||
<li><b>fc</b><i>0</i><b>_cloud</b><i>15</i> - cloud coverage <i>today</i> at <i>15:00</i> in %</li>
|
||||
@ -814,7 +814,7 @@ PROPLANTA_Html($)
|
||||
<ul>
|
||||
<br>
|
||||
<li><b>fc</b><i>0|1|2|3</i><b>_...</b> - Vorhersagewerte für <i>heute|morgen|übermorgen|in 3 Tagen</i></li>
|
||||
<li><b>fc</b><i>0</i><b>_...<i>06|11|17|23</i></b> - Vorhersagewerte für <i>heute</i> um <i>00|03|06|09|12|15|18|21</i> Uhr</li>
|
||||
<li><b>fc</b><i>0</i><b>_...<i>00|03|06|09|12|15|18|21</i></b> - Vorhersagewerte für <i>heute</i> um <i>00|03|06|09|12|15|18|21</i> Uhr</li>
|
||||
<li><b>fc</b><i>0</i><b>_chOfRain</b><i>Day|Night</i> - <i>heutiges</i> Niederschlagsrisiko <i>tagsüber|nachts</i> in %</li>
|
||||
<li><b>fc</b><i>1</i><b>_chOfRain</b><i>15</i> - <i>morgiges</i> Niederschlagsrisiko um <i>15</i>:00 Uhr in %</li>
|
||||
<li><b>fc</b><i>2</i><b>_cloud</b><i>15</i> - Wolkenbedeckungsgrad <i>übermorgen</i> um <i>15</i>:00 Uhr in %</li>
|
||||
|
Loading…
x
Reference in New Issue
Block a user