2
0
mirror of https://github.com/fhem/fhem-mirror.git synced 2025-03-13 23:36:37 +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@8689 2b470e98-0d58-463d-a4d8-8e2adae1ed80
This commit is contained in:
hcs-svn 2015-06-04 14:42:19 +00:00
parent fa89574eba
commit e63ba7018d
3 changed files with 1591 additions and 1420 deletions

View File

@ -165,13 +165,14 @@ sub LaCrosse_Parse($$) {
my ($hash, $msg) = @_;
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;
$humidity = 0xFF;
$windDirection = 0xFFFF;
$windSpeed = 0xFFFF;
$windGust = 0xFFFF;
$rain = 0xFFFF;
$error = 0;
if( $msg =~ m/^OK 9/ ) {
# Temperature sensor - Format:
@ -229,10 +230,11 @@ sub LaCrosse_Parse($$) {
# | |--------------------------------------------------------- fix "WS"
# |------------------------------------------------------------ fix "OK"
#
# * Flags: 128 64 32 16 8 4 2 1
# | |
# | |--- New battery
# |------ ERROR
# * Flags: 128 64 32 16 8 4 2 1
# | | |
# | | |-- New battery
# | |------ ERROR
# |---------- Low battery
@bytes = split( ' ', substr($msg, 5) );
@ -241,7 +243,8 @@ sub LaCrosse_Parse($$) {
$typeName = $typeNumber == 1 ? "TX22" : "unknown";
$battery_new = $bytes[13] & 0x01;
$battery_low = $bytes[13] & 0x02;
$battery_low = $bytes[13] & 0x04;
$error = $bytes[13] & 0x02;
$type = 0;
$channel = 1;
@ -366,6 +369,10 @@ sub LaCrosse_Parse($$) {
readingsBeginUpdate($rhash);
if ($typeNumber > 0) {
readingsBulkUpdate($rhash, "error", $error ? "1" : "0");
}
# Battery state
readingsBulkUpdate($rhash, "battery$channel", $battery_low?"low":"ok");

File diff suppressed because it is too large Load Diff