mirror of
https://github.com/fhem/fhem-mirror.git
synced 2025-05-01 20:20:10 +00:00
59_Weather: add wunderground documentation in commandref
git-svn-id: https://svn.fhem.de/fhem/trunk/fhem@21117 2b470e98-0d58-463d-a4d8-8e2adae1ed80
This commit is contained in:
parent
a4f75903dc
commit
7ee28f4021
1
CHANGED
1
CHANGED
@ -1,5 +1,6 @@
|
|||||||
# Add changes at the top of the list. Keep it in ASCII, and 80-char wide.
|
# Add changes at the top of the list. Keep it in ASCII, and 80-char wide.
|
||||||
# Do not insert empty lines here, update check depends on it.
|
# Do not insert empty lines here, update check depends on it.
|
||||||
|
- change: 59_Weather: add wunderground documentation in commandref
|
||||||
- feature mqtt2.template: add speech recognition extensions
|
- feature mqtt2.template: add speech recognition extensions
|
||||||
- bugfix: 73_AutoShuttersControl: fix AntiFreeze_Fn
|
- bugfix: 73_AutoShuttersControl: fix AntiFreeze_Fn
|
||||||
- feature 14_SD_UT: new model remote control Novy_840039
|
- feature 14_SD_UT: new model remote control Novy_840039
|
||||||
|
@ -32,7 +32,8 @@ package main;
|
|||||||
use strict;
|
use strict;
|
||||||
use warnings;
|
use warnings;
|
||||||
use Time::HiRes qw(gettimeofday);
|
use Time::HiRes qw(gettimeofday);
|
||||||
use HttpUtils;
|
#use HttpUtils;
|
||||||
|
use FHEM::Meta;
|
||||||
use vars qw($FW_ss);
|
use vars qw($FW_ss);
|
||||||
|
|
||||||
# use Data::Dumper; # for Debug only
|
# use Data::Dumper; # for Debug only
|
||||||
@ -273,7 +274,7 @@ sub Weather_Initialize($) {
|
|||||||
. $readingFnAttributes;
|
. $readingFnAttributes;
|
||||||
$hash->{NotifyFn} = 'Weather_Notify';
|
$hash->{NotifyFn} = 'Weather_Notify';
|
||||||
|
|
||||||
#Weather_DebugCodes('de');
|
return FHEM::Meta::InitMod( __FILE__, $hash );
|
||||||
}
|
}
|
||||||
|
|
||||||
###################################
|
###################################
|
||||||
@ -645,6 +646,9 @@ sub Weather_Notify($$) {
|
|||||||
sub Weather_Define($$) {
|
sub Weather_Define($$) {
|
||||||
my ( $hash, $def ) = @_;
|
my ( $hash, $def ) = @_;
|
||||||
|
|
||||||
|
return $@ unless ( FHEM::Meta::SetInternals($hash) );
|
||||||
|
use version 0.60; our $VERSION = FHEM::Meta::Get( $hash, 'version' );
|
||||||
|
|
||||||
my $usage =
|
my $usage =
|
||||||
"syntax: define <name> Weather [API=<API>] [apikey=<apikey>] [location=<location>] [interval=<interval>] [lang=<lang>]";
|
"syntax: define <name> Weather [API=<API>] [apikey=<apikey>] [location=<location>] [interval=<interval>] [lang=<lang>]";
|
||||||
|
|
||||||
@ -691,11 +695,11 @@ sub Weather_Define($$) {
|
|||||||
$hash->{MODEL} = $api;
|
$hash->{MODEL} = $api;
|
||||||
$hash->{APIKEY} = $apikey;
|
$hash->{APIKEY} = $apikey;
|
||||||
$hash->{APIOPTIONS} = $apioptions;
|
$hash->{APIOPTIONS} = $apioptions;
|
||||||
|
$hash->{VERSION} = version->parse($VERSION)->normal;
|
||||||
|
$hash->{fhem}->{allowCache} = 1;
|
||||||
|
|
||||||
readingsSingleUpdate($hash,'current_date_time',TimeNow(),0);
|
readingsSingleUpdate($hash,'current_date_time',TimeNow(),0);
|
||||||
readingsSingleUpdate($hash,'current_date_time','none',0);
|
readingsSingleUpdate($hash,'current_date_time','none',0);
|
||||||
#$hash->{READINGS}->{current_date_time}->{TIME} = TimeNow();
|
|
||||||
#$hash->{READINGS}->{current_date_time}->{VAL} = "none";
|
|
||||||
$hash->{fhem}->{allowCache} = 1;
|
|
||||||
|
|
||||||
readingsSingleUpdate( $hash, 'state', 'Initialized', 1 );
|
readingsSingleUpdate( $hash, 'state', 'Initialized', 1 );
|
||||||
Weather_LanguageInitialize( $hash->{LANG} );
|
Weather_LanguageInitialize( $hash->{LANG} );
|
||||||
@ -974,6 +978,7 @@ sub WeatherCheckOptions($@) {
|
|||||||
<ul>
|
<ul>
|
||||||
<li>DarkSky (<a href="https://darksky.net">web site</a>, standard)</li>
|
<li>DarkSky (<a href="https://darksky.net">web site</a>, standard)</li>
|
||||||
<li>OpenWeatherMap (<a href="https://openweathermap.org/">web site)</a></li>
|
<li>OpenWeatherMap (<a href="https://openweathermap.org/">web site)</a></li>
|
||||||
|
<li>Wunderground (<a href="https://www.wunderground.com/member/api-keys">web site)</a></li>
|
||||||
</ul>
|
</ul>
|
||||||
<br>
|
<br>
|
||||||
Such a virtual Weather device periodically gathers current and forecast
|
Such a virtual Weather device periodically gathers current and forecast
|
||||||
@ -1009,6 +1014,7 @@ sub WeatherCheckOptions($@) {
|
|||||||
<pre>
|
<pre>
|
||||||
define Forecast Weather apikey=987498ghjgf864
|
define Forecast Weather apikey=987498ghjgf864
|
||||||
define MyWeather Weather API=OpenWeatherMapAPI,cachemaxage:600 apikey=09878945fdskv876 location=52.4545,13.4545 interval=3600 lang=de
|
define MyWeather Weather API=OpenWeatherMapAPI,cachemaxage:600 apikey=09878945fdskv876 location=52.4545,13.4545 interval=3600 lang=de
|
||||||
|
define <name> Weather API=wundergroundAPI,stationId:IHAUIDELB111 apikey=ed64ccc80f004556a4e3456567800b6324a
|
||||||
</pre>
|
</pre>
|
||||||
|
|
||||||
|
|
||||||
@ -1040,6 +1046,20 @@ sub WeatherCheckOptions($@) {
|
|||||||
of the <code>global</code> device are taken, if these exist.</td></tr>
|
of the <code>global</code> device are taken, if these exist.</td></tr>
|
||||||
</table>
|
</table>
|
||||||
<p><p>
|
<p><p>
|
||||||
|
|
||||||
|
<b>Wunderground</b><p>
|
||||||
|
|
||||||
|
<table>
|
||||||
|
<tr><td>API</td><td><code>wundergroundAPI</code></td></tr>
|
||||||
|
<tr><td>apioptions</td><td><code>cachemaxage=<cachemaxage></code><br>duration
|
||||||
|
in seconds to retrieve the forecast from the cache instead from the API<br><code>stationId:ID-Num</code>
|
||||||
|
<br>Station ID of the station to be read.</td></tr>
|
||||||
|
<tr><td>location</td><td><code><latitude,longitude></code><br>
|
||||||
|
geographic coordinates in degrees of the location for which the
|
||||||
|
weather is forecast; if missing, the values of the attributes
|
||||||
|
of the <code>global</code> device are taken, if these exist.</td></tr>
|
||||||
|
</table>
|
||||||
|
<p><p>
|
||||||
|
|
||||||
The module provides four additional functions <code>WeatherAsHtml</code>,
|
The module provides four additional functions <code>WeatherAsHtml</code>,
|
||||||
<code>WeatherAsHtmlV</code>, <code>WeatherAsHtmlH</code> and
|
<code>WeatherAsHtmlV</code>, <code>WeatherAsHtmlH</code> and
|
||||||
@ -1148,6 +1168,7 @@ sub WeatherCheckOptions($@) {
|
|||||||
<ul>
|
<ul>
|
||||||
<li>DarkSky (<a href="https://darksky.net">Webseite</a>, Standard)</li>
|
<li>DarkSky (<a href="https://darksky.net">Webseite</a>, Standard)</li>
|
||||||
<li>OpenWeatherMap (<a href="https://openweathermap.org/">Webseite)</a></li>
|
<li>OpenWeatherMap (<a href="https://openweathermap.org/">Webseite)</a></li>
|
||||||
|
<li>Wunderground (<a href="https://www.wunderground.com/member/api-keys">Webseite)</a></li>
|
||||||
</ul>
|
</ul>
|
||||||
<br>
|
<br>
|
||||||
Eine solche virtuelle Wetterstation sammelt periodisch aktuelle Wetterdaten
|
Eine solche virtuelle Wetterstation sammelt periodisch aktuelle Wetterdaten
|
||||||
@ -1186,6 +1207,7 @@ sub WeatherCheckOptions($@) {
|
|||||||
<pre>
|
<pre>
|
||||||
define Forecast Weather apikey=987498ghjgf864
|
define Forecast Weather apikey=987498ghjgf864
|
||||||
define MyWeather Weather API=OpenWeatherMapAPI,cachemaxage:600 apikey=09878945fdskv876 location=52.4545,13.4545 interval=3600 lang=de
|
define MyWeather Weather API=OpenWeatherMapAPI,cachemaxage:600 apikey=09878945fdskv876 location=52.4545,13.4545 interval=3600 lang=de
|
||||||
|
define <name> Weather API=wundergroundAPI,stationId:IHAUIDELB111 apikey=ed64ccc80f004556a4e3456567800b6324a
|
||||||
</pre>
|
</pre>
|
||||||
|
|
||||||
Es folgt die API-spezifische Dokumentation.<p>
|
Es folgt die API-spezifische Dokumentation.<p>
|
||||||
@ -1218,6 +1240,21 @@ sub WeatherCheckOptions($@) {
|
|||||||
des <code>global</code>-Device genommen, sofern vorhanden.</td></tr>
|
des <code>global</code>-Device genommen, sofern vorhanden.</td></tr>
|
||||||
</table>
|
</table>
|
||||||
<p><p>
|
<p><p>
|
||||||
|
|
||||||
|
<b>Wunderground</b><p>
|
||||||
|
|
||||||
|
<table>
|
||||||
|
<tr><td>API</td><td><code>wundergroundAPI</code></td></tr>
|
||||||
|
<tr><td>apioptions</td><td><code>cachemaxage=<cachemaxage></code> Zeitdauer in
|
||||||
|
Sekunden, innerhalb derer die Wettervorhersage nicht neu abgerufen
|
||||||
|
sondern aus dem Cache zurück geliefert wird.<br><code>stationId:ID-Num</code>
|
||||||
|
<br>die ID der Station von welcher die Daten gelesen werden sollen.</td></tr>
|
||||||
|
<tr><td>location</td><td><code><latitude,longitude></code> Geographische Breite
|
||||||
|
und Länge des Ortes in Grad, für den das Wetter vorhergesagt wird.
|
||||||
|
Bei fehlender Angabe werden die Werte aus den gleichnamigen Attributen
|
||||||
|
des <code>global</code>-Device genommen, sofern vorhanden.</td></tr>
|
||||||
|
</table>
|
||||||
|
<p><p>
|
||||||
|
|
||||||
Das Modul unterstützt zusätzlich vier verschiedene Funktionen
|
Das Modul unterstützt zusätzlich vier verschiedene Funktionen
|
||||||
<code>WeatherAsHtml</code>, <code>WeatherAsHtmlV</code>,
|
<code>WeatherAsHtml</code>, <code>WeatherAsHtmlV</code>,
|
||||||
@ -1315,4 +1352,51 @@ sub WeatherCheckOptions($@) {
|
|||||||
</ul>
|
</ul>
|
||||||
|
|
||||||
=end html_DE
|
=end html_DE
|
||||||
|
|
||||||
|
=for :application/json;q=META.json 59_Weather.pm
|
||||||
|
{
|
||||||
|
"abstract": "Modul to provides current weather condition and forecast",
|
||||||
|
"x_lang": {
|
||||||
|
"de": {
|
||||||
|
"abstract": ""
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"keywords": [
|
||||||
|
"fhem-mod-device",
|
||||||
|
"fhem-core",
|
||||||
|
"Weather",
|
||||||
|
"DarkSky",
|
||||||
|
"OpenWeatherMap",
|
||||||
|
"Underground"
|
||||||
|
],
|
||||||
|
"release_status": "stable",
|
||||||
|
"license": "GPL_2",
|
||||||
|
"version": "v2.1.3",
|
||||||
|
"author": [
|
||||||
|
"Marko Oldenburg <leongaultier@gmail.com>"
|
||||||
|
],
|
||||||
|
"x_fhem_maintainer": [
|
||||||
|
"CoolTux"
|
||||||
|
],
|
||||||
|
"x_fhem_maintainer_github": [
|
||||||
|
"LeonGaultier"
|
||||||
|
],
|
||||||
|
"prereqs": {
|
||||||
|
"runtime": {
|
||||||
|
"requires": {
|
||||||
|
"FHEM": 5.00918799,
|
||||||
|
"perl": 5.016,
|
||||||
|
"Meta": 0,
|
||||||
|
"JSON": 0,
|
||||||
|
"Date::Parse": 0
|
||||||
|
},
|
||||||
|
"recommends": {
|
||||||
|
},
|
||||||
|
"suggests": {
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
=end :application/json;q=META.json
|
||||||
|
|
||||||
=cut
|
=cut
|
||||||
|
Loading…
x
Reference in New Issue
Block a user