mirror of
https://github.com/fhem/fhem-mirror.git
synced 2025-04-20 13:26: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:
parent
a6cbfa854d
commit
ff2aedede6
@ -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 ",
|
||||||
@ -304,30 +304,32 @@ my %hqtxt = (
|
|||||||
);
|
);
|
||||||
|
|
||||||
my %htitles = ( # Hash Hilfetexte
|
my %htitles = ( # Hash Hilfetexte
|
||||||
iaaf => { EN => qq{Automatic mode off -> Enable automatic mode},
|
iaaf => { EN => qq{Automatic mode off -> Enable automatic mode},
|
||||||
DE => qq{Automatikmodus aus -> Automatik freigeben} },
|
DE => qq{Automatikmodus aus -> Automatik freigeben} },
|
||||||
ieas => { EN => qq{Automatic mode on -> Lock automatic mode},
|
ieas => { EN => qq{Automatic mode on -> Lock automatic mode},
|
||||||
DE => qq{Automatikmodus ein -> Automatik sperren} },
|
DE => qq{Automatikmodus ein -> Automatik sperren} },
|
||||||
iave => { EN => qq{Off -> Switch on consumer},
|
iave => { EN => qq{Off -> Switch on consumer},
|
||||||
DE => qq{Aus -> Verbraucher einschalten} },
|
DE => qq{Aus -> Verbraucher einschalten} },
|
||||||
ieva => { EN => qq{On -> Switch off consumer},
|
ieva => { EN => qq{On -> Switch off consumer},
|
||||||
DE => qq{Ein -> Verbraucher ausschalten} },
|
DE => qq{Ein -> Verbraucher ausschalten} },
|
||||||
upd => { EN => qq{Update},
|
upd => { EN => qq{Update},
|
||||||
DE => qq{Update} },
|
DE => qq{Update} },
|
||||||
on => { EN => qq{switched on},
|
on => { EN => qq{switched on},
|
||||||
DE => qq{eingeschaltet} },
|
DE => qq{eingeschaltet} },
|
||||||
off => { EN => qq{switched off},
|
off => { EN => qq{switched off},
|
||||||
DE => qq{ausgeschaltet} },
|
DE => qq{ausgeschaltet} },
|
||||||
undef => { EN => qq{undefined},
|
undef => { EN => qq{undefined},
|
||||||
DE => qq{undefiniert} },
|
DE => qq{undefiniert} },
|
||||||
dela => { EN => qq{delayed},
|
dela => { EN => qq{delayed},
|
||||||
DE => qq{verzoegert} },
|
DE => qq{verzoegert} },
|
||||||
cnsm => { EN => qq{Consumer},
|
cnsm => { EN => qq{Consumer},
|
||||||
DE => qq{Verbraucher} },
|
DE => qq{Verbraucher} },
|
||||||
eiau => { EN => qq{On/Off},
|
eiau => { EN => qq{On/Off},
|
||||||
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;
|
||||||
|
|
||||||
@ -4172,13 +4188,14 @@ sub _graphicConsumerLegend {
|
|||||||
my $tro = 0;
|
my $tro = 0;
|
||||||
|
|
||||||
for my $c (@consumers) {
|
for my $c (@consumers) {
|
||||||
my $cname = ConsumerVal ($hash, $c, "name", ""); # Name des Consumerdevices
|
my $cname = ConsumerVal ($hash, $c, "name", ""); # Name des Consumerdevices
|
||||||
my $calias = ConsumerVal ($hash, $c, "alias", $cname); # Alias des Consumerdevices
|
my $calias = ConsumerVal ($hash, $c, "alias", $cname); # Alias des Consumerdevices
|
||||||
my $cicon = ConsumerVal ($hash, $c, "icon", ""); # Icon des Consumerdevices
|
my $cicon = ConsumerVal ($hash, $c, "icon", ""); # Icon des Consumerdevices
|
||||||
my $oncom = ConsumerVal ($hash, $c, "oncom", ""); # Consumer Einschaltkommando
|
my $oncom = ConsumerVal ($hash, $c, "oncom", ""); # Consumer Einschaltkommando
|
||||||
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>};
|
||||||
@ -4229,17 +4251,17 @@ sub _graphicConsumerLegend {
|
|||||||
if ($clegendstyle eq 'icon') {
|
if ($clegendstyle eq 'icon') {
|
||||||
$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>";
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
my (undef,$co) = split('\@',$cicon);
|
my (undef,$co) = split('\@',$cicon);
|
||||||
$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
|
||||||
|
Loading…
x
Reference in New Issue
Block a user