mirror of
https://github.com/fhem/fhem-mirror.git
synced 2025-04-08 01:14:19 +00:00
76_SolarForecast: contrib 1.34.0
git-svn-id: https://svn.fhem.de/fhem/trunk@29188 2b470e98-0d58-463d-a4d8-8e2adae1ed80
This commit is contained in:
parent
51e5764df7
commit
42579f65c9
@ -13898,9 +13898,6 @@ sub _flowGraphic {
|
|||||||
my $consDist = $paref->{flowgconsDist};
|
my $consDist = $paref->{flowgconsDist};
|
||||||
my $css = $paref->{css};
|
my $css = $paref->{css};
|
||||||
|
|
||||||
my $hasbat = 1; # initial Batterie vorhanden
|
|
||||||
my $flowgprods = 1; # Producer in der Energieflußgrafik anzeigen per default
|
|
||||||
|
|
||||||
my $style = 'width:98%; height:'.$flowgsize.'px;';
|
my $style = 'width:98%; height:'.$flowgsize.'px;';
|
||||||
my $animation = $flowgani ? '@keyframes dash { to { stroke-dashoffset: 0; } }' : ''; # Animation Ja/Nein
|
my $animation = $flowgani ? '@keyframes dash { to { stroke-dashoffset: 0; } }' : ''; # Animation Ja/Nein
|
||||||
my $cgc = ReadingsNum ($name, 'Current_GridConsumption', 0);
|
my $cgc = ReadingsNum ($name, 'Current_GridConsumption', 0);
|
||||||
@ -13913,6 +13910,11 @@ sub _flowGraphic {
|
|||||||
my $soc = ReadingsNum ($name, 'Current_BatCharge', 100);
|
my $soc = ReadingsNum ($name, 'Current_BatCharge', 100);
|
||||||
my $cc_dummy = $cc;
|
my $cc_dummy = $cc;
|
||||||
|
|
||||||
|
my $hasbat = 1; # initial Batterie vorhanden
|
||||||
|
my $flowgprods = 1; # Producer in der Energieflußgrafik anzeigen per default
|
||||||
|
my $ppcurr = {}; # Hashref Producer current power
|
||||||
|
my $cpcurr = {}; # Hashref Consumer current power
|
||||||
|
|
||||||
## definierte Producer ermitteln und deren
|
## definierte Producer ermitteln und deren
|
||||||
## aktuelle Leistung bestimmen
|
## aktuelle Leistung bestimmen
|
||||||
############################################
|
############################################
|
||||||
@ -13921,10 +13923,12 @@ sub _flowGraphic {
|
|||||||
my @producers;
|
my @producers;
|
||||||
|
|
||||||
for my $i (1..$maxproducer) {
|
for my $i (1..$maxproducer) {
|
||||||
my $p = CurrentVal ($hash, 'generationp'.(sprintf "%02d", ($i)), undef);
|
my $pn = sprintf "%02d", $i;
|
||||||
|
my $p = CurrentVal ($hash, 'generationp'.$pn, undef);
|
||||||
|
|
||||||
if (defined $p) {
|
if (defined $p) {
|
||||||
push @producers, sprintf "%02d", $i;
|
push @producers, sprintf "%02d", $i;
|
||||||
|
$ppcurr->{$pn} = $p;
|
||||||
$producercount += 1;
|
$producercount += 1;
|
||||||
$ppall += $p;
|
$ppall += $p;
|
||||||
}
|
}
|
||||||
@ -13938,6 +13942,7 @@ sub _flowGraphic {
|
|||||||
for my $c (sort{$a<=>$b} keys %{$data{$type}{$name}{consumers}}) { # definierte Verbraucher ermitteln
|
for my $c (sort{$a<=>$b} keys %{$data{$type}{$name}{consumers}}) { # definierte Verbraucher ermitteln
|
||||||
next if(isConsumerNoshow ($hash, $c) =~ /^[13]$/xs); # auszublendende Consumer nicht berücksichtigen
|
next if(isConsumerNoshow ($hash, $c) =~ /^[13]$/xs); # auszublendende Consumer nicht berücksichtigen
|
||||||
push @consumers, $c;
|
push @consumers, $c;
|
||||||
|
$cpcurr->{$c} = ReadingsNum ($name, "consumer${c}_currentPower", 0);
|
||||||
$consumercount += 1;
|
$consumercount += 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -14072,9 +14077,13 @@ END0
|
|||||||
$pos_left = $producer_start + 25;
|
$pos_left = $producer_start + 25;
|
||||||
|
|
||||||
for my $prnxnum (@producers) {
|
for my $prnxnum (@producers) {
|
||||||
my $palias = CurrentVal ($hash, 'aliasp'.$prnxnum, 'Producer'.$prnxnum);
|
my $palias = CurrentVal ($hash, 'aliasp'.$prnxnum, 'Producer'.$prnxnum);
|
||||||
my $pcurr = CurrentVal ($hash, 'generationp'.$prnxnum, 0);
|
my $picon = __substituteIcon ( { hash => $hash, # Icon des Producerdevices
|
||||||
my $picon = __substituteIcon ({hash => $hash, name => $name, pn => $prnxnum, pcurr => $pcurr}); # Icon des Producerdevices
|
name => $name,
|
||||||
|
pn => $prnxnum,
|
||||||
|
pcurr => $ppcurr->{$prnxnum}
|
||||||
|
}
|
||||||
|
);
|
||||||
|
|
||||||
$ret .= '<g id="producer_'.$prnxnum.'" fill="grey" transform="translate('.$pos_left.',0),scale(0.15)">';
|
$ret .= '<g id="producer_'.$prnxnum.'" fill="grey" transform="translate('.$pos_left.',0),scale(0.15)">';
|
||||||
$ret .= "<title>$palias</title>".FW_makeImage($picon, '');
|
$ret .= "<title>$palias</title>".FW_makeImage($picon, '');
|
||||||
@ -14102,7 +14111,8 @@ END0
|
|||||||
|
|
||||||
for my $c (@consumers) {
|
for my $c (@consumers) {
|
||||||
my $calias = ConsumerVal ($hash, $c, "alias", ""); # Name des Consumerdevices
|
my $calias = ConsumerVal ($hash, $c, "alias", ""); # Name des Consumerdevices
|
||||||
$currentPower = ReadingsNum ($name, "consumer${c}_currentPower", 0);
|
#$currentPower = ReadingsNum ($name, "consumer${c}_currentPower", 0);
|
||||||
|
$currentPower = $cpcurr->{$c};
|
||||||
my $cicon = __substituteIcon ({hash => $hash, name => $name, cn => $c, pcurr => $currentPower}); # Icon des Consumerdevices
|
my $cicon = __substituteIcon ({hash => $hash, name => $name, cn => $c, pcurr => $currentPower}); # Icon des Consumerdevices
|
||||||
$cc_dummy -= $currentPower;
|
$cc_dummy -= $currentPower;
|
||||||
|
|
||||||
@ -14181,18 +14191,18 @@ END3
|
|||||||
$pos_left_start_con = 700 - ((($distance_con ) / 2) * ($producercount-1));
|
$pos_left_start_con = 700 - ((($distance_con ) / 2) * ($producercount-1));
|
||||||
}
|
}
|
||||||
|
|
||||||
for my $producer (@producers) {
|
for my $prnxnum (@producers) {
|
||||||
my $ppcurr = CurrentVal ($hash, 'generationp'.$producer, 0);
|
my $p = $ppcurr->{$prnxnum};
|
||||||
my $consumer_style = 'flowg inactive_out';
|
my $consumer_style = 'flowg inactive_out';
|
||||||
$consumer_style = 'flowg active_out' if($ppcurr > 0);
|
$consumer_style = 'flowg active_out' if($p > 0);
|
||||||
my $chain_color = ""; # Farbe der Laufkette des Producers
|
my $chain_color = ''; # Farbe der Laufkette des Producers
|
||||||
|
|
||||||
if ($ppcurr) {
|
if ($p) {
|
||||||
#$chain_color = 'style="stroke: #'.substr(Color::pahColor(0,50,100,$ppcurr,[0,255,0, 127,255,0, 255,255,0, 255,127,0, 255,0,0]),0,6).';"';
|
#$chain_color = 'style="stroke: #'.substr(Color::pahColor(0,50,100,$p,[0,255,0, 127,255,0, 255,255,0, 255,127,0, 255,0,0]),0,6).';"';
|
||||||
$chain_color = 'style="stroke: darkorange;"';
|
$chain_color = 'style="stroke: darkorange;"';
|
||||||
}
|
}
|
||||||
|
|
||||||
$ret .= qq{<path id="genproducer_$producer " class="$consumer_style" $chain_color d=" M$pos_left,130 L$pos_left_start_con,200" />}; # Design Consumer Laufkette
|
$ret .= qq{<path id="genproducer_$prnxnum " class="$consumer_style" $chain_color d=" M$pos_left,130 L$pos_left_start_con,200" />}; # Design Consumer Laufkette
|
||||||
$pos_left += ($consDist * 2);
|
$pos_left += ($consDist * 2);
|
||||||
$pos_left_start_con += $distance_con;
|
$pos_left_start_con += $distance_con;
|
||||||
}
|
}
|
||||||
@ -14215,7 +14225,8 @@ END3
|
|||||||
for my $c (@consumers) {
|
for my $c (@consumers) {
|
||||||
my $power = ConsumerVal ($hash, $c, "power", 0);
|
my $power = ConsumerVal ($hash, $c, "power", 0);
|
||||||
my $rpcurr = ConsumerVal ($hash, $c, "rpcurr", ""); # Reading für akt. Verbrauch angegeben ?
|
my $rpcurr = ConsumerVal ($hash, $c, "rpcurr", ""); # Reading für akt. Verbrauch angegeben ?
|
||||||
$currentPower = ReadingsNum ($name, "consumer${c}_currentPower", 0);
|
#$currentPower = ReadingsNum ($name, "consumer${c}_currentPower", 0);
|
||||||
|
$currentPower = $cpcurr->{$c};
|
||||||
|
|
||||||
if (!$rpcurr && isConsumerPhysOn($hash, $c)) { # Workaround wenn Verbraucher ohne Leistungsmessung
|
if (!$rpcurr && isConsumerPhysOn($hash, $c)) { # Workaround wenn Verbraucher ohne Leistungsmessung
|
||||||
$currentPower = $power;
|
$currentPower = $power;
|
||||||
@ -14257,7 +14268,7 @@ END3
|
|||||||
$pos_left = ($producer_start * 2) - 50; # -XX -> Start Lage producer Beschriftung
|
$pos_left = ($producer_start * 2) - 50; # -XX -> Start Lage producer Beschriftung
|
||||||
|
|
||||||
for my $prnxnum (@producers) {
|
for my $prnxnum (@producers) {
|
||||||
$currentPower = sprintf "%.2f", CurrentVal ($hash, 'generationp'.$prnxnum, 0);
|
$currentPower = sprintf "%.2f", $ppcurr->{$prnxnum};
|
||||||
$currentPower = sprintf "%.0f", $currentPower if($currentPower > 10);
|
$currentPower = sprintf "%.0f", $currentPower if($currentPower > 10);
|
||||||
|
|
||||||
# Leistungszahl abhängig von der Größe entsprechend auf der x-Achse verschieben
|
# Leistungszahl abhängig von der Größe entsprechend auf der x-Achse verschieben
|
||||||
@ -14308,7 +14319,8 @@ END3
|
|||||||
$pos_left = ($consumer_start * 2) - 50; # -XX -> Start Lage Consumer Beschriftung
|
$pos_left = ($consumer_start * 2) - 50; # -XX -> Start Lage Consumer Beschriftung
|
||||||
|
|
||||||
for my $c (@consumers) {
|
for my $c (@consumers) {
|
||||||
$currentPower = sprintf "%.1f", ReadingsNum($name, "consumer${c}_currentPower", 0);
|
#$currentPower = sprintf "%.1f", ReadingsNum($name, "consumer${c}_currentPower", 0);
|
||||||
|
$currentPower = sprintf "%.1f", $cpcurr->{$c};
|
||||||
$currentPower = sprintf "%.0f", $currentPower if($currentPower > 10);
|
$currentPower = sprintf "%.0f", $currentPower if($currentPower > 10);
|
||||||
my $consumerTime = ConsumerVal ($hash, $c, "remainTime", ""); # Restlaufzeit
|
my $consumerTime = ConsumerVal ($hash, $c, "remainTime", ""); # Restlaufzeit
|
||||||
my $rpcurr = ConsumerVal ($hash, $c, "rpcurr", ""); # Readingname f. current Power
|
my $rpcurr = ConsumerVal ($hash, $c, "rpcurr", ""); # Readingname f. current Power
|
||||||
|
Loading…
x
Reference in New Issue
Block a user