mirror of
https://github.com/fhem/fhem-mirror.git
synced 2025-03-03 16:56:54 +00:00
allow only meaningful readings (fill level > -5%) in USF1000
git-svn-id: https://svn.fhem.de/fhem/trunk@633 2b470e98-0d58-463d-a4d8-8e2adae1ed80
This commit is contained in:
parent
63a5cd353c
commit
ed3b186322
@ -577,7 +577,7 @@
|
|||||||
(Gerhard Pfeffer / MartinH)
|
(Gerhard Pfeffer / MartinH)
|
||||||
- feature: pgm2 style changes, SVG in background, optional compression
|
- feature: pgm2 style changes, SVG in background, optional compression
|
||||||
|
|
||||||
- =DATE= (5.0)
|
- =DATE= (4.10)
|
||||||
- feature: KM271: Read only
|
- feature: KM271: Read only
|
||||||
- bugfix: 99_SUNRISE_EL endless loop bug
|
- bugfix: 99_SUNRISE_EL endless loop bug
|
||||||
- feature: CUL: optional baudrate spec in definition
|
- feature: CUL: optional baudrate spec in definition
|
||||||
@ -586,4 +586,5 @@
|
|||||||
- bugfix: DST change: absolute at and relative sunrise fix
|
- bugfix: DST change: absolute at and relative sunrise fix
|
||||||
- feature: FHEMWEB javascript additions for SVG plots (click on lines/labels)
|
- feature: FHEMWEB javascript additions for SVG plots (click on lines/labels)
|
||||||
- feature: FHEMWEB smallscreen attribute
|
- feature: FHEMWEB smallscreen attribute
|
||||||
- feature: Dimmer function of X10 module changed to match FS20 dimmer functions.
|
- feature: Dimmer function of X10 module changed to match FS20 dimmer functions.
|
||||||
|
- feature: allow only meaningful readings (fill level > -5%) in USF1000
|
@ -137,21 +137,25 @@ USF1000_Parse($$)
|
|||||||
$flevel = int($volume/$capacity*100.0+0.5);
|
$flevel = int($volume/$capacity*100.0+0.5);
|
||||||
$volume= int($volume/10.0+0.5)*10.0;
|
$volume= int($volume/10.0+0.5)*10.0;
|
||||||
|
|
||||||
|
if($flevel>-5) {
|
||||||
|
# reflections may lead to false reading (distance too large)
|
||||||
|
# the meaningless results are suppressed
|
||||||
|
|
||||||
my $state= sprintf("v: %d V: %d", $flevel, $volume);
|
my $state= sprintf("v: %d V: %d", $flevel, $volume);
|
||||||
|
|
||||||
$def->{CHANGED}[0] = $state;
|
$def->{CHANGED}[0] = $state;
|
||||||
$def->{STATE} = $state;
|
$def->{STATE} = $state;
|
||||||
$def->{READINGS}{state}{TIME} = $t;
|
$def->{READINGS}{state}{TIME} = $t;
|
||||||
$def->{READINGS}{state}{VAL} = $state;
|
$def->{READINGS}{state}{VAL} = $state;
|
||||||
Log GetLogLevel($name, 4), "USF1000 $name: $state";
|
Log GetLogLevel($name, 4), "USF1000 $name: $state";
|
||||||
|
|
||||||
$def->{READINGS}{distance}{TIME} = $t;
|
$def->{READINGS}{distance}{TIME} = $t;
|
||||||
$def->{READINGS}{distance}{VAL} = $distance;
|
$def->{READINGS}{distance}{VAL} = $distance;
|
||||||
$def->{READINGS}{level}{TIME} = $t;
|
$def->{READINGS}{level}{TIME} = $t;
|
||||||
$def->{READINGS}{level}{VAL} = $flevel;
|
$def->{READINGS}{level}{VAL} = $flevel;
|
||||||
$def->{READINGS}{volume}{TIME} = $t;
|
$def->{READINGS}{volume}{TIME} = $t;
|
||||||
$def->{READINGS}{volume}{VAL} = $volume;
|
$def->{READINGS}{volume}{VAL} = $volume;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
my $warnings= ($lowbattery ? "Battery low" : "");
|
my $warnings= ($lowbattery ? "Battery low" : "");
|
||||||
|
Loading…
x
Reference in New Issue
Block a user