diff --git a/fhem/FHEM/36_LaCrosse.pm b/fhem/FHEM/36_LaCrosse.pm index f687eaf0a..a6d9d508b 100644 --- a/fhem/FHEM/36_LaCrosse.pm +++ b/fhem/FHEM/36_LaCrosse.pm @@ -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); diff --git a/fhem/FHEM/36_LaCrosseGateway.pm b/fhem/FHEM/36_LaCrosseGateway.pm index 9031b1869..82b995179 100644 --- a/fhem/FHEM/36_LaCrosseGateway.pm +++ b/fhem/FHEM/36_LaCrosseGateway.pm @@ -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);