From 2801267d2d3abefed13c55df1d881d2eb723374c Mon Sep 17 00:00:00 2001 From: icinger <> Date: Wed, 18 May 2016 04:12:51 +0000 Subject: [PATCH] 47_OBIS: New "ignoreUnknown"-Attribute git-svn-id: https://svn.fhem.de/fhem/trunk/fhem@11475 2b470e98-0d58-463d-a4d8-8e2adae1ed80 --- FHEM/47_OBIS.pm | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/FHEM/47_OBIS.pm b/FHEM/47_OBIS.pm index c3cb2cfc9..830e8078b 100644 --- a/FHEM/47_OBIS.pm +++ b/FHEM/47_OBIS.pm @@ -76,7 +76,7 @@ sub OBIS_Initialize($) $hash->{UndefFn} = "OBIS_Undef"; $hash->{AttrFn} = "OBIS_Attr"; - $hash->{AttrList}= "do_not_notify:1,0 interval offset_feed offset_energy IODev channels directions alignTime pollingMode:on,off unitReadings:on,off ". + $hash->{AttrList}= "do_not_notify:1,0 interval offset_feed offset_energy IODev channels directions alignTime pollingMode:on,off unitReadings:on,off ignoreUnknown:on,off ". $readingFnAttributes; } @@ -407,7 +407,7 @@ sub OBIS_Parse($$) $rmsg=~/^((?:\d{1,3}-\d{1,3}:)?\d{1,3}.\d{1,3}.\d{1,3})(?:\*\d{1,3})?(?:\(.*?\))?\((.*?)(?:\*.*)?\)/; my $chan=$hash->{helper}{Channels}{$channel} //$hash->{helper}{Channels}{$1} // $OBIS_channels{$1} //$channel;; if (length $2) { - readingsBulkUpdate($hash, $chan ,$2); + if (AttrVal($name,"ignoreUnknown","off") eq "off" || $chan ne $channel) {readingsBulkUpdate($hash, $chan ,$2);} } } } @@ -701,6 +701,8 @@ sub OBIS_decodeTL($){ Reduces CPU-load. unitReadings
Adds the units to the readings like w, wH, A etc. + ignoreUnknown
+ Ignores unknown OBIS-Data
@@ -768,8 +770,9 @@ sub OBIS_decodeTL($){ kann das zu einer spürbaren Senkung der Prozessorleistung führen. unitReadings
Hängt bei den Readings auch die Einheiten an, zB w, wH, A usw. + ignoreUnknown
+ Ignoriert unbekannte OBIS-Datensätze -
=end html_DE