2
0
mirror of https://github.com/fhem/fhem-mirror.git synced 2025-03-12 22:56:34 +00:00

sanity checks for CUL_WS

git-svn-id: https://svn.fhem.de/fhem/trunk@696 2b470e98-0d58-463d-a4d8-8e2adae1ed80
This commit is contained in:
rudolfkoenig 2010-08-14 11:42:46 +00:00
parent f183c68f36
commit 220929854e
5 changed files with 65 additions and 58 deletions

View File

@ -1,4 +1,4 @@
- =DATE= (4.10)
- =DATE= (5.0)
- feature: KM271
- bugfix: 99_SUNRISE_EL endless loop bug
- feature: CUL: optional baudrate spec in definition
@ -15,6 +15,12 @@
are connected, adjust matching rule
- feature: Copy&Paste in SVG
- feature: Debian/Ubuntu Package. Install-path changes to satisfy lintian
- feature: Allnet 3076/4027/4000T
- feature: RFXCOMM Module for Oregon Weatherstations
- feature: Davis VantagePro2
- feature: ELV USB-WDE1
- feature: addvaltriggers CUL attribute for adding RSSI as a trigger
- feature: CUL_WS sanity check for large temp differences.
- 2010-03-13 (4.9)
- bugfix: changed the fhem prompt from FHZ> to fhem>

View File

@ -1,4 +1,4 @@
# $Id: 14_CUL_WS.pm,v 1.26 2010-01-26 23:31:17 mr_p Exp $
# $Id: 14_CUL_WS.pm,v 1.27 2010-08-14 11:42:46 rudolfkoenig Exp $
#
##############################################
package main;
@ -279,60 +279,53 @@ CUL_WS_Parse($$)
}
Log GetLogLevel($name,4), "CUL_WS $devtype $name: $val";
# Sanity checks
if($NotifyTemperature && $hash->{READINGS}{temperature}{VAL}) {
my $tval = $hash->{READINGS}{strangetemp} ?
$hash->{READINGS}{strangetemp}{VAL} :
$hash->{READINGS}{temperature}{VAL};
my $diff = ($NotifyTemperature - $tval)+0;
if($diff < -15.0 || $diff > 15.0) {
Log 2, "$name: Temp difference ($diff) too large: $val, skipping it";
$hash->{READINGS}{strangetemp}{VAL} = $NotifyTemperature;
$hash->{READINGS}{strangetemp}{TIME} = $tm;
return "";
}
}
delete $hash->{READINGS}{strangetemp} if($hash->{READINGS});
if(defined($hum) && $hum < 0) {
if(defined($hum) && ($hum < 0 || $hum > 100)) {
Log 1, "BOGUS: $name reading: $val, skipping it";
return $name;
return "";
}
$hash->{STATE} = $val; # List overview
$hash->{READINGS}{state}{TIME} = TimeNow(); # For list
$hash->{READINGS}{state}{TIME} = $tm; # For list
$hash->{READINGS}{state}{VAL} = $val;
$hash->{CHANGED}[0] = $val; # For notify
my $i=1;
my $j;
my @Notifies=split(" ", $NotifyType);
for($j=0; $j<int(@Notifies); $j++) {
if($Notifies[$j] eq "T") {
$hash->{READINGS}{$NotifyMappings{$Notifies[$j]}}{TIME} = TimeNow();
$hash->{READINGS}{$NotifyMappings{$Notifies[$j]}}{VAL} = $NotifyTemperature;
$hash->{CHANGED}[$i++] = $NotifyMappings{$Notifies[$j]} . ": " . $NotifyTemperature;
} elsif($Notifies[$j] eq "H") {
$hash->{READINGS}{$NotifyMappings{$Notifies[$j]}}{TIME} = TimeNow();
$hash->{READINGS}{$NotifyMappings{$Notifies[$j]}}{VAL} = $NotifyHumidity;
$hash->{CHANGED}[$i++] = $NotifyMappings{$Notifies[$j]} . ": " . $NotifyHumidity;
} elsif($Notifies[$j] eq "R") {
$hash->{READINGS}{$NotifyMappings{$Notifies[$j]}}{TIME} = TimeNow();
$hash->{READINGS}{$NotifyMappings{$Notifies[$j]}}{VAL} = $NotifyRain;
$hash->{CHANGED}[$i++] = $NotifyMappings{$Notifies[$j]} . ": " . $NotifyRain;
} elsif($Notifies[$j] eq "W") {
$hash->{READINGS}{$NotifyMappings{$Notifies[$j]}}{TIME} = TimeNow();
$hash->{READINGS}{$NotifyMappings{$Notifies[$j]}}{VAL} = $NotifyWind;
$hash->{CHANGED}[$i++] = $NotifyMappings{$Notifies[$j]} . ": " . $NotifyWind;
} elsif($Notifies[$j] eq "WD") {
$hash->{READINGS}{$NotifyMappings{$Notifies[$j]}}{TIME} = TimeNow();
$hash->{READINGS}{$NotifyMappings{$Notifies[$j]}}{VAL} = $NotifyWindDir;
$hash->{CHANGED}[$i++] = $NotifyMappings{$Notifies[$j]} . ": " . $NotifyWindDir;
} elsif($Notifies[$j] eq "WS") {
$hash->{READINGS}{$NotifyMappings{$Notifies[$j]}}{TIME} = TimeNow();
$hash->{READINGS}{$NotifyMappings{$Notifies[$j]}}{VAL} = $NotifyWindSwing;
$hash->{CHANGED}[$i++] = $NotifyMappings{$Notifies[$j]} . ": " . $NotifyWindSwing;
} elsif($Notifies[$j] eq "IR") {
$hash->{READINGS}{$NotifyMappings{$Notifies[$j]}}{TIME} = TimeNow();
$hash->{READINGS}{$NotifyMappings{$Notifies[$j]}}{VAL} = $NotifyIsRaining;
$hash->{CHANGED}[$i++] = $NotifyMappings{$Notifies[$j]} . ": " . $NotifyIsRaining;
} elsif($Notifies[$j] eq "B") {
$hash->{READINGS}{$NotifyMappings{$Notifies[$j]}}{TIME} = TimeNow();
$hash->{READINGS}{$NotifyMappings{$Notifies[$j]}}{VAL} = $NotifyBrightness;
$hash->{CHANGED}[$i++] = $NotifyMappings{$Notifies[$j]} . ": " . $NotifyBrightness;
} elsif($Notifies[$j] eq "P") {
$hash->{READINGS}{$NotifyMappings{$Notifies[$j]}}{TIME} = TimeNow();
$hash->{READINGS}{$NotifyMappings{$Notifies[$j]}}{VAL} = $NotifyPressure;
$hash->{CHANGED}[$i++] = $NotifyMappings{$Notifies[$j]} . ": " . $NotifyPressure;
}
}
for($j=0; $j<int(@Notifies); $j++) {
my $val = "";
if($Notifies[$j] eq "T") { $val = $NotifyTemperature;
} elsif($Notifies[$j] eq "H") { $val = $NotifyHumidity;
} elsif($Notifies[$j] eq "R") { $val = $NotifyRain;
} elsif($Notifies[$j] eq "W") { $val = $NotifyWind;
} elsif($Notifies[$j] eq "WD") { $val = $NotifyWindDir;
} elsif($Notifies[$j] eq "WS") { $val = $NotifyWindSwing;
} elsif($Notifies[$j] eq "IR") { $val = $NotifyIsRaining;
} elsif($Notifies[$j] eq "B") { $val = $NotifyBrightness;
} elsif($Notifies[$j] eq "P") { $val = $NotifyPressure;
}
my $nm = $NotifyMappings{$Notifies[$j]};
$hash->{READINGS}{$nm}{TIME} = $tm;
$hash->{READINGS}{$nm}{VAL} = $val;
$hash->{CHANGED}[$i++] = "$nm: $val";
}
$hash->{READINGS}{DEVTYPE}{VAL}=$devtype;
$hash->{READINGS}{DEVTYPE}{TIME}=$tm;

View File

@ -1,6 +1,5 @@
FHEM:
- CUL_WS safety check
- document autocreate rename anomaly (rename filelog only)
- fix autocreate rename anomaly (rename filelog only)
- implement PID
- implement wiki decisions
- autodetect physical hardware

View File

@ -108,6 +108,9 @@
rename</a> to rename the automatically created device, e.g. type in the
input field of the web frontend:<pre>
rename FHT_1234 fht.kitchen</pre>
<b>NOTE</b>: you have to rename the device itself, the attached FileLog
and weblink will be renamed automatically. The other way round (renaming
the FileLog or weblink) does not work correctly right now.
</ul>

View File

@ -62,7 +62,10 @@
<ul>
Current Version: (as of =DATE=):
<a href="http://www.koeniglich.de/fhem/fhem-=VERS=.tar.gz">
http://www.koeniglich.de/fhem/fhem-=VERS=.tar.gz</a>
fhem-=VERS=.tar.gz</a>
or
<a href="http://www.koeniglich.de/fhem/fhem-=VERS=.deb">
fhem-=VERS=.deb</a>
<br>
See the <a href="CHANGED">CHANGED</a> file for current changes.
<br><br>
@ -130,44 +133,47 @@
href="http://www.busware.de">www.busware.de</a>) access to the
following protocols: FS20 (all devices), EM (EM1000EM, EM1000GZ and
EM1000WZ), FHT80b, HMS, S300 (KS300, S300TH, KS555, S555TH, etc)</li>
<br>
<li>Via an attached FHZ1000 or FHZ1300 access to the following protocols:
FS20 (all devices), FHT80b, HMS, KS300. <b>Note:</b> The FHZ1350 WLAN
works with fhem if you replace the standard (avisario) WLAN module with
one that won't encrypt the data.</li>
<br>
<li>reading and sending X10 events via the CM11 module (with access
to a X10 computer interface)</li>
<br>
<li>S300 devices via an attached WS300</li>
<br>
<li>EM1010PC and attached EM1000WZ, EM1000EM or EM1000GZ</li>
<br>
<li>reading attached SCIVT devices</li>
<br>
<li>reading attached M232 devices</li>
<br>
<li>reading attached WS2000/WS25000 devices, also via raw network
converters (xport)</li>
<br>
<li>extract sensor data from IPWE networked weather data receiver</li>
<br>
<li>Via an attached <a
href="http://owfs.org/index.php?page=usb-ds9490r">DS9490R</a> or <a
href="http://owfs.org/index.php?page=com-ds9097-passive">DS9097</a>
access to the following sensors: DS18S20, DS1820, DS18B20</li>
<br>
access to the following Dallas 1-wire sensors: DS18S20, DS1820,
DS18B20</li>
<li>Via an attached KM271 access to the Buderus Logamatic 2107</li>
<li>Allnet devices: Allnet 3076, Temperatures sensors and Allnet 4027
relay box connected to an Allnet 4000</li>
<li>Davis VantagePro2 weatherstation</li>
<li>RFXCOM RF receivers/transmitters e.g for different Oregon Scientific
weather sensors. Tested: BTHR918N, THGR810, THR128, THWR288A,
WTGR800.</li>
<li>Via the ELV USB-WDE1 access to the S300/S555 family of sensors.</li>
</ul>
<a name="Documentation"></a>