2
0
mirror of https://github.com/fhem/fhem-mirror.git synced 2025-01-31 06:39:11 +00:00

correction for negative values

git-svn-id: https://svn.fhem.de/fhem/trunk@2310 2b470e98-0d58-463d-a4d8-8e2adae1ed80
This commit is contained in:
oskarfessel 2012-12-09 18:08:43 +00:00
parent 94cca6df5c
commit 5ec3229ede
2 changed files with 20 additions and 15 deletions

View File

@ -142,7 +142,7 @@ LUXTRONIK2_GetStatus($)
Log 1, "LUXTRONIK2_GetStatus status report length check: $name $host ".length($result)." should have been ". $count * 4;
return "Value read mismatch Lux2 ( $!)\n";
}
@heatpump_values = unpack("N$count", $result);
@heatpump_values = unpack("N!$count", $result);
if(scalar(@heatpump_values) != $count) {
Log 2, "LUXTRONIK2_GetStatus10: $name $host ".scalar(@heatpump_values)." -> ".$heatpump_values[10];
return "Value unpacking problem";
@ -165,17 +165,19 @@ LUXTRONIK2_GetStatus($)
$socket->recv($result, $count*4+4);
if(length($result) != $count*4) {
Log 3, "LUXTRONIK2_GetStatus parameter settings length check: $name $host "
. length($result) . " should have been " . $count * 4;
my $loop = 4; # safety net in case of communication problems
while((length($result) < ($count * 4)) && ($loop-- > 0) ) {
my $result2;
my $newcnt = ($count * 4) - length($result);
$socket->recv($result2, $newcnt);
$result .= $result2;
Log 3, "LUXTRONIK2_GetStatus read additional " . length($result2)
. " bytes of expected " . $newcnt . " bytes, total should be "
. $count * 4 . " buflen=" . length($result);
# Log 3, "LUXTRONIK2_GetStatus read additional " . length($result2)
# . " bytes of expected " . $newcnt . " bytes, total should be "
# . $count * 4 . " buflen=" . length($result);
}
if($loop == 0) {
Log 3, "LUXTRONIK2_GetStatus parameter settings length check: $name $host "
. length($result) . " should have been " . $count * 4;
}
}
@heatpump_parameters = unpack("N$count", $result);

View File

@ -20,14 +20,17 @@ set ylabel "Temperature in C"
#FileLog 4:flowTemperature:0:
#FileLog 4:returnTemperatureTarget:0:
#FileLog 4:returnTemperature:0:
#FileLog 4:ambientTemperature:0:int
#FileLog 4:ambientTemperature:0:
#FileLog 4:averageAmbientTemperature:0:
plot \
"< awk '/temperature/{print $1, $4}' <IN>"\
using 1:2 axes x1y2 title 'Vorlauftemperatur' with lines,\
"< awk '/desired/{print $1, $4}' <IN>"\
using 1:2 axes x1y2 title 'Rücklauftemperatur SOLL' with lines,\
"< awk '/humidity/ {print $1, $4+0}' <IN>"\
using 1:2 axes x1y2 title 'Rücklauftemperatur' with lines,\
"< awk '/actuator/ {print $1, $4+0}' <IN>"\
using 1:2 axes x1y2 title 'Außentemperatur' with lines lw2\
"< awk '/flowTemperature/{print $1, $4}' <IN>"\
using 1:2 axes x1y1 title 'Vorlauftemperatur' with lines,\
"< awk '/returnTemperatureTarget/{print $1, $4}' <IN>"\
using 1:2 axes x1y1 title 'Rücklauftemperatur SOLL' with lines,\
"< awk '/returnTemperature/ {print $1, $4+0}' <IN>"\
using 1:2 axes x1y1 title 'Rücklauftemperatur' with lines,\
"< awk '/ambientTemperature/ {print $1, $4+0}' <IN>"\
using 1:2 axes x1y1 title 'Außentemperatur' with lines lw2,\
"< awk '/averageAmbient/ {print $1, $4+0}' <IN>"\
using 1:2 axes x1y1 title 'durchschnittliche Außentemperatur' with lines lw2\