2
0
mirror of https://github.com/fhem/fhem-mirror.git synced 2025-04-30 12:07:09 +00:00

76_SolarForecast: see Forum: ..index.php?msg=1323142

git-svn-id: https://svn.fhem.de/fhem/trunk@29280 2b470e98-0d58-463d-a4d8-8e2adae1ed80
This commit is contained in:
nasseeder1 2024-10-22 08:26:16 +00:00
parent b207808b5c
commit 1ee5631a51

View File

@ -14593,19 +14593,19 @@ END3
$xchain = $xchain - ($pdist / 2 * ($count - 1)); $xchain = $xchain - ($pdist / 2 * ($count - 1));
} }
my $producer_style;
for my $lfn (@sorted) { for my $lfn (@sorted) {
my $pn = $pdcr->{$lfn}{pn}; my $pn = $pdcr->{$lfn}{pn};
my $p = $pdcr->{$lfn}{p}; my $p = $pdcr->{$lfn}{p};
my $consumer_style = "$name inactive"; $producer_style = $p > 0 ? "$name active_normal" : "$name inactive";
$consumer_style = "$name active_normal" if($p > 0);
my $chain_color = ''; # Farbe der Laufkette des Producers my $chain_color = ''; # Farbe der Laufkette des Producers
if ($p) { if ($p) {
#$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: #'.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;"';
} }
$ret .= qq{<path id="genproducer_${pn}_$name" class="$consumer_style" $chain_color d=" M$left,130 L$xchain,$ychain" />}; $ret .= qq{<path id="genproducer_${pn}_$name" class="$producer_style" $chain_color d=" M$left,130 L$xchain,$ychain" />};
$left += ($pdist * 2); $left += ($pdist * 2);
$xchain += $step; $xchain += $step;
} }
@ -14625,6 +14625,8 @@ END3
$cons_left_start = 700 - ($distance_con / 2 * ($consumercount-1)); $cons_left_start = 700 - ($distance_con / 2 * ($consumercount-1));
} }
my $consumer_style;
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 ?
@ -14636,13 +14638,11 @@ END3
my $p = $currentPower; my $p = $currentPower;
$p = (($currentPower / $power) * 100) if ($power > 0); $p = (($currentPower / $power) * 100) if ($power > 0);
my $consumer_style = "$name inactive"; $consumer_style = $p > $defpopercent ? "$name active_normal" : "$name inactive";
$consumer_style = "$name active_normal" if($p > $defpopercent);
my $chain_color = ""; # Farbe der Laufkette des Consumers my $chain_color = ""; # Farbe der Laufkette des Consumers
if ($p > 0.5) { if ($p > 0.5) {
$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: #'.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: #DF0101;"';
} }
$ret .= qq{<path id="home2consumer_${c}_$name" class="$consumer_style" $chain_color d="M$cons_left_start,780 L$cons_left,880" />}; $ret .= qq{<path id="home2consumer_${c}_$name" class="$consumer_style" $chain_color d="M$cons_left_start,780 L$cons_left,880" />};