From c00fb037d043e93e24c13e3455716e13665e1b2f Mon Sep 17 00:00:00 2001 From: nasseeder1 Date: Sun, 9 Aug 2020 12:40:04 +0000 Subject: [PATCH] 76_SMAPortal: contrib 3.4.0 git-svn-id: https://svn.fhem.de/fhem/trunk@22564 2b470e98-0d58-463d-a4d8-8e2adae1ed80 --- fhem/contrib/DS_Starter/76_SMAPortal.pm | 33 +++---------------------- 1 file changed, 3 insertions(+), 30 deletions(-) diff --git a/fhem/contrib/DS_Starter/76_SMAPortal.pm b/fhem/contrib/DS_Starter/76_SMAPortal.pm index 1bbc5c48a..0e1e3c30c 100644 --- a/fhem/contrib/DS_Starter/76_SMAPortal.pm +++ b/fhem/contrib/DS_Starter/76_SMAPortal.pm @@ -600,37 +600,10 @@ return; ############################################################### sub DbLog_split { my ($event, $device) = @_; - my $devhash = $defs{$device}; my ($reading, $value, $unit); - - if($event =~ m/[_\-fd]Consumption|Quote/x) { - $event =~ /^L(.*):\s(.*)\s(.*)/x; - if($1) { - $reading = "L".$1; - $value = $2; - $unit = $3; - } - } - if($event =~ m/Power|PV|FeedIn|SelfSupply|Temperature|Total|Energy|Hour:|Hour(\d\d):/x) { - $event =~ /^L(.*):\s(.*)\s(.*)/x; - if($1) { - $reading = "L".$1; - $value = $2; - $unit = $3; - } - } - if($event =~ m/Next04Hours-IsConsumption|RestOfDay-IsConsumption|Tomorrow-IsConsumption|Battery/x) { - $event =~ /^L(.*):\s(.*)\s(.*)/x; - if($1) { - $reading = "L".$1; - $value = $2; - $unit = $3; - } - } - if($event =~ m/summary/x && $event =~ /(.*):\s(.*)\s(.*)/x) { - $reading = $1; - $value = $2; - $unit = $3; + + if($event =~ /\s(Wh|W|kWh|%|h)$/xms) { + ($reading, $value, $unit) = $event =~ /(.*):\s(.*)\s(.*)/x; } return ($reading, $value, $unit);