2
0
mirror of https://github.com/fhem/fhem-mirror.git synced 2025-01-31 18:59:33 +00:00

36_LaCrosseGateway.pm and 36_LaCrosse.pm: added readings for BME680

git-svn-id: https://svn.fhem.de/fhem/trunk@15483 2b470e98-0d58-463d-a4d8-8e2adae1ed80
This commit is contained in:
HCS 2017-11-23 20:03:23 +00:00
parent 9b184433b4
commit 7ccfce6441
2 changed files with 16 additions and 6 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, $gas );
my( @bytes, $addr, $typeNumber, $typeName, $battery_new, $battery_low, $error, $type, $channel, $temperature, $humidity, $windDirection, $windSpeed, $windGust, $rain, $pressure, $gas, $debug );
$temperature = 0xFFFF;
$humidity = 0xFF;
$windDirection = 0xFFFF;
@ -177,6 +177,7 @@ sub LaCrosse_Parse($$) {
$rain = 0xFFFF;
$pressure = 0xFFFF;
$gas = 0xFFFFFF;
$debug = 0xFFFFFF;
$error = 0;
if( $msg =~ m/^OK 9/ ) {
@ -320,6 +321,11 @@ sub LaCrosse_Parse($$) {
if(@bytes > 18 && $bytes[16] != 0xFF) {
$gas = $bytes[16] * 65536 + $bytes[17] * 256 + $bytes[18];
}
if(@bytes > 21 && $bytes[19] != 0xFF) {
$debug = $bytes[19] * 65536 + $bytes[20] * 256 + $bytes[21];
readingsBulkUpdate($hash, "debug", $debug);
}
}
else {
@ -540,6 +546,10 @@ sub LaCrosse_Parse($$) {
if ($typeNumber > 0 && $gas != 0xFFFFFF) {
readingsBulkUpdate($rhash, "gas", $gas );
}
if ($typeNumber > 0 && $debug != 0xFFFFFF) {
readingsBulkUpdate($rhash, "debug", $debug );
}
readingsEndUpdate($rhash,1);

View File

@ -579,11 +579,11 @@ sub LaCrosseGateway_HandleOwnSensors($$) {
readingsEndUpdate($hash, 1);
delete $hash->{READINGS}{"temperature"} if !$temperature;
delete $hash->{READINGS}{"humidity"} if !$humidity;
delete $hash->{READINGS}{"pressure"} if !$pressure;
delete $hash->{READINGS}{"gas"} if !$gas;
delete $hash->{READINGS}{"debug"} if !$debug;
delete $hash->{READINGS}{"temperature"} if $temperature == undef;
delete $hash->{READINGS}{"humidity"} if $humidity == undef;
delete $hash->{READINGS}{"pressure"} if $pressure == undef;
delete $hash->{READINGS}{"gas"} if $gas == undef;
delete $hash->{READINGS}{"debug"} if $debug == undef;
}
#=======================================================================================