diff --git a/CHANGED b/CHANGED
index 213a13aae..8b1d4821f 100644
--- a/CHANGED
+++ b/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/76_SMAPortal.pm b/FHEM/76_SMAPortal.pm
index 92923d528..d2e017fdc 100644
--- a/FHEM/76_SMAPortal.pm
+++ b/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 !