mirror of
https://github.com/fhem/fhem-mirror.git
synced 2025-05-01 20:20:10 +00:00
36_Level.pm: added sensor type 1 (for hydrostatic)
git-svn-id: https://svn.fhem.de/fhem/trunk/fhem@19749 2b470e98-0d58-463d-a4d8-8e2adae1ed80
This commit is contained in:
parent
35c9fef6fb
commit
b31a25e402
@ -152,13 +152,21 @@ Level_Parse($$)
|
|||||||
push(@list, $rname);
|
push(@list, $rname);
|
||||||
|
|
||||||
$rhash->{Level_lastRcv} = TimeNow();
|
$rhash->{Level_lastRcv} = TimeNow();
|
||||||
|
$rhash->{SensorType} = $type;
|
||||||
|
|
||||||
readingsBeginUpdate($rhash);
|
readingsBeginUpdate($rhash);
|
||||||
|
|
||||||
my $litresPerCm = AttrVal( $rname, "litersPerCm", 1);
|
my $litresPerCm = AttrVal( $rname, "litersPerCm", 1);
|
||||||
my $distanceToBottom = AttrVal( $rname, "distanceToBottom", 100);
|
my $distanceToBottom = AttrVal( $rname, "distanceToBottom", 100);
|
||||||
|
|
||||||
my $level = $distanceToBottom - $distance;
|
my $level = -273;
|
||||||
|
if($type eq 1) {
|
||||||
|
$level = $distance;
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
$level = $distanceToBottom - $distance;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
my $litres = 0;
|
my $litres = 0;
|
||||||
my $formula = AttrVal( $rname, "formula", undef);
|
my $formula = AttrVal( $rname, "formula", undef);
|
||||||
@ -178,7 +186,9 @@ Level_Parse($$)
|
|||||||
|
|
||||||
$litres = int($litres);
|
$litres = int($litres);
|
||||||
|
|
||||||
readingsBulkUpdate($rhash, "distance", $distance);
|
if($type ne 1) {
|
||||||
|
readingsBulkUpdate($rhash, "distance", $distance);
|
||||||
|
}
|
||||||
readingsBulkUpdate($rhash, "level", $level);
|
readingsBulkUpdate($rhash, "level", $level);
|
||||||
readingsBulkUpdate($rhash, "liters", $litres);
|
readingsBulkUpdate($rhash, "liters", $litres);
|
||||||
readingsBulkUpdate($rhash, "temperature", $temperature);
|
readingsBulkUpdate($rhash, "temperature", $temperature);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user