2
0
mirror of https://github.com/fhem/fhem-mirror.git synced 2025-03-09 20:57:11 +00:00

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
This commit is contained in:
nasseeder1 2019-08-26 17:22:39 +00:00
parent eb6e80827a
commit c79067dfe5
2 changed files with 26 additions and 12 deletions

View File

@ -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

View File

@ -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 = "<a onClick=$cmdauto><img src=\"$FW_ME/www/images/default/10px-kreis-gruen.png\"></a>";
} elsif ($swstate =~ /off.*automatic.*/i) {
$swicon = "<a onClick=$cmdoff><img src=\"$FW_ME/www/images/default/10px-kreis-gelb.png\"></a>";
$swicon = "<a onClick=$cmdon><img src=\"$FW_ME/www/images/default/10px-kreis-gelb.png\"></a>";
}
if ($legend_style eq 'icon') { # mögliche Umbruchstellen mit normalen Blanks vorsehen !