2
0
mirror of https://github.com/fhem/fhem-mirror.git synced 2025-04-20 19:36:02 +00:00

76_SolarForecast.pm: contrib 0.52.1

git-svn-id: https://svn.fhem.de/fhem/trunk@24619 2b470e98-0d58-463d-a4d8-8e2adae1ed80
This commit is contained in:
nasseeder1 2021-06-12 12:32:43 +00:00
parent a6cbfa854d
commit ff2aedede6

View File

@ -119,7 +119,7 @@ BEGIN {
# Versions History intern # Versions History intern
my %vNotesIntern = ( my %vNotesIntern = (
"0.52.1" => "12.06.2021 change Attr Css behavior ", "0.52.1" => "12.06.2021 change Attr Css behavior, new attr consumerAdviceIcon ",
"0.52.0" => "12.06.2021 new Attr Css ", "0.52.0" => "12.06.2021 new Attr Css ",
"0.51.3" => "10.06.2021 more refactoring, add 'none' to graphicSelect ", "0.51.3" => "10.06.2021 more refactoring, add 'none' to graphicSelect ",
"0.51.2" => "05.06.2021 minor fixes ", "0.51.2" => "05.06.2021 minor fixes ",
@ -328,6 +328,8 @@ my %htitles = (
DE => qq{Ein/Aus} }, DE => qq{Ein/Aus} },
auto => { EN => qq{Automatic}, auto => { EN => qq{Automatic},
DE => qq{Automatik} }, DE => qq{Automatik} },
conrec => { EN => qq{Switching on the consumer recommended},
DE => qq{Einschalten des Verbrauchers empfohlen} },
); );
my %weather_ids = ( my %weather_ids = (
@ -473,6 +475,7 @@ my @ctypes = qw(dishwasher dryer washingmachine heater other);
my $defmintime = 60; # default min. Einschalt- bzw. Zykluszeit in Minuten my $defmintime = 60; # default min. Einschalt- bzw. Zykluszeit in Minuten
my $defctype = "other"; # default Verbrauchertyp my $defctype = "other"; # default Verbrauchertyp
my $defcmode = "can"; # default Planungsmode der Verbraucher my $defcmode = "can"; # default Planungsmode der Verbraucher
my $caicondef = 'light_light_dim_100@gold'; # default consumerAdviceIcon
my $defflowGSize = 300; # default flowGraphicSize my $defflowGSize = 300; # default flowGraphicSize
@ -544,7 +547,7 @@ sub Initialize {
"beamHeight ". "beamHeight ".
"beamWidth ". "beamWidth ".
"consumerLegend:none,icon_top,icon_bottom,text_top,text_bottom ". "consumerLegend:none,icon_top,icon_bottom,text_top,text_bottom ".
# "consumerAdviceIcon ". "consumerAdviceIcon ".
"cloudFactorDamping:slider,0,1,100 ". "cloudFactorDamping:slider,0,1,100 ".
"Css:textField-long ". "Css:textField-long ".
"disable:1,0 ". "disable:1,0 ".
@ -2874,6 +2877,15 @@ sub __switchConsumer {
my $stoptime; my $stoptime;
## Ist Verbraucher empfohlen ?
################################
if ($startts && $t >= $startts && $stopts && $t <= $stopts) {
$data{$type}{$name}{consumers}{$c}{isConsumptionRecommended} = 1;
}
else {
$data{$type}{$name}{consumers}{$c}{isConsumptionRecommended} = 0;
}
## Verbraucher einschalten ## Verbraucher einschalten
############################ ############################
my $oncom = ConsumerVal ($hash, $c, "oncom", ""); # Set Command für "on" my $oncom = ConsumerVal ($hash, $c, "oncom", ""); # Set Command für "on"
@ -3670,7 +3682,8 @@ sub entryGraphic {
fcolor2 => AttrVal ($name, 'beam2FontColor', '000000'), fcolor2 => AttrVal ($name, 'beam2FontColor', '000000'),
beam1cont => AttrVal ($name, 'beam1Content', 'pvForecast'), beam1cont => AttrVal ($name, 'beam1Content', 'pvForecast'),
beam2cont => AttrVal ($name, 'beam2Content', 'pvForecast'), beam2cont => AttrVal ($name, 'beam2Content', 'pvForecast'),
caicon => AttrVal ($name, 'consumerAdviceIcon', undef), # Consumer AdviceIcon caicon => AttrVal ($name, 'consumerAdviceIcon', $caicondef), # Consumer AdviceIcon
clegend => AttrVal ($name, 'consumerLegend', 'icon_top'), # Lage und Art Cunsumer Legende
lotype => AttrVal ($name, 'layoutType', 'single'), lotype => AttrVal ($name, 'layoutType', 'single'),
kw => AttrVal ($name, 'Wh/kWh', 'Wh'), kw => AttrVal ($name, 'Wh/kWh', 'Wh'),
height => AttrNum ($name, 'beamHeight', 200), height => AttrNum ($name, 'beamHeight', 200),
@ -4127,9 +4140,12 @@ sub _graphicConsumerLegend {
my $paref = shift; my $paref = shift;
my $hash = $paref->{hash}; my $hash = $paref->{hash};
my $name = $paref->{name}; my $name = $paref->{name};
my $caicon = $paref->{caicon}; # Consumer AdviceIcon
my ($clegendstyle, $clegend) = split('_', $paref->{clegend});
my $type = $hash->{TYPE}; my $type = $hash->{TYPE};
my ($clegendstyle, $clegend) = split('_', AttrVal($name, 'consumerLegend', 'icon_top'));
my @consumers = sort{$a<=>$b} keys %{$data{$type}{$name}{consumers}}; # definierte Verbraucher ermitteln my @consumers = sort{$a<=>$b} keys %{$data{$type}{$name}{consumers}}; # definierte Verbraucher ermitteln
$clegend = '' if(($clegendstyle eq 'none') || (!int(@consumers))); $clegend = '' if(($clegendstyle eq 'none') || (!int(@consumers)));
$paref->{clegend} = $clegend; $paref->{clegend} = $clegend;
@ -4179,6 +4195,7 @@ sub _graphicConsumerLegend {
my $offcom = ConsumerVal ($hash, $c, "offcom", ""); # Consumer Ausschaltkommando my $offcom = ConsumerVal ($hash, $c, "offcom", ""); # Consumer Ausschaltkommando
my $autord = ConsumerVal ($hash, $c, "autoreading", ""); # Readingname f. Automatiksteuerung my $autord = ConsumerVal ($hash, $c, "autoreading", ""); # Readingname f. Automatiksteuerung
my $auto = ConsumerVal ($hash, $c, "auto", 1); # Automatic Mode my $auto = ConsumerVal ($hash, $c, "auto", 1); # Automatic Mode
my $iscrecomm = ConsumerVal ($hash, $c, "isConsumptionRecommended", 0); # ist einschalten Vervracher empfohlen
my $cmdon = qq{"FW_cmd('$FW_ME$FW_subdir?XHR=1&cmd=set $name consumerAction set $cname $oncom')"}; my $cmdon = qq{"FW_cmd('$FW_ME$FW_subdir?XHR=1&cmd=set $name consumerAction set $cname $oncom')"};
my $cmdoff = qq{"FW_cmd('$FW_ME$FW_subdir?XHR=1&cmd=set $name consumerAction set $cname $offcom')"}; my $cmdoff = qq{"FW_cmd('$FW_ME$FW_subdir?XHR=1&cmd=set $name consumerAction set $cname $offcom')"};
@ -4198,8 +4215,13 @@ sub _graphicConsumerLegend {
$cmdautooff = q{} if(!$autord); $cmdautooff = q{} if(!$autord);
my $swstate = ConsumerVal ($hash, $c, "state", "undef"); # Schaltzustand des Consumerdevices my $swstate = ConsumerVal ($hash, $c, "state", "undef"); # Schaltzustand des Consumerdevices
my $swicon = q{}; my $swicon = q{}; # Schalter ein/aus Icon
my $auicon = q{}; my $auicon = q{}; # Schalter Automatic Icon
my $isricon = q{}; # Zustand IsRecommended Icon
if($iscrecomm) {
$isricon = "<a title= '$htitles{conrec}{$lang}'</a>".FW_makeImage($caicon, '');
}
if($modulo % 2){ if($modulo % 2){
$ctable .= qq{<tr>}; $ctable .= qq{<tr>};
@ -4230,7 +4252,7 @@ sub _graphicConsumerLegend {
$cicon = FW_makeImage($cicon); $cicon = FW_makeImage($cicon);
$ctable .= "<td style='text-align:left' $dstyle>$calias </td>"; $ctable .= "<td style='text-align:left' $dstyle>$calias </td>";
$ctable .= "<td style='text-align:center' $dstyle>$cicon </td>"; $ctable .= "<td style='text-align:center' $dstyle>$cicon $isricon </td>";
$ctable .= "<td style='text-align:center' $dstyle>$swicon </td>"; $ctable .= "<td style='text-align:center' $dstyle>$swicon </td>";
$ctable .= "<td style='text-align:center' $dstyle>$auicon </td>"; $ctable .= "<td style='text-align:center' $dstyle>$auicon </td>";
} }
@ -4239,7 +4261,7 @@ sub _graphicConsumerLegend {
$co = '' if (!$co); $co = '' if (!$co);
$ctable .= "<td style='text-align:left' $dstyle><font color='$co'>$calias </font></td>"; $ctable .= "<td style='text-align:left' $dstyle><font color='$co'>$calias </font></td>";
$ctable .= "<td> </td>"; $ctable .= "<td> $isricon </td>";
$ctable .= "<td style='text-align:center' $dstyle>$swicon </td>"; $ctable .= "<td style='text-align:center' $dstyle>$swicon </td>";
$ctable .= "<td style='text-align:center' $dstyle>$auicon </td>"; $ctable .= "<td style='text-align:center' $dstyle>$auicon </td>";
} }
@ -6318,6 +6340,7 @@ return $def;
# uetotal - Unit der Leistungsmessung # uetotal - Unit der Leistungsmessung
# avgenergy - gemessener Durchschnittsverbrauch eines Tages # avgenergy - gemessener Durchschnittsverbrauch eines Tages
# epieces - prognostizierte Energiescheiben (Hash) # epieces - prognostizierte Energiescheiben (Hash)
# isConsumptionRecommended - ist Verbrauch empfohlen ?
# #
# $def: Defaultwert # $def: Defaultwert
# #
@ -7018,6 +7041,13 @@ Ein/Ausschaltzeiten sowie deren Ausführung vom SolarForecast Modul übernehmen
</li> </li>
<br> <br>
<a id="SolarForecast-attr-consumerAdviceIcon"></a>
<li><b>consumerAdviceIcon </b><br>
Definiert das Icon zur Signalisierung der Aktivierungsempfehlung eines Verbrauchers in der Verbraucherlegende. <br>
(default: light_light_dim_100@gold)
</li>
<br>
<a id="SolarForecast-attr-consumerLegend"></a> <a id="SolarForecast-attr-consumerLegend"></a>
<li><b>consumerLegend </b><br> <li><b>consumerLegend </b><br>
Definiert die Lage bzw. Darstellungsweise der Verbraucherlegende sofern Verbraucher SolarForecast Device Definiert die Lage bzw. Darstellungsweise der Verbraucherlegende sofern Verbraucher SolarForecast Device