mirror of
https://github.com/fhem/fhem-mirror.git
synced 2025-03-10 03:06:37 +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:
parent
38861551bc
commit
15749165cb
@ -168,7 +168,7 @@ sub LaCrosse_Parse($$) {
|
|||||||
my ($hash, $msg) = @_;
|
my ($hash, $msg) = @_;
|
||||||
my $name = $hash->{NAME};
|
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;
|
$temperature = 0xFFFF;
|
||||||
$humidity = 0xFF;
|
$humidity = 0xFF;
|
||||||
$windDirection = 0xFFFF;
|
$windDirection = 0xFFFF;
|
||||||
@ -176,7 +176,7 @@ sub LaCrosse_Parse($$) {
|
|||||||
$windGust = 0xFFFF;
|
$windGust = 0xFFFF;
|
||||||
$rain = 0xFFFF;
|
$rain = 0xFFFF;
|
||||||
$pressure = 0xFFFF;
|
$pressure = 0xFFFF;
|
||||||
$iaq = 0xFFFF;
|
$gas = 0xFFFFFF;
|
||||||
$error = 0;
|
$error = 0;
|
||||||
|
|
||||||
if( $msg =~ m/^OK 9/ ) {
|
if( $msg =~ m/^OK 9/ ) {
|
||||||
@ -317,8 +317,8 @@ sub LaCrosse_Parse($$) {
|
|||||||
$pressure /= 10.0 if $pressure > 5000;
|
$pressure /= 10.0 if $pressure > 5000;
|
||||||
}
|
}
|
||||||
|
|
||||||
if(@bytes > 17 && $bytes[16] != 0xFF) {
|
if(@bytes > 18 && $bytes[16] != 0xFF) {
|
||||||
$iaq = $bytes[16] * 256 + $bytes[17];
|
$gas = $bytes[16] * 65536 + $bytes[17] * 256 + $bytes[18];
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
@ -537,8 +537,8 @@ sub LaCrosse_Parse($$) {
|
|||||||
readingsBulkUpdate($rhash, "pressure", $pressure );
|
readingsBulkUpdate($rhash, "pressure", $pressure );
|
||||||
}
|
}
|
||||||
|
|
||||||
if ($typeNumber > 0 && $iaq != 0xFFFF) {
|
if ($typeNumber > 0 && $gas != 0xFFFFFF) {
|
||||||
readingsBulkUpdate($rhash, "iaq", $iaq );
|
readingsBulkUpdate($rhash, "gas", $gas );
|
||||||
}
|
}
|
||||||
|
|
||||||
readingsEndUpdate($rhash,1);
|
readingsEndUpdate($rhash,1);
|
||||||
|
@ -522,7 +522,7 @@ sub LaCrosseGateway_DeleteOwnSensorsReadings($) {
|
|||||||
delete $hash->{READINGS}{"temperature"};
|
delete $hash->{READINGS}{"temperature"};
|
||||||
delete $hash->{READINGS}{"humidity"};
|
delete $hash->{READINGS}{"humidity"};
|
||||||
delete $hash->{READINGS}{"pressure"};
|
delete $hash->{READINGS}{"pressure"};
|
||||||
delete $hash->{READINGS}{"iaq"};
|
delete $hash->{READINGS}{"gas"};
|
||||||
}
|
}
|
||||||
|
|
||||||
#=======================================================================================
|
#=======================================================================================
|
||||||
@ -537,7 +537,7 @@ sub LaCrosseGateway_HandleOwnSensors($$) {
|
|||||||
my $temperature = undef;
|
my $temperature = undef;
|
||||||
my $humidity = undef;
|
my $humidity = undef;
|
||||||
my $pressure = undef;
|
my $pressure = undef;
|
||||||
my $iaq = undef;
|
my $gas = undef;
|
||||||
|
|
||||||
if($bytes[2] != 0xFF) {
|
if($bytes[2] != 0xFF) {
|
||||||
$temperature = ($bytes[2]*256 + $bytes[3] - 1000)/10;
|
$temperature = ($bytes[2]*256 + $bytes[3] - 1000)/10;
|
||||||
@ -555,9 +555,9 @@ sub LaCrosseGateway_HandleOwnSensors($$) {
|
|||||||
readingsBulkUpdate($hash, "pressure", $pressure);
|
readingsBulkUpdate($hash, "pressure", $pressure);
|
||||||
}
|
}
|
||||||
|
|
||||||
if(@bytes > 17 && $bytes[16] != 0xFF) {
|
if(@bytes > 18 && $bytes[16] != 0xFF) {
|
||||||
$iaq = $bytes[16] * 256 + $bytes[17];
|
$gas = $bytes[16] * 65536 + $bytes[17] * 256 + $bytes[18];
|
||||||
readingsBulkUpdate($hash, "iaq", $iaq);
|
readingsBulkUpdate($hash, "gas", $gas);
|
||||||
}
|
}
|
||||||
|
|
||||||
readingsEndUpdate($hash, 1);
|
readingsEndUpdate($hash, 1);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user