openweather: date

git-svn-id: https://svn.fhem.de/fhem/trunk@6964 2b470e98-0d58-463d-a4d8-8e2adae1ed80
This commit is contained in:
tpoitzsch 2014-11-13 20:44:43 +00:00
parent 73cfab96e8
commit 420f5d7e44
4 changed files with 53 additions and 53 deletions

View File

@ -119,9 +119,7 @@ use LWP::UserAgent;
use HTTP::Request; use HTTP::Request;
use HTML::Parser; use HTML::Parser;
# Modul Version for remote debugging
my $MODUL = "OPENWEATHER"; my $MODUL = "OPENWEATHER";
my $modulVersion = '# $Id$';
sub OPENWEATHER_Log($$$); sub OPENWEATHER_Log($$$);
sub OPENWEATHER_Start($); sub OPENWEATHER_Start($);
@ -194,8 +192,7 @@ OPENWEATHER_Define($$)
# Get first data after 7 seconds # Get first data after 7 seconds
InternalTimer(gettimeofday() + 7, "OPENWEATHER_Start", $hash, 0) if $interval > 0; InternalTimer(gettimeofday() + 7, "OPENWEATHER_Start", $hash, 0) if $interval > 0;
$hash->{fhem}{modulVersion} = '# $ID: $'; $hash->{fhem}{modulVersion} = '$Date$';
OPENWEATHER_Log $hash, 5, "OPENWEATHER.pm version is " . $hash->{fhem}{modulVersion};
return undef; return undef;
} #end OPENWEATHER_Define } #end OPENWEATHER_Define

View File

@ -331,7 +331,6 @@ use vars qw($readingFnAttributes);
use vars qw(%defs); use vars qw(%defs);
my $MODUL = "PROPLANTA"; my $MODUL = "PROPLANTA";
my $modulVersion = '# $Id$';
my %url_template_1 =( "de" => "http://www.proplanta.de/Wetter/LOKALERORT-Wetter.html" my %url_template_1 =( "de" => "http://www.proplanta.de/Wetter/LOKALERORT-Wetter.html"
, "at" => "http://www.proplanta.de/Agrarwetter-Oesterreich/LOKALERORT/" , "at" => "http://www.proplanta.de/Agrarwetter-Oesterreich/LOKALERORT/"
@ -397,7 +396,7 @@ sub PROPLANTA_Define($$)
$hash->{STATE} = "Initializing"; $hash->{STATE} = "Initializing";
$hash->{LOCAL} = 0; $hash->{LOCAL} = 0;
$hash->{INTERVAL} = 3600; $hash->{INTERVAL} = 3600;
$hash->{fhem}{modulVersion} = $modulVersion; $hash->{fhem}{modulVersion} = '$Date$';
RemoveInternalTimer($hash); RemoveInternalTimer($hash);

View File

@ -3,13 +3,13 @@
# #
# 70_JSONMETER.pm # 70_JSONMETER.pm
# #
# Copyright notice
#
# (c) 2014 Torsten Poitzsch < torsten . poitzsch at gmx . de > # (c) 2014 Torsten Poitzsch < torsten . poitzsch at gmx . de >
# #
# This module reads data from devices that provide OBIS compatible data # This module reads data from devices that provide OBIS compatible data
# in json format (e.g. power meters) # in json format (e.g. power meters)
# #
# Copyright notice
#
# This script is free software; you can redistribute it and/or modify # This script is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by # it under the terms of the GNU General Public License as published by
# the Free Software Foundation; either version 2 of the License, or # the Free Software Foundation; either version 2 of the License, or
@ -60,8 +60,7 @@ sub JSONMETER_doStatisticMinMax ($$$);
sub JSONMETER_doStatisticMinMaxSingle ($$$$); sub JSONMETER_doStatisticMinMaxSingle ($$$$);
sub JSONMETER_doStatisticDelta ($$$$$); sub JSONMETER_doStatisticDelta ($$$$$);
sub JSONMETER_doStatisticDeltaSingle ($$$$$$); sub JSONMETER_doStatisticDeltaSingle ($$$$$$);
# Modul Version for remote debugging
my $modulVersion = "2014-04-29";
my $MODUL = "JSONMETER"; my $MODUL = "JSONMETER";
############################################################## ##############################################################
# Syntax: meterType => port URL-Path # Syntax: meterType => port URL-Path
@ -200,8 +199,7 @@ JSONMETER_Define($$)
#Reset temporary values #Reset temporary values
$hash->{fhem}{jsonInterpreter} = ""; $hash->{fhem}{jsonInterpreter} = "";
$hash->{fhem}{modulVersion} = $modulVersion; $hash->{fhem}{modulVersion} = '$Date$';
JSONMETER_Log $hash, 5, "JSONMETER.pm version is $modulVersion.";
return undef; return undef;
} #end JSONMETER_Define } #end JSONMETER_Define
@ -906,6 +904,7 @@ JSONMETER_doStatisticDeltaSingle ($$$$$$)
<a name="JSONMETER"></a> <a name="JSONMETER"></a>
<h3>JSONMETER</h3> <h3>JSONMETER</h3>
<div style="width:800px">
<ul> <ul>
This module reads data from a measurement unit (so called smart meters for electricity, gas or heat) This module reads data from a measurement unit (so called smart meters for electricity, gas or heat)
<br> <br>
@ -918,17 +917,14 @@ JSONMETER_doStatisticDeltaSingle ($$$$$$)
<b>Define</b> <b>Define</b>
<ul> <ul>
<br>
<code>define &lt;name&gt; JSONMETER &lt;deviceType&gt; [&lt;ip address&gt;] [poll-interval]</code> <code>define &lt;name&gt; JSONMETER &lt;deviceType&gt; [&lt;ip address&gt;] [poll-interval]</code>
<br> <br>
Example: <code>define powermeter JSONMETER ITF 192.168.178.20 300</code> Example: <code>define powermeter JSONMETER ITF 192.168.178.20 300</code>
<br>&nbsp; <br>&nbsp;
<li><code>[poll-interval]</code>
<br>
Default is 300 seconds. Smallest possible value is 10. With 0 it will only update on "manual" request.
</li><br>
<li><code>&lt;deviceType&gt;</code> <li><code>&lt;deviceType&gt;</code>
<br> <br>
Used to define the path and port to extract the json file. Mandatory. Used to define the path and port to extract the json file.
<br> <br>
The attribute 'pathString' can be used to add login information to the URL path of predefined devices. The attribute 'pathString' can be used to add login information to the URL path of predefined devices.
<br>&nbsp; <br>&nbsp;
@ -944,6 +940,14 @@ JSONMETER_doStatisticDeltaSingle ($$$$$$)
<li><b>url</b> - use the URL defined via the attributes 'pathString' and 'port'</li> <li><b>url</b> - use the URL defined via the attributes 'pathString' and 'port'</li>
<li><b>file</b> - use the file defined via the attribute 'pathString' (positioned in the FHEM file system)</li> <li><b>file</b> - use the file defined via the attribute 'pathString' (positioned in the FHEM file system)</li>
</ul> </ul>
</li><br>
<li><code>[&lt;ip address&gt;]</code>
<br>
IP address of the phyisical device. (not needed for 'url' and 'file')
</li><br>
<li><code>[poll-interval]</code>
<br>
Optional. Default is 300 seconds. Smallest possible value is 10. With 0 it will only update on "manual" request.
</li> </li>
</ul> </ul>
<br> <br>
@ -991,45 +995,46 @@ JSONMETER_doStatisticDeltaSingle ($$$$$$)
<a name="JSONMETERattr"></a> <a name="JSONMETERattr"></a>
<b>Attributes</b> <b>Attributes</b>
<ul> <ul>
<li><code>alwaysAnalyse &lt; 0 | 1 &gt;</code> <li><code>alwaysAnalyse &lt; 0 | 1 &gt;</code>
<br> <br>
Repeats by each update the json analysis - use if structure of json data changes Repeats by each update the json analysis - use if structure of json data changes
<br> <br>
Normally the once analysed structure is saved to reduce CPU load. Normally the once analysed structure is saved to reduce CPU load.
</li><br> </li><br>
<li><code>doStatistics &lt; 0 | 1 &gt;</code> <li><code>doStatistics &lt; 0 | 1 &gt;</code>
<br> <br>
Builds daily, monthly and yearly statistics for certain readings (average/min/max or cumulated values). Builds daily, monthly and yearly statistics for certain readings (average/min/max or cumulated values).
<br> <br>
Logging and visualisation of the statistics should be done with readings of type 'stat<i>ReadingName</i><b>Last</b>'. Logging and visualisation of the statistics should be done with readings of type 'stat<i>ReadingName</i><b>Last</b>'.
</li><br> </li><br>
<li><code>pathString &lt;string&gt;</code> <li><code>pathString &lt;string&gt;</code>
<ul> <ul>
<li>if deviceType = 'file': specifies the local file name and path</li> <li>if deviceType = 'file': specifies the local file name and path</li>
<li>if deviceType = 'url': specifies the url path</li> <li>if deviceType = 'url': specifies the url path</li>
<li>other deviceType: can be used to add login information to the url path of predefined devices</li> <li>other deviceType: can be used to add login information to the url path of predefined devices</li>
</ul> </ul>
</li><br> </li><br>
<li><code>port &lt;number&gt;</code> <li><code>port &lt;number&gt;</code>
<br> <br>
Specifies the IP port for the deviceType 'url' (default is 80) Specifies the IP port for the deviceType 'url' (default is 80)
</li><br> </li><br>
<li><code>timeOut &lt;seconds&gt;</code> <li><code>timeOut &lt;seconds&gt;</code>
<br> <br>
Specifies the timeout for the reading of the raw data. (default is 10) Specifies the timeout for the reading of the raw data. (default is 10)
<br> <br>
The run time of the reading process can be measured via "get <device> jsonFile". The run time of the reading process can be measured via "get <device> jsonFile".
</li><br> </li><br>
<li><a href="#readingFnAttributes">readingFnAttributes</a></li> <li><a href="#readingFnAttributes">readingFnAttributes</a></li>
</ul> </ul>
</ul> </ul>
</div>
=end html =end html
=begin html_DE =begin html_DE
<a name="JSONMETER"></a> <a name="JSONMETER"></a>
<h3>JSONMETER</h3> <h3>JSONMETER</h3>
<div style="width:800px">
<ul> <ul>
Dieses Modul liest Daten von Messger&auml;ten (z.B. Stromz&auml;hler, Gasz&auml;hler oder W&auml;rmez&auml;hler, so genannte Smartmeter), Dieses Modul liest Daten von Messger&auml;ten (z.B. Stromz&auml;hler, Gasz&auml;hler oder W&auml;rmez&auml;hler, so genannte Smartmeter),
welche <a href="http://de.wikipedia.org/wiki/OBIS-Kennzahlen">OBIS</a> kompatible Daten im JSON-Format auf einem Webserver oder auf dem FHEM-Dateisystem zur Verf&uuml;gung stellen. welche <a href="http://de.wikipedia.org/wiki/OBIS-Kennzahlen">OBIS</a> kompatible Daten im JSON-Format auf einem Webserver oder auf dem FHEM-Dateisystem zur Verf&uuml;gung stellen.
@ -1146,7 +1151,7 @@ JSONMETER_doStatisticDeltaSingle ($$$$$$)
<li><a href="#readingFnAttributes">readingFnAttributes</a></li> <li><a href="#readingFnAttributes">readingFnAttributes</a></li>
</ul> </ul>
</ul> </ul>
</div>
=end html_DE =end html_DE
=cut =cut

View File

@ -53,7 +53,6 @@ sub statistics_maxDecPlaces($$);
sub statistics_UpdateDevReading($$$$); sub statistics_UpdateDevReading($$$$);
# Modul Version for remote debugging # Modul Version for remote debugging
my $modulVersion = "2014-07-06";
my $MODUL = "statistics"; my $MODUL = "statistics";
############################################################## ##############################################################
@ -147,7 +146,7 @@ statistics_Define($$)
$hash->{DEV_REGEXP} = $devName; $hash->{DEV_REGEXP} = $devName;
$hash->{STATE} = "Waiting for notifications"; $hash->{STATE} = "Waiting for notifications";
$hash->{fhem}{modulVersion} = $modulVersion; $hash->{fhem}{modulVersion} = '$Date$';
RemoveInternalTimer($hash); RemoveInternalTimer($hash);
@ -1019,7 +1018,7 @@ statistics_UpdateDevReading($$$$)
<a name="statistics"></a> <a name="statistics"></a>
<h3>statistics</h3> <h3>statistics</h3>
<div style="width:800px"> <div style="width:800px">
<ul> <ul>
This modul calculates for certain readings of given devices statistical values and adds them to the devices. This modul calculates for certain readings of given devices statistical values and adds them to the devices.
<br> <br>
@ -1117,7 +1116,7 @@ statistics_UpdateDevReading($$$$)
Allows the correct timely assignment within plots, can be adapted to CPU load. Allows the correct timely assignment within plots, can be adapted to CPU load.
<br> <br>
</li><br> </li><br>
<li><code>singularReadings &lt;DeviceRegExp:ReadingRegExp&gt;:statTypes:period</i></code> <li><code>singularReadings &lt;DeviceRegExp:ReadingRegExp&gt;:statTypes:period</code>
<ul> <ul>
<li>statTypes: Min|Avg|Max|Delta|Duration|<span style="color:blue;">Tendency</span></li> <li>statTypes: Min|Avg|Max|Delta|Duration|<span style="color:blue;">Tendency</span></li>
<li>period: Hour|Day|Month|Year|<span style="color:blue;">1h|2h|3h|6h</span></li> <li>period: Hour|Day|Month|Year|<span style="color:blue;">1h|2h|3h|6h</span></li>