From 6f1d69bc05051c756626038f4d64cbfd9c90f3c4 Mon Sep 17 00:00:00 2001 From: rudolfkoenig <> Date: Sat, 26 Oct 2024 11:27:37 +0000 Subject: [PATCH] 10_ZWave.pm: att noUnits attribute for METER data (Forum #126384) git-svn-id: https://svn.fhem.de/fhem/trunk@29298 2b470e98-0d58-463d-a4d8-8e2adae1ed80 --- fhem/FHEM/10_ZWave.pm | 17 ++++++++++++----- 1 file changed, 12 insertions(+), 5 deletions(-) diff --git a/fhem/FHEM/10_ZWave.pm b/fhem/FHEM/10_ZWave.pm index fe5768925..7b56cc035 100644 --- a/fhem/FHEM/10_ZWave.pm +++ b/fhem/FHEM/10_ZWave.pm @@ -792,6 +792,7 @@ ZWave_Initialize($) neighborListPos noExplorerFrames:1,0 noWakeupForApplicationUpdate:1,0 + noUnits:1,0 secure_classes setExtensionsEvent:1,0 setList @@ -1841,6 +1842,7 @@ my @meter_type_text = ( "cooling" ); +# 212400000000000000000000 => 0 kWh sub ZWave_meterParse($$) { @@ -1884,15 +1886,16 @@ ZWave_meterParse($$) # Log 1, "$v1 $v2 $v3 precision:$precision size:$size scale:$scale val:$mv"; $v3 = substr($v3, 2*$size, length($v3)-(2*$size)); + $unit_text = AttrVal($name, "noUnits", 0) ? "" : " $unit_text"; #126384 if (length($v3) < 4) { # V1 report - return "$meter_type_text:$mv $unit_text"; + return "$meter_type_text:$mv$unit_text"; } else { # V2 or greater report my $delta_time = hex(substr($v3, 0, 4)); $v3 = substr($v3, 4, length($v3)-4); if ($delta_time == 0) { # no previous meter value - return "$meter_type_text:$mv $unit_text"; + return "$meter_type_text:$mv$unit_text"; } else { # previous meter value present my $pmv = hex(substr($v3, 0, 2*$size)); @@ -1904,7 +1907,7 @@ ZWave_meterParse($$) } else { $delta_time .= " s"; }; - return "$meter_type_text:$mv $unit_text previous: $pmv delta_time: ". + return "$meter_type_text:$mv$unit_text previous: $pmv delta_time: ". "$delta_time"; # V2 report } } @@ -7494,14 +7497,18 @@ ZWave_tmSet($) turn off the use of Explorer Frames -