mirror of
https://github.com/fhem/fhem-mirror.git
synced 2025-05-01 20:20:10 +00:00
00_ElsnerWS: LOG changes
git-svn-id: https://svn.fhem.de/fhem/trunk/fhem@26087 2b470e98-0d58-463d-a4d8-8e2adae1ed80
This commit is contained in:
parent
7e3d652b44
commit
7b504f7f03
@ -198,7 +198,6 @@ sub ElsnerWS_Read($) {
|
|||||||
$hash->{PARTIAL} = '' if(length($hash->{PARTIAL}) > 203);
|
$hash->{PARTIAL} = '' if(length($hash->{PARTIAL}) > 203);
|
||||||
my $data = $hash->{PARTIAL} . uc(unpack('H*', $buf));
|
my $data = $hash->{PARTIAL} . uc(unpack('H*', $buf));
|
||||||
#Log3 $name, 5, "ElsnerWS $name received DATA: " . uc(unpack('H*', $buf));
|
#Log3 $name, 5, "ElsnerWS $name received DATA: " . uc(unpack('H*', $buf));
|
||||||
Log3 $name, 5, "ElsnerWS $name received DATA: $data";
|
|
||||||
|
|
||||||
while($data =~ m/^(57)(2B|2D)(.{36})(.{8})(03)(.*)/ ||
|
while($data =~ m/^(57)(2B|2D)(.{36})(.{8})(03)(.*)/ ||
|
||||||
$data =~ m/^(57)(2B|2D)(.{66})(.{8})(03)(.*)/ ||
|
$data =~ m/^(57)(2B|2D)(.{66})(.{8})(03)(.*)/ ||
|
||||||
@ -206,7 +205,7 @@ sub ElsnerWS_Read($) {
|
|||||||
my ($packetType, $ldata, $checksum, $etx, $rest) = ($1, $2 . $3, pack('H*', $4), hex($5), $6);
|
my ($packetType, $ldata, $checksum, $etx, $rest) = ($1, $2 . $3, pack('H*', $4), hex($5), $6);
|
||||||
# data telegram incomplete
|
# data telegram incomplete
|
||||||
last if(!defined $etx);
|
last if(!defined $etx);
|
||||||
Log3 $name, 5, "ElsnerWS $name received $packetType, $ldata, $checksum, $etx";
|
#Log3 $name, 5, "ElsnerWS $name received $packetType, $ldata, $checksum, $etx";
|
||||||
last if($etx != 3);
|
last if($etx != 3);
|
||||||
my $tlen = length($ldata);
|
my $tlen = length($ldata);
|
||||||
$data = $ldata;
|
$data = $ldata;
|
||||||
@ -216,6 +215,9 @@ sub ElsnerWS_Read($) {
|
|||||||
$data = $rest;
|
$data = $rest;
|
||||||
next;
|
next;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Log3 $name, 5, "ElsnerWS $name received DATA: $data LEN: $tlen";
|
||||||
|
|
||||||
$data =~ m/^(..)(........)(....)(....)(....)(..)(......)(........)(..)(.*)/;
|
$data =~ m/^(..)(........)(....)(....)(....)(..)(......)(........)(..)(.*)/;
|
||||||
my ($temperatureSign, $temperature, $sunSouth, $sunWest, $sunEast, $twilightFlag, $brightness, $windSpeed, $isRaining, $zdata) = ($1, $2, $3, $4, $5, $6, $7, $8, $9, $10);
|
my ($temperatureSign, $temperature, $sunSouth, $sunWest, $sunEast, $twilightFlag, $brightness, $windSpeed, $isRaining, $zdata) = ($1, $2, $3, $4, $5, $6, $7, $8, $9, $10);
|
||||||
$sunSouth = pack('H*', $sunSouth) * 1000;
|
$sunSouth = pack('H*', $sunSouth) * 1000;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user