2
0
mirror of https://github.com/fhem/fhem-mirror.git synced 2025-03-09 20:57:11 +00:00

36_LaCrosse.pm/36_LaCrosseGateway.pm: increased gas range

git-svn-id: https://svn.fhem.de/fhem/trunk@15365 2b470e98-0d58-463d-a4d8-8e2adae1ed80
This commit is contained in:
HCS 2017-10-31 16:59:42 +00:00
parent 38861551bc
commit 15749165cb
2 changed files with 11 additions and 11 deletions

View File

@ -168,7 +168,7 @@ sub LaCrosse_Parse($$) {
my ($hash, $msg) = @_;
my $name = $hash->{NAME};
my( @bytes, $addr, $typeNumber, $typeName, $battery_new, $battery_low, $error, $type, $channel, $temperature, $humidity, $windDirection, $windSpeed, $windGust, $rain, $pressure, $iaq );
my( @bytes, $addr, $typeNumber, $typeName, $battery_new, $battery_low, $error, $type, $channel, $temperature, $humidity, $windDirection, $windSpeed, $windGust, $rain, $pressure, $gas );
$temperature = 0xFFFF;
$humidity = 0xFF;
$windDirection = 0xFFFF;
@ -176,7 +176,7 @@ sub LaCrosse_Parse($$) {
$windGust = 0xFFFF;
$rain = 0xFFFF;
$pressure = 0xFFFF;
$iaq = 0xFFFF;
$gas = 0xFFFFFF;
$error = 0;
if( $msg =~ m/^OK 9/ ) {
@ -317,8 +317,8 @@ sub LaCrosse_Parse($$) {
$pressure /= 10.0 if $pressure > 5000;
}
if(@bytes > 17 && $bytes[16] != 0xFF) {
$iaq = $bytes[16] * 256 + $bytes[17];
if(@bytes > 18 && $bytes[16] != 0xFF) {
$gas = $bytes[16] * 65536 + $bytes[17] * 256 + $bytes[18];
}
}
@ -537,8 +537,8 @@ sub LaCrosse_Parse($$) {
readingsBulkUpdate($rhash, "pressure", $pressure );
}
if ($typeNumber > 0 && $iaq != 0xFFFF) {
readingsBulkUpdate($rhash, "iaq", $iaq );
if ($typeNumber > 0 && $gas != 0xFFFFFF) {
readingsBulkUpdate($rhash, "gas", $gas );
}
readingsEndUpdate($rhash,1);

View File

@ -522,7 +522,7 @@ sub LaCrosseGateway_DeleteOwnSensorsReadings($) {
delete $hash->{READINGS}{"temperature"};
delete $hash->{READINGS}{"humidity"};
delete $hash->{READINGS}{"pressure"};
delete $hash->{READINGS}{"iaq"};
delete $hash->{READINGS}{"gas"};
}
#=======================================================================================
@ -537,7 +537,7 @@ sub LaCrosseGateway_HandleOwnSensors($$) {
my $temperature = undef;
my $humidity = undef;
my $pressure = undef;
my $iaq = undef;
my $gas = undef;
if($bytes[2] != 0xFF) {
$temperature = ($bytes[2]*256 + $bytes[3] - 1000)/10;
@ -555,9 +555,9 @@ sub LaCrosseGateway_HandleOwnSensors($$) {
readingsBulkUpdate($hash, "pressure", $pressure);
}
if(@bytes > 17 && $bytes[16] != 0xFF) {
$iaq = $bytes[16] * 256 + $bytes[17];
readingsBulkUpdate($hash, "iaq", $iaq);
if(@bytes > 18 && $bytes[16] != 0xFF) {
$gas = $bytes[16] * 65536 + $bytes[17] * 256 + $bytes[18];
readingsBulkUpdate($hash, "gas", $gas);
}
readingsEndUpdate($hash, 1);