From c79067dfe5de1731599f5dcd2f733b2cc3d7974a Mon Sep 17 00:00:00 2001 From: nasseeder1 Date: Mon, 26 Aug 2019 17:22:39 +0000 Subject: [PATCH] 76_SMAPortal: change switch consumer to on<->automatic only in graphic overview git-svn-id: https://svn.fhem.de/fhem/trunk@20064 2b470e98-0d58-463d-a4d8-8e2adae1ed80 --- fhem/CHANGED | 2 ++ fhem/FHEM/76_SMAPortal.pm | 36 ++++++++++++++++++++++++------------ 2 files changed, 26 insertions(+), 12 deletions(-) diff --git a/fhem/CHANGED b/fhem/CHANGED index 213a13aae..8b1d4821f 100644 --- a/fhem/CHANGED +++ b/fhem/CHANGED @@ -1,5 +1,7 @@ # Add changes at the top of the list. Keep it in ASCII, and 80-char wide. # Do not insert empty lines here, update check depends on it. + - change: 76_SMAPortal: change switch consumer to on<->automatic only in + graphic overview - change: 93_DbLog: configCheck changed: check if new DbLog version is available or the local one is modified - feature: 93_DbRep: new attribute fetchValueFn to change displayed values of diff --git a/fhem/FHEM/76_SMAPortal.pm b/fhem/FHEM/76_SMAPortal.pm index 92923d528..d2e017fdc 100644 --- a/fhem/FHEM/76_SMAPortal.pm +++ b/fhem/FHEM/76_SMAPortal.pm @@ -162,6 +162,8 @@ use vars qw($FW_ME); # webname (default is fh # Versions History intern our %vNotesIntern = ( + "2.5.0" => "25.08.2019 change switch consumer to on<->automatic only in graphic overview, Forum: https://forum.fhem.de/index.php/topic,102112.msg969002.html#msg969002", + "2.4.5" => "22.08.2019 fix some warnings, Forum: https://forum.fhem.de/index.php/topic,102112.msg968829.html#msg968829 ", "2.4.4" => "11.07.2019 fix consinject to show multiple consumer icons if planned ", "2.4.3" => "07.07.2019 change header design of portal graphics again ", "2.4.2" => "02.07.2019 change header design of portal graphics ", @@ -432,22 +434,28 @@ sub DbLog_split($$) { my ($reading, $value, $unit); if($event =~ m/[_\-fd]Consumption|Quote/) { - $event =~ /^L(.*):\s(.*)\s(.*)/; - $reading = "L".$1; - $value = $2; - $unit = $3; + $event =~ /^L(.*):\s(.*)\s(.*)/; + if($1) { + $reading = "L".$1; + $value = $2; + $unit = $3; + } } if($event =~ m/Power|PV|FeedIn|SelfSupply|Temperature|Total|Energy|Hour:|Hour(\d\d):/) { $event =~ /^L(.*):\s(.*)\s(.*)/; - $reading = "L".$1; - $value = $2; - $unit = $3; + if($1) { + $reading = "L".$1; + $value = $2; + $unit = $3; + } } if($event =~ m/Next04Hours-IsConsumption|RestOfDay-IsConsumption|Tomorrow-IsConsumption|Battery/) { - $event =~ /^L(.*):\s(.*)\s(.*)/; - $reading = "L".$1; - $value = $2; - $unit = $3; + $event =~ /^L(.*):\s(.*)\s(.*)/; + if($1) { + $reading = "L".$1; + $value = $2; + $unit = $3; + } } if($event =~ m/summary/) { $event =~ /(.*):\s(.*)\s(.*)/; @@ -1440,6 +1448,7 @@ sub extractConsumerData($$) { $key =~ /^(\d+)_.*$/; my $lfn = $1; my $cn = $consumers{"${lfn}_ConsumerName"}; # Verbrauchername + next if(!$cn); $cn = replaceJunkSigns($cn); # evtl. Umlaute/Leerzeichen im Verbrauchernamen ersetzen my $pos = $consumers{"${lfn}_PlannedOpTimeStart"}; # geplanter Start my $poe = $consumers{"${lfn}_PlannedOpTimeEnd"}; # geplantes Ende @@ -1493,6 +1502,7 @@ sub extractConsumerLiveData($$) { $consumers{"${i}_ConsumerLfd"} = $i; my $cpower = $c->{'Consume'}{'Measurement'}; # aktueller Energieverbrauch in W my $cn = $consumers{"${i}_ConsumerName"}; # Verbrauchername + next if(!$cn); $cn = replaceJunkSigns($cn); $hash->{HELPER}{CONSUMER}{$i}{DeviceName} = $cn; @@ -1517,6 +1527,7 @@ sub extractConsumerLiveData($$) { my $OperationAutoEna = $c->{'Parameters'}[2]{'Value'}; # Automatic Betrieb erlaubt ? my $ltchange = TimeAdjust($hash,$c->{'Parameters'}[0]{'Timestamp'}{'DateTime'},$tkind); # letzter Schaltzeitpunkt der Bluetooth-Steckdose (Verbraucher) my $cn = $consumers{"${i}_ConsumerName"}; # Verbrauchername + next if(!$cn); $cn = replaceJunkSigns($cn); # evtl. Umlaute/Leerzeichen im Verbrauchernamen ersetzen if(!$GriSwStt && $GriSwAuto) { @@ -1571,6 +1582,7 @@ sub extractConsumerHistData($$$) { $consumers{"${i}_ConsumerLfd"} = $i; my $cpower = $c->{'TotalEnergy'}{'Measurement'}; # Energieverbrauch im Timeframe in Wh my $cn = $consumers{"${i}_ConsumerName"}; # Verbrauchername + next if(!$cn); $cn = replaceJunkSigns($cn); if($tf =~ /month|year/) { @@ -1903,7 +1915,7 @@ sub PortalAsHtml ($$;$) { } elsif ($swstate eq "on") { $swicon = ""; } elsif ($swstate =~ /off.*automatic.*/i) { - $swicon = ""; + $swicon = ""; } if ($legend_style eq 'icon') { # mögliche Umbruchstellen mit normalen Blanks vorsehen !