Open rhabacker opened 2 years ago
For a related patch to fix this issue see below:
From 180b85f5e9db45e62b1a29d0078d7bd051188ec3 Mon Sep 17 00:00:00 2001
From: Ralf Habacker <ralf.habacker@freenet.de>
Date: Fri, 8 Jul 2022 21:57:15 +0000
Subject: [PATCH] Fix not parsing the value 0x02 correctly
https://github.com/mhop/fhem-mirror/issues/56
---
km271.pl | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/km271.pl b/km271.pl
index 5bbcfae..88b707a 100644
--- a/km271.pl
+++ b/km271.pl
@@ -134,7 +134,7 @@ for(;;) {
$buf = unpack('H*', $buf);
#printf("%s DEV %s\n", fmt_now(), $buf);
- if($buf eq "02") {
+ if($buf eq "02" && $tbuf eq "") {
$tbuf = "";
$po->write($dle);
next;
--
2.11.0
I am using https://github.com/mhop/fhem-mirror/blob/master/fhem/contrib/km271.pl to extract log data from a Buderus Logamatic 2107 and have discovered an error in the log data parser when a value is received as 0x02 as shown in the following example:
The data stream received from the device for the key
Betriebswerte_1_HK1 4
.is parsed correctly as
The data stream received for the key
Betriebswerte_2_HK1 2
.results in
which is not correct.
The reason for this problem is that parsing the second '02' value deletes all previously added data in
$tbuf
at https://github.com/mhop/fhem-mirror/blob/28c1647cef9a267624c29ffcb83fd8c4001d8c39/fhem/contrib/km271.pl#L138.