mirror of
https://github.com/fhem/fhem-mirror.git
synced 2025-05-04 22:19:38 +00:00
36_LaCrosse.pm: new error reading for WS 1600
JeeLink_LaCrosse.hex and 36_LaCrosse-LaCrosseITPlusReader.zip: Fixes for WS 1600: - wrong 25.4 m/s readings - fixed wrong rain values for more info see http://forum.fhem.de/index.php/topic,14786.msg300597.html#msg300597 and the following posts git-svn-id: https://svn.fhem.de/fhem/trunk/fhem@8689 2b470e98-0d58-463d-a4d8-8e2adae1ed80
This commit is contained in:
parent
cc2f2bbc3b
commit
21f0c87c2f
@ -165,13 +165,14 @@ 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, $type, $channel, $temperature, $humidity, $windDirection, $windSpeed, $windGust, $rain );
|
my( @bytes, $addr, $typeNumber, $typeName, $battery_new, $battery_low, $error, $type, $channel, $temperature, $humidity, $windDirection, $windSpeed, $windGust, $rain );
|
||||||
$temperature = 0xFFFF;
|
$temperature = 0xFFFF;
|
||||||
$humidity = 0xFF;
|
$humidity = 0xFF;
|
||||||
$windDirection = 0xFFFF;
|
$windDirection = 0xFFFF;
|
||||||
$windSpeed = 0xFFFF;
|
$windSpeed = 0xFFFF;
|
||||||
$windGust = 0xFFFF;
|
$windGust = 0xFFFF;
|
||||||
$rain = 0xFFFF;
|
$rain = 0xFFFF;
|
||||||
|
$error = 0;
|
||||||
|
|
||||||
if( $msg =~ m/^OK 9/ ) {
|
if( $msg =~ m/^OK 9/ ) {
|
||||||
# Temperature sensor - Format:
|
# Temperature sensor - Format:
|
||||||
@ -230,9 +231,10 @@ sub LaCrosse_Parse($$) {
|
|||||||
# |------------------------------------------------------------ fix "OK"
|
# |------------------------------------------------------------ fix "OK"
|
||||||
#
|
#
|
||||||
# * Flags: 128 64 32 16 8 4 2 1
|
# * Flags: 128 64 32 16 8 4 2 1
|
||||||
# | |
|
# | | |
|
||||||
# | |--- New battery
|
# | | |-- New battery
|
||||||
# |------ ERROR
|
# | |------ ERROR
|
||||||
|
# |---------- Low battery
|
||||||
|
|
||||||
@bytes = split( ' ', substr($msg, 5) );
|
@bytes = split( ' ', substr($msg, 5) );
|
||||||
|
|
||||||
@ -241,7 +243,8 @@ sub LaCrosse_Parse($$) {
|
|||||||
$typeName = $typeNumber == 1 ? "TX22" : "unknown";
|
$typeName = $typeNumber == 1 ? "TX22" : "unknown";
|
||||||
|
|
||||||
$battery_new = $bytes[13] & 0x01;
|
$battery_new = $bytes[13] & 0x01;
|
||||||
$battery_low = $bytes[13] & 0x02;
|
$battery_low = $bytes[13] & 0x04;
|
||||||
|
$error = $bytes[13] & 0x02;
|
||||||
$type = 0;
|
$type = 0;
|
||||||
$channel = 1;
|
$channel = 1;
|
||||||
|
|
||||||
@ -366,6 +369,10 @@ sub LaCrosse_Parse($$) {
|
|||||||
|
|
||||||
readingsBeginUpdate($rhash);
|
readingsBeginUpdate($rhash);
|
||||||
|
|
||||||
|
if ($typeNumber > 0) {
|
||||||
|
readingsBulkUpdate($rhash, "error", $error ? "1" : "0");
|
||||||
|
}
|
||||||
|
|
||||||
# Battery state
|
# Battery state
|
||||||
readingsBulkUpdate($rhash, "battery$channel", $battery_low?"low":"ok");
|
readingsBulkUpdate($rhash, "battery$channel", $battery_low?"low":"ok");
|
||||||
|
|
||||||
|
File diff suppressed because it is too large
Load Diff
Binary file not shown.
Loading…
x
Reference in New Issue
Block a user