mirror of
https://github.com/fhem/fhem-mirror.git
synced 2025-03-03 16:56:54 +00:00
36_LaCrosseGateway.pm, 36_LaCrosse.pm: prepared for IAQ and pressure decimals
git-svn-id: https://svn.fhem.de/fhem/trunk@15263 2b470e98-0d58-463d-a4d8-8e2adae1ed80
This commit is contained in:
parent
adb1743e25
commit
09edc21778
@ -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 );
|
||||
my( @bytes, $addr, $typeNumber, $typeName, $battery_new, $battery_low, $error, $type, $channel, $temperature, $humidity, $windDirection, $windSpeed, $windGust, $rain, $pressure, $iaq );
|
||||
$temperature = 0xFFFF;
|
||||
$humidity = 0xFF;
|
||||
$windDirection = 0xFFFF;
|
||||
@ -176,6 +176,7 @@ sub LaCrosse_Parse($$) {
|
||||
$windGust = 0xFFFF;
|
||||
$rain = 0xFFFF;
|
||||
$pressure = 0xFFFF;
|
||||
$iaq = 0xFFFF;
|
||||
$error = 0;
|
||||
|
||||
if( $msg =~ m/^OK 9/ ) {
|
||||
@ -313,6 +314,11 @@ sub LaCrosse_Parse($$) {
|
||||
|
||||
if(@bytes > 15 && $bytes[14] != 0xFF) {
|
||||
$pressure = $bytes[14] * 256 + $bytes[15];
|
||||
$pressure /= 10.0 if $pressure > 5000;
|
||||
}
|
||||
|
||||
if(@bytes > 17 && $bytes[16] != 0xFF) {
|
||||
$iaq = $bytes[16] * 256 + $bytes[17];
|
||||
}
|
||||
|
||||
}
|
||||
@ -530,6 +536,10 @@ sub LaCrosse_Parse($$) {
|
||||
if ($typeNumber > 0 && $pressure != 0xFFFF) {
|
||||
readingsBulkUpdate($rhash, "pressure", $pressure );
|
||||
}
|
||||
|
||||
if ($typeNumber > 0 && $iaq != 0xFFFF) {
|
||||
readingsBulkUpdate($rhash, "iaq", $iaq );
|
||||
}
|
||||
|
||||
readingsEndUpdate($rhash,1);
|
||||
|
||||
|
@ -522,6 +522,7 @@ sub LaCrosseGateway_DeleteOwnSensorsReadings($) {
|
||||
delete $hash->{READINGS}{"temperature"};
|
||||
delete $hash->{READINGS}{"humidity"};
|
||||
delete $hash->{READINGS}{"pressure"};
|
||||
delete $hash->{READINGS}{"iaq"};
|
||||
}
|
||||
|
||||
#=======================================================================================
|
||||
@ -536,6 +537,7 @@ sub LaCrosseGateway_HandleOwnSensors($$) {
|
||||
my $temperature = undef;
|
||||
my $humidity = undef;
|
||||
my $pressure = undef;
|
||||
my $iaq = undef;
|
||||
|
||||
if($bytes[2] != 0xFF) {
|
||||
$temperature = ($bytes[2]*256 + $bytes[3] - 1000)/10;
|
||||
@ -549,8 +551,14 @@ sub LaCrosseGateway_HandleOwnSensors($$) {
|
||||
|
||||
if(@bytes > 15 && $bytes[14] != 0xFF) {
|
||||
$pressure = $bytes[14] * 256 + $bytes[15];
|
||||
$pressure /= 10.0 if $pressure > 5000;
|
||||
readingsBulkUpdate($hash, "pressure", $pressure);
|
||||
}
|
||||
|
||||
if(@bytes > 17 && $bytes[16] != 0xFF) {
|
||||
$iaq = $bytes[16] * 256 + $bytes[17];
|
||||
readingsBulkUpdate($hash, "iaq", $iaq);
|
||||
}
|
||||
|
||||
readingsEndUpdate($hash, 1);
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user