From c4b3a9aba21e655aaf80800385e4f57f229515a0 Mon Sep 17 00:00:00 2001 From: nasseeder1 Date: Tue, 26 Mar 2019 17:40:00 +0000 Subject: [PATCH] 76_SMAPortal: contrib 1.5.3 git-svn-id: https://svn.fhem.de/fhem/trunk@19040 2b470e98-0d58-463d-a4d8-8e2adae1ed80 --- fhem/contrib/DS_Starter/76_SMAPortal.pm | 22 ++++++++++++++-------- 1 file changed, 14 insertions(+), 8 deletions(-) diff --git a/fhem/contrib/DS_Starter/76_SMAPortal.pm b/fhem/contrib/DS_Starter/76_SMAPortal.pm index 9b92e759f..6afcc54d2 100644 --- a/fhem/contrib/DS_Starter/76_SMAPortal.pm +++ b/fhem/contrib/DS_Starter/76_SMAPortal.pm @@ -128,6 +128,7 @@ BEGIN { readingsBulkUpdate readingsBulkUpdateIfChanged readingsBeginUpdate + readingsDelete readingsEndUpdate ReadingsVal RemoveInternalTimer @@ -141,6 +142,7 @@ BEGIN { # Versions History intern our %vNotesIntern = ( + "1.5.3" => "26.03.2019 delete L1_ErrorMessages, L1_WarningMessages if no errors or warnings occur ", "1.5.2" => "25.03.2019 prevent module from deactivation in case of unavailable Meta.pm ", "1.5.1" => "24.03.2019 fix \$VAR1 problem Forum: #27667.msg922983.html#msg922983 ", "1.5.0" => "23.03.2019 add consumer data ", @@ -641,7 +643,7 @@ sub ParseData($) { readingsBeginUpdate($hash); my ($FeedIn_done,$GridConsumption_done,$PV_done,$AutarkyQuote_done,$SelfConsumption_done) = (0,0,0,0,0); - my ($SelfConsumptionQuote_done,$SelfSupply_done) = (0,0); + my ($SelfConsumptionQuote_done,$SelfSupply_done,$errMsg,$warnMsg) = (0,0,0,0); for my $k (keys %$livedata_content) { my $new_val = ""; if (defined $livedata_content->{$k}) { @@ -666,13 +668,15 @@ sub ParseData($) { if ($new_val && $k !~ /__type/i) { Log3 $name, 4, "$name -> $k - $new_val"; readingsBulkUpdate($hash, "L1_$k", $new_val); - $FeedIn_done = 1 if($k =~ /^FeedIn$/); - $GridConsumption_done = 1 if($k =~ /^GridConsumption$/); - $PV_done = 1 if($k =~ /^PV$/); - $AutarkyQuote_done = 1 if($k =~ /^AutarkyQuote$/); - $SelfConsumption_done = 1 if($k =~ /^SelfConsumption$/); + $FeedIn_done = 1 if($k =~ /^FeedIn$/); + $GridConsumption_done = 1 if($k =~ /^GridConsumption$/); + $PV_done = 1 if($k =~ /^PV$/); + $AutarkyQuote_done = 1 if($k =~ /^AutarkyQuote$/); + $SelfConsumption_done = 1 if($k =~ /^SelfConsumption$/); $SelfConsumptionQuote_done = 1 if($k =~ /^SelfConsumptionQuote$/); - $SelfSupply_done = 1 if($k =~ /^SelfSupply$/); + $SelfSupply_done = 1 if($k =~ /^SelfSupply$/); + $errMsg = 1 if($k =~ /^ErrorMessages$/); + $warnMsg = 1 if($k =~ /^WarningMessages$/); } } } @@ -684,9 +688,11 @@ sub ParseData($) { readingsBulkUpdate($hash, "L1_SelfConsumption", 0) if(!$SelfConsumption_done); readingsBulkUpdate($hash, "L1_SelfConsumptionQuote", 0) if(!$SelfConsumptionQuote_done); readingsBulkUpdate($hash, "L1_SelfSupply", 0) if(!$SelfSupply_done); - readingsEndUpdate($hash, 1); + readingsDelete($hash,"L1_ErrorMessages") if(!$errMsg); + readingsDelete($hash,"L1_WarningMessages") if(!$warnMsg); + if ($forecast_content && $forecast_content !~ m/undefined/i) { # Auswertung der Forecast Daten extractForecastData($hash,$forecast_content);