mirror of
https://github.com/fhem/fhem-mirror.git
synced 2025-04-16 10:46:03 +00:00
76_SolarForecast.pm: contrib 0.68.4
git-svn-id: https://svn.fhem.de/fhem/trunk@26473 2b470e98-0d58-463d-a4d8-8e2adae1ed80
This commit is contained in:
parent
a4cb743b4a
commit
8704698e00
@ -126,8 +126,8 @@ BEGIN {
|
|||||||
|
|
||||||
# Versions History intern
|
# Versions History intern
|
||||||
my %vNotesIntern = (
|
my %vNotesIntern = (
|
||||||
"0.68.4 "=> "02.10.2022 do ___setLastAPIcallKeyData if response_status, generate events of Today_MaxPVforecast.* in every cycle ".
|
"0.68.4 "=> "03.10.2022 do ___setLastAPIcallKeyData if response_status, generate events of Today_MaxPVforecast.* in every cycle ".
|
||||||
"add SolCast section in _graphicHeader ",
|
"add SolCast section in _graphicHeader, change default colors and settings ",
|
||||||
"0.68.3 "=> "19.09.2022 fix calculation of currentAPIinterval ",
|
"0.68.3 "=> "19.09.2022 fix calculation of currentAPIinterval ",
|
||||||
"0.68.2 "=> "18.09.2022 fix function _setpvCorrectionFactorAuto, new attr optimizeSolCastAPIreqInterval, change createReadingsFromArray ",
|
"0.68.2 "=> "18.09.2022 fix function _setpvCorrectionFactorAuto, new attr optimizeSolCastAPIreqInterval, change createReadingsFromArray ",
|
||||||
"0.68.1 "=> "17.09.2022 new readings Today_MaxPVforecast, Today_MaxPVforecastTime ",
|
"0.68.1 "=> "17.09.2022 new readings Today_MaxPVforecast, Today_MaxPVforecastTime ",
|
||||||
@ -606,9 +606,17 @@ my @ctypes = qw(dishwasher dryer washingmachine heater charger 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 = 'clock@gold'; # default consumerAdviceIcon
|
|
||||||
|
|
||||||
|
my $caicondef = 'clock@gold'; # default consumerAdviceIcon
|
||||||
my $defflowGSize = 300; # default flowGraphicSize
|
my $defflowGSize = 300; # default flowGraphicSize
|
||||||
|
my $histhourdef = -2; # default Anzeige vorangegangene Stunden
|
||||||
|
my $wthcolddef = 'C7C979'; # Wetter Icon Tag Default Farbe
|
||||||
|
my $wthcolndef = 'C7C7C7'; # Wetter Icon Nacht Default Farbe
|
||||||
|
my $b1coldef = 'FFAC63'; # Default Farbe Beam 1
|
||||||
|
my $b1fontcoldef = '0D0D0D'; # Default Schriftfarbe Beam 1
|
||||||
|
my $b2coldef = 'C4C4A7'; # Default Farbe Beam 2
|
||||||
|
my $b2fontcoldef = '000000'; # Default Schriftfarbe Beam 2
|
||||||
|
|
||||||
my $defpopercent = 0.5; # Standard % aktuelle Leistung an nominaler Leistung gemäß Typenschild
|
my $defpopercent = 0.5; # Standard % aktuelle Leistung an nominaler Leistung gemäß Typenschild
|
||||||
my $defhyst = 0; # default Hysterese
|
my $defhyst = 0; # default Hysterese
|
||||||
|
|
||||||
@ -706,7 +714,7 @@ sub Initialize {
|
|||||||
"forcePageRefresh:1,0 ".
|
"forcePageRefresh:1,0 ".
|
||||||
"graphicSelect:both,flow,forecast,none ".
|
"graphicSelect:both,flow,forecast,none ".
|
||||||
"headerDetail:all,co,pv,pvco,statusLink ".
|
"headerDetail:all,co,pv,pvco,statusLink ".
|
||||||
"historyHour:slider,-23,-1,0 ".
|
"historyHour:slider,0,-1,-23 ".
|
||||||
"hourCount:slider,4,1,24 ".
|
"hourCount:slider,4,1,24 ".
|
||||||
"hourStyle ".
|
"hourStyle ".
|
||||||
"htmlStart ".
|
"htmlStart ".
|
||||||
@ -2044,7 +2052,6 @@ sub ___setLastAPIcallKeyData {
|
|||||||
|
|
||||||
## Berechnung des optimalen Request Intervalls
|
## Berechnung des optimalen Request Intervalls
|
||||||
################################################
|
################################################
|
||||||
if (AttrVal($name, 'optimizeSolCastAPIreqInterval', 0)) {
|
|
||||||
my $asc = CurrentVal ($hash, 'allstringscount', 1); # Anzahl der Strings
|
my $asc = CurrentVal ($hash, 'allstringscount', 1); # Anzahl der Strings
|
||||||
my $madr = $apimaxreqs / $asc; # kalkulieren max. tägliche Anzahl API Abrufe
|
my $madr = $apimaxreqs / $asc; # kalkulieren max. tägliche Anzahl API Abrufe
|
||||||
|
|
||||||
@ -2061,6 +2068,7 @@ sub ___setLastAPIcallKeyData {
|
|||||||
|
|
||||||
$data{$type}{$name}{solcastapi}{'?All'}{'?All'}{todayRemaingAPIcalls} = $darr;
|
$data{$type}{$name}{solcastapi}{'?All'}{'?All'}{todayRemaingAPIcalls} = $darr;
|
||||||
|
|
||||||
|
if (AttrVal($name, 'optimizeSolCastAPIreqInterval', 0)) {
|
||||||
my $date = strftime "%Y-%m-%d", localtime($t);
|
my $date = strftime "%Y-%m-%d", localtime($t);
|
||||||
my $sstime = timestringToTimestamp ($date.' '.ReadingsVal($name, "Today_SunSet", '00:00').':00');
|
my $sstime = timestringToTimestamp ($date.' '.ReadingsVal($name, "Today_SunSet", '00:00').':00');
|
||||||
my $dart = $sstime - $t; # verbleibende Sekunden bis Sonnenuntergang
|
my $dart = $sstime - $t; # verbleibende Sekunden bis Sonnenuntergang
|
||||||
@ -5800,7 +5808,6 @@ sub entryGraphic {
|
|||||||
###################################
|
###################################
|
||||||
my $width = AttrNum ($name, 'beamWidth', 6); # zu klein ist nicht problematisch
|
my $width = AttrNum ($name, 'beamWidth', 6); # zu klein ist nicht problematisch
|
||||||
my $maxhours = AttrNum ($name, 'hourCount', 24);
|
my $maxhours = AttrNum ($name, 'hourCount', 24);
|
||||||
my $colorw = AttrVal ($name, 'weatherColor', 'FFFFFF'); # Wetter Icon Farbe
|
|
||||||
|
|
||||||
my $alias = AttrVal ($name, "alias", $name); # Linktext als Aliasname oder Devicename setzen
|
my $alias = AttrVal ($name, "alias", $name); # Linktext als Aliasname oder Devicename setzen
|
||||||
my $gsel = AttrVal ($name, 'graphicSelect', 'both'); # Auswahl der anzuzeigenden Grafiken
|
my $gsel = AttrVal ($name, 'graphicSelect', 'both'); # Auswahl der anzuzeigenden Grafiken
|
||||||
@ -5817,17 +5824,17 @@ sub entryGraphic {
|
|||||||
maxhours => $maxhours,
|
maxhours => $maxhours,
|
||||||
modulo => 1,
|
modulo => 1,
|
||||||
dstyle => qq{style='padding-left: 10px; padding-right: 10px; padding-top: 3px; padding-bottom: 3px;'}, # TD-Style
|
dstyle => qq{style='padding-left: 10px; padding-right: 10px; padding-top: 3px; padding-bottom: 3px;'}, # TD-Style
|
||||||
offset => AttrNum ($name, 'historyHour', 0),
|
offset => AttrNum ($name, 'historyHour', $histhourdef),
|
||||||
hourstyle => AttrVal ($name, 'hourStyle', ''),
|
hourstyle => AttrVal ($name, 'hourStyle', ''),
|
||||||
colorfc => AttrVal ($name, 'beam1Color', '000000'),
|
colorfc => AttrVal ($name, 'beam1Color', $b1coldef),
|
||||||
colorc => AttrVal ($name, 'beam2Color', 'C4C4A7'),
|
colorc => AttrVal ($name, 'beam2Color', $b2coldef),
|
||||||
fcolor1 => AttrVal ($name, 'beam1FontColor', 'C4C4A7'),
|
fcolor1 => AttrVal ($name, 'beam1FontColor', $b1fontcoldef),
|
||||||
fcolor2 => AttrVal ($name, 'beam2FontColor', '000000'),
|
fcolor2 => AttrVal ($name, 'beam2FontColor', $b2fontcoldef),
|
||||||
beam1cont => AttrVal ($name, 'beam1Content', 'pvForecast'),
|
beam1cont => AttrVal ($name, 'beam1Content', 'pvReal'),
|
||||||
beam2cont => AttrVal ($name, 'beam2Content', 'pvForecast'),
|
beam2cont => AttrVal ($name, 'beam2Content', 'pvForecast'),
|
||||||
caicon => AttrVal ($name, 'consumerAdviceIcon', $caicondef), # Consumer AdviceIcon
|
caicon => AttrVal ($name, 'consumerAdviceIcon', $caicondef), # Consumer AdviceIcon
|
||||||
clegend => AttrVal ($name, 'consumerLegend', 'icon_top'), # Lage und Art Cunsumer Legende
|
clegend => AttrVal ($name, 'consumerLegend', 'icon_top'), # Lage und Art Cunsumer Legende
|
||||||
lotype => AttrVal ($name, 'layoutType', 'single'),
|
lotype => AttrVal ($name, 'layoutType', 'double'),
|
||||||
kw => AttrVal ($name, 'Wh_kWh', 'Wh'),
|
kw => AttrVal ($name, 'Wh_kWh', 'Wh'),
|
||||||
height => AttrNum ($name, 'beamHeight', 200),
|
height => AttrNum ($name, 'beamHeight', 200),
|
||||||
width => $width,
|
width => $width,
|
||||||
@ -5836,8 +5843,8 @@ sub entryGraphic {
|
|||||||
show_night => AttrNum ($name, 'showNight', 0), # alle Balken (Spalten) anzeigen ?
|
show_night => AttrNum ($name, 'showNight', 0), # alle Balken (Spalten) anzeigen ?
|
||||||
show_diff => AttrVal ($name, 'showDiff', 'no'), # zusätzliche Anzeige $di{} in allen Typen
|
show_diff => AttrVal ($name, 'showDiff', 'no'), # zusätzliche Anzeige $di{} in allen Typen
|
||||||
weather => AttrNum ($name, 'showWeather', 1),
|
weather => AttrNum ($name, 'showWeather', 1),
|
||||||
colorw => $colorw,
|
colorw => AttrVal ($name, 'weatherColor', $wthcolddef), # Wetter Icon Farbe Tag
|
||||||
colorwn => AttrVal ($name, 'weatherColorNight', $colorw), # Wetter Icon Farbe Nacht
|
colorwn => AttrVal ($name, 'weatherColorNight', $wthcolndef), # Wetter Icon Farbe Nacht
|
||||||
wlalias => AttrVal ($name, 'alias', $name),
|
wlalias => AttrVal ($name, 'alias', $name),
|
||||||
header => AttrNum ($name, 'showHeader', 1),
|
header => AttrNum ($name, 'showHeader', 1),
|
||||||
hdrDetail => AttrVal ($name, 'headerDetail', 'all'), # ermöglicht den Inhalt zu begrenzen, um bspw. passgenau in ftui einzubetten
|
hdrDetail => AttrVal ($name, 'headerDetail', 'all'), # ermöglicht den Inhalt zu begrenzen, um bspw. passgenau in ftui einzubetten
|
||||||
@ -6162,7 +6169,7 @@ sub _graphicHeader {
|
|||||||
|
|
||||||
$api .= ' '.$scicon;
|
$api .= ' '.$scicon;
|
||||||
$api .= ' ('.SolCastAPIVal ($hash, '?All', '?All', 'todayDoneAPIrequests', 0);
|
$api .= ' ('.SolCastAPIVal ($hash, '?All', '?All', 'todayDoneAPIrequests', 0);
|
||||||
$api .= '/'.SolCastAPIVal ($hash, '?All', '?All', 'todayRemaingAPIcalls', 0).')';
|
$api .= '/'.SolCastAPIVal ($hash, '?All', '?All', 'todayRemaingAPIcalls', $apimaxreqs).')';
|
||||||
}
|
}
|
||||||
|
|
||||||
## Update-Icon
|
## Update-Icon
|
||||||
@ -10383,7 +10390,7 @@ Ein/Ausschaltzeiten sowie deren Ausführung vom SolarForecast Modul übernehmen
|
|||||||
<a id="SolarForecast-attr-historyHour"></a>
|
<a id="SolarForecast-attr-historyHour"></a>
|
||||||
<li><b>historyHour </b><br>
|
<li><b>historyHour </b><br>
|
||||||
Anzahl der vorangegangenen Stunden die in der Balkengrafik dargestellt werden. <br>
|
Anzahl der vorangegangenen Stunden die in der Balkengrafik dargestellt werden. <br>
|
||||||
(default: 0)
|
(default: -2)
|
||||||
</li>
|
</li>
|
||||||
<br>
|
<br>
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user