mirror of
https://github.com/fhem/fhem-mirror.git
synced 2025-05-01 20:20:10 +00:00
76_SolarForecast.pm: contrib 0.63.0
git-svn-id: https://svn.fhem.de/fhem/trunk/fhem@26058 2b470e98-0d58-463d-a4d8-8e2adae1ed80
This commit is contained in:
parent
d2a407819a
commit
e601b3cabb
@ -120,6 +120,7 @@ BEGIN {
|
|||||||
|
|
||||||
# Versions History intern
|
# Versions History intern
|
||||||
my %vNotesIntern = (
|
my %vNotesIntern = (
|
||||||
|
"0.63.0 "=> "18.05.2022 new attr flowGraphicConsumerDistance ",
|
||||||
"0.62.0 "=> "16.05.2022 new key 'swoffcond' in consumer attributes ",
|
"0.62.0 "=> "16.05.2022 new key 'swoffcond' in consumer attributes ",
|
||||||
"0.61.0 "=> "15.05.2022 limit PV forecast to inverter capacity ",
|
"0.61.0 "=> "15.05.2022 limit PV forecast to inverter capacity ",
|
||||||
"0.60.1 "=> "15.05.2022 consumerHash -> new key avgruntime, don't modify mintime by avgruntime by default anymore ".
|
"0.60.1 "=> "15.05.2022 consumerHash -> new key avgruntime, don't modify mintime by avgruntime by default anymore ".
|
||||||
@ -614,6 +615,7 @@ sub Initialize {
|
|||||||
"disable:1,0 ".
|
"disable:1,0 ".
|
||||||
"flowGraphicSize ".
|
"flowGraphicSize ".
|
||||||
"flowGraphicAnimate:1,0 ".
|
"flowGraphicAnimate:1,0 ".
|
||||||
|
"flowGraphicConsumerDistance:slider,80,10,500 ".
|
||||||
"flowGraphicShowConsumer:1,0 ".
|
"flowGraphicShowConsumer:1,0 ".
|
||||||
"flowGraphicShowConsumerDummy:1,0 ".
|
"flowGraphicShowConsumerDummy:1,0 ".
|
||||||
"flowGraphicShowConsumerPower:0,1 ".
|
"flowGraphicShowConsumerPower:0,1 ".
|
||||||
@ -4362,6 +4364,7 @@ sub entryGraphic {
|
|||||||
flowgconX => AttrVal ($name, 'flowGraphicShowConsumerDummy', 1), # Dummyverbraucher in der Energieflußgrafik anzeigen
|
flowgconX => AttrVal ($name, 'flowGraphicShowConsumerDummy', 1), # Dummyverbraucher in der Energieflußgrafik anzeigen
|
||||||
flowgconsPower => AttrVal ($name, 'flowGraphicShowConsumerPower' , 1), # Verbraucher Leistung in der Energieflußgrafik anzeigen
|
flowgconsPower => AttrVal ($name, 'flowGraphicShowConsumerPower' , 1), # Verbraucher Leistung in der Energieflußgrafik anzeigen
|
||||||
flowgconsTime => AttrVal ($name, 'flowGraphicShowConsumerRemainTime', 1), # Verbraucher Restlaufeit in der Energieflußgrafik anzeigen
|
flowgconsTime => AttrVal ($name, 'flowGraphicShowConsumerRemainTime', 1), # Verbraucher Restlaufeit in der Energieflußgrafik anzeigen
|
||||||
|
flowgconsDist => AttrVal ($name, 'flowGraphicConsumerDistance', 80), # Abstand Verbrauchericons zueinander
|
||||||
css => AttrVal ($name, 'Css', $cssdef), # Css Styles
|
css => AttrVal ($name, 'Css', $cssdef), # Css Styles
|
||||||
};
|
};
|
||||||
|
|
||||||
@ -5546,16 +5549,17 @@ sub _flowGraphic {
|
|||||||
my $flowgcons = $paref->{flowgcons};
|
my $flowgcons = $paref->{flowgcons};
|
||||||
my $flowgconX = $paref->{flowgconX};
|
my $flowgconX = $paref->{flowgconX};
|
||||||
my $flowgconPower = $paref->{flowgconsPower};
|
my $flowgconPower = $paref->{flowgconsPower};
|
||||||
my $flowgconTime = $paref->{flowgconsTime};
|
my $flowgconTime = $paref->{flowgconsTime};
|
||||||
|
my $consDist = $paref->{flowgconsDist};
|
||||||
my $css = $paref->{css};
|
my $css = $paref->{css};
|
||||||
|
|
||||||
my $style = 'width:'.$flowgh.'px; height:'.$flowgh.'px;';
|
my $style = 'width:'.$flowgh.'px; height:'.$flowgh.'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 $cpv = ReadingsNum($name, 'Current_PV', 0);
|
my $cpv = ReadingsNum($name, 'Current_PV', 0);
|
||||||
my $cgc = ReadingsNum($name, 'Current_GridConsumption', 0);
|
my $cgc = ReadingsNum($name, 'Current_GridConsumption', 0);
|
||||||
my $cgfi = ReadingsNum($name, 'Current_GridFeedIn', 0);
|
my $cgfi = ReadingsNum($name, 'Current_GridFeedIn', 0);
|
||||||
my $csc = ReadingsNum($name, 'Current_SelfConsumption', 0);
|
my $csc = ReadingsNum($name, 'Current_SelfConsumption', 0);
|
||||||
my $cc = ReadingsNum($name, 'Current_Consumption', 0);
|
my $cc = ReadingsNum($name, 'Current_Consumption', 0);
|
||||||
my $cc_dummy = $cc;
|
my $cc_dummy = $cc;
|
||||||
my $batin = ReadingsNum($name, 'Current_PowerBatIn', undef);
|
my $batin = ReadingsNum($name, 'Current_PowerBatIn', undef);
|
||||||
my $batout = ReadingsNum($name, 'Current_PowerBatOut', undef);
|
my $batout = ReadingsNum($name, 'Current_PowerBatOut', undef);
|
||||||
@ -5660,12 +5664,11 @@ END0
|
|||||||
|
|
||||||
## get consumer list and display it in Graphics
|
## get consumer list and display it in Graphics
|
||||||
################################################
|
################################################
|
||||||
my $pos_left = 0;
|
my $pos_left = 0;
|
||||||
my $consumercount = 0;
|
my $consumercount = 0;
|
||||||
my $consumer_start = 0;
|
my $consumer_start = 0;
|
||||||
my $consumer_distance = 80;
|
my $currentPower = 0;
|
||||||
my @consumers;
|
my @consumers;
|
||||||
my $currentPower = 0;
|
|
||||||
|
|
||||||
if ($flowgcons) {
|
if ($flowgcons) {
|
||||||
my $type = $hash->{TYPE};
|
my $type = $hash->{TYPE};
|
||||||
@ -5673,10 +5676,10 @@ END0
|
|||||||
$consumercount = scalar @consumers;
|
$consumercount = scalar @consumers;
|
||||||
|
|
||||||
if ($consumercount % 2) {
|
if ($consumercount % 2) {
|
||||||
$consumer_start = 350 - ($consumer_distance * (($consumercount -1) / 2));
|
$consumer_start = 350 - ($consDist * (($consumercount -1) / 2));
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
$consumer_start = 350 - ((($consumer_distance ) / 2) * ($consumercount-1));
|
$consumer_start = 350 - ((($consDist ) / 2) * ($consumercount-1));
|
||||||
}
|
}
|
||||||
|
|
||||||
$consumer_start = 0 if $consumer_start < 0;
|
$consumer_start = 0 if $consumer_start < 0;
|
||||||
@ -5692,7 +5695,7 @@ END0
|
|||||||
$ret .= "<title>$calias</title>".FW_makeImage($cicon, '');
|
$ret .= "<title>$calias</title>".FW_makeImage($cicon, '');
|
||||||
$ret .= '</g> ';
|
$ret .= '</g> ';
|
||||||
|
|
||||||
$pos_left += $consumer_distance;
|
$pos_left += $consDist;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -5734,10 +5737,13 @@ END3
|
|||||||
my $consumer_style = 'flowg inactive_out';
|
my $consumer_style = 'flowg inactive_out';
|
||||||
$consumer_style = 'flowg active_out' if($cc_dummy > 1);
|
$consumer_style = 'flowg active_out' if($cc_dummy > 1);
|
||||||
|
|
||||||
my $consumer_color = "";
|
my $chain_color = ""; # Farbe der Laufkette Donsumer-Dummy
|
||||||
$consumer_color = 'style="stroke: #'.substr(Color::pahColor(0,500,1000,$cc_dummy,[0,255,0, 127,255,0, 255,255,0, 255,127,0, 255,0,0]),0,6).';"' if($cc_dummy > 0.5);
|
if($cc_dummy > 0.5) {
|
||||||
|
$chain_color = 'style="stroke: #'.substr(Color::pahColor(0,500,1000,$cc_dummy,[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="home-consumer_X" class="$consumer_style" $consumer_color d="M780,620 L930,620" />};
|
$ret .= qq{<path id="home-consumer_X" class="$consumer_style" $chain_color d="M780,620 L930,620" />};
|
||||||
}
|
}
|
||||||
|
|
||||||
## get consumer list and display it in Graphics
|
## get consumer list and display it in Graphics
|
||||||
@ -5756,11 +5762,10 @@ END3
|
|||||||
|
|
||||||
for my $c1 (@consumers) {
|
for my $c1 (@consumers) {
|
||||||
my $power = ConsumerVal ($hash, $c1, "power", 0);
|
my $power = ConsumerVal ($hash, $c1, "power", 0);
|
||||||
my $rpcurr = ConsumerVal ($hash, $c1, "rpcurr", ""); # Reading für akt. Verbrauch angegeben ?
|
my $rpcurr = ConsumerVal ($hash, $c1, "rpcurr", ""); # Reading für akt. Verbrauch angegeben ?
|
||||||
#my $swstate = ConsumerVal ($hash, $c1, "state", "undef"); # Schaltzustand des Consumerdevices
|
|
||||||
$currentPower = ReadingsNum ($name, "consumer${c1}_currentPower", 0);
|
$currentPower = ReadingsNum ($name, "consumer${c1}_currentPower", 0);
|
||||||
|
|
||||||
if (!$rpcurr && isConsumerOn($hash, $c1)) { # Workaround wenn Verbraucher ohne Leistungsmessung
|
if (!$rpcurr && isConsumerOn($hash, $c1)) { # Workaround wenn Verbraucher ohne Leistungsmessung
|
||||||
$currentPower = $power;
|
$currentPower = $power;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -5770,13 +5775,16 @@ END3
|
|||||||
my $consumer_style = 'flowg inactive_out';
|
my $consumer_style = 'flowg inactive_out';
|
||||||
$consumer_style = 'flowg active_out' if($p > $defpopercent);
|
$consumer_style = 'flowg active_out' if($p > $defpopercent);
|
||||||
|
|
||||||
my $consumer_color = "";
|
my $chain_color = ""; # Farbe der Laufkette des Consumers
|
||||||
$consumer_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).';"' 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: #DF0101;"';
|
||||||
|
}
|
||||||
|
|
||||||
$ret .= qq{<path id="home-consumer_$c1" class="$consumer_style" $consumer_color d="M$pos_left_start,700 L$pos_left,850" />};
|
$ret .= qq{<path id="home-consumer_$c1" class="$consumer_style" $chain_color d="M$pos_left_start,700 L$pos_left,850" />};
|
||||||
|
|
||||||
$pos_left += ($consumer_distance * 2);
|
$pos_left += ($consDist * 2);
|
||||||
$pos_left_start += $distance;
|
$pos_left_start += $distance;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -5801,11 +5809,9 @@ END3
|
|||||||
$pos_left = ($consumer_start * 2) - 50;
|
$pos_left = ($consumer_start * 2) - 50;
|
||||||
|
|
||||||
for my $c2 (@consumers) {
|
for my $c2 (@consumers) {
|
||||||
$currentPower = sprintf("%.1f", ReadingsNum($name, "consumer${c2}_currentPower", 0));
|
$currentPower = sprintf("%.1f", ReadingsNum($name, "consumer${c2}_currentPower", 0));
|
||||||
|
my $consumerTime = ConsumerVal ($hash, $c2, "remainTime", ""); # Restlaufzeit
|
||||||
my $consumerTime = ConsumerVal ($hash, $c2, "remainTime", ""); # Restlaufzeit
|
my $rpcurr = ConsumerVal ($hash, $c2, "rpcurr", ""); # Readingname f. current Power
|
||||||
#my $swstate = ConsumerVal ($hash, $c2, "state", "undef"); # Schaltzustand des Consumerdevices
|
|
||||||
my $rpcurr = ConsumerVal ($hash, $c2, "rpcurr", ""); # Readingname f. current Power
|
|
||||||
|
|
||||||
if (!$rpcurr) { # Workaround wenn Verbraucher ohne Leistungsmessung
|
if (!$rpcurr) { # Workaround wenn Verbraucher ohne Leistungsmessung
|
||||||
$currentPower = isConsumerOn($hash, $c2) ? 'on' : 'off';
|
$currentPower = isConsumerOn($hash, $c2) ? 'on' : 'off';
|
||||||
@ -5813,7 +5819,7 @@ END3
|
|||||||
|
|
||||||
$ret .= qq{<text class="flowg text" id="consumer-txt_$c2" x="$pos_left" y="1090" style="text-anchor: start;">$currentPower</text>} if ($flowgconPower); # Current_Consumption Consumer
|
$ret .= qq{<text class="flowg text" id="consumer-txt_$c2" x="$pos_left" y="1090" style="text-anchor: start;">$currentPower</text>} if ($flowgconPower); # Current_Consumption Consumer
|
||||||
$ret .= qq{<text class="flowg text" id="consumer-txt_time_$c2" x="$pos_left" y="1150" style="text-anchor: start;">$consumerTime</text>} if ($flowgconTime); # Consumer Restlaufzeit
|
$ret .= qq{<text class="flowg text" id="consumer-txt_time_$c2" x="$pos_left" y="1150" style="text-anchor: start;">$consumerTime</text>} if ($flowgconTime); # Consumer Restlaufzeit
|
||||||
$pos_left += ($consumer_distance * 2);
|
$pos_left += ($consDist * 2);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -8398,6 +8404,14 @@ Ein/Ausschaltzeiten sowie deren Ausführung vom SolarForecast Modul übernehmen
|
|||||||
</li>
|
</li>
|
||||||
<br>
|
<br>
|
||||||
|
|
||||||
|
<a id="SolarForecast-attr-flowGraphicConsumerDistance"></a>
|
||||||
|
<li><b>flowGraphicConsumerDistance </b><br>
|
||||||
|
Steuert den Abstand zwischen den Consumer-Icons in der Energieflußgrafik sofern angezeigt.
|
||||||
|
Siehe auch Attribut <a href="#SolarForecast-attr-flowGraphicShowConsumer">flowGraphicShowConsumer</a>. <br>
|
||||||
|
(default: 80)
|
||||||
|
</li>
|
||||||
|
<br>
|
||||||
|
|
||||||
<a id="SolarForecast-attr-flowGraphicShowConsumer"></a>
|
<a id="SolarForecast-attr-flowGraphicShowConsumer"></a>
|
||||||
<li><b>flowGraphicShowConsumer </b><br>
|
<li><b>flowGraphicShowConsumer </b><br>
|
||||||
Unterdrückt die Anzeige der Verbraucher in der Energieflußgrafik wenn auf "0" gesetzt. <br>
|
Unterdrückt die Anzeige der Verbraucher in der Energieflußgrafik wenn auf "0" gesetzt. <br>
|
||||||
|
Loading…
x
Reference in New Issue
Block a user