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:
hcs-svn 2015-06-04 14:42:19 +00:00
parent cc2f2bbc3b
commit 21f0c87c2f
3 changed files with 1591 additions and 1420 deletions

View File

@ -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:
@ -229,10 +230,11 @@ sub LaCrosse_Parse($$) {
# | |--------------------------------------------------------- fix "WS" # | |--------------------------------------------------------- fix "WS"
# |------------------------------------------------------------ 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