diff --git a/fhem/contrib/DS_Starter/76_SolarForecast.pm b/fhem/contrib/DS_Starter/76_SolarForecast.pm index 2b20f7f96..53d37e7c8 100644 --- a/fhem/contrib/DS_Starter/76_SolarForecast.pm +++ b/fhem/contrib/DS_Starter/76_SolarForecast.pm @@ -1,5 +1,5 @@ ######################################################################################################################## -# $Id: 76_SolarForecast.pm 21735 2022-10-29 23:53:24Z DS_Starter $ +# $Id: 76_SolarForecast.pm 21735 2022-10-30 23:53:24Z DS_Starter $ ######################################################################################################################### # 76_SolarForecast.pm # @@ -130,6 +130,7 @@ BEGIN { # Versions History intern my %vNotesIntern = ( + "0.72.0" => "30.10.2022 rename some graphic attributes ", "0.71.4" => "29.10.2022 flowgraphic some changes (https://forum.fhem.de/index.php/topic,117864.msg1241836.html#msg1241836) ", "0.71.3" => "28.10.2022 new circular keys tdayDvtn, ydayDvtn for calculation PV forecast/generation in header ", "0.71.2" => "27.10.2022 fix 'connection lost ...' issue ", @@ -800,14 +801,6 @@ sub Initialize { # $hash->{NotifyFn} = \&Notify; # wird zur Zeit nicht genutzt/verwendet $hash->{AttrList} = "autoRefresh:selectnumbers,120,0.2,1800,0,log10 ". "autoRefreshFW:$fwd ". - "beam1Color:colorpicker,RGB ". - "beam1Content:pvForecast,pvReal,gridconsumption,consumptionForecast ". - "beam1FontColor:colorpicker,RGB ". - "beam2Color:colorpicker,RGB ". - "beam2Content:pvForecast,pvReal,gridconsumption,consumptionForecast ". - "beam2FontColor:colorpicker,RGB ". - "beamHeight ". - "beamWidth ". "cloudFactorDamping:slider,0,1,100 ". "consumerLegend:none,icon_top,icon_bottom,text_top,text_bottom ". "consumerAdviceIcon ". @@ -825,32 +818,39 @@ sub Initialize { "flowGraphicShowConsumerRemainTime:0,1 ". "flowGraphicCss:textField-long ". "follow70percentRule:1,dynamic,0 ". - "forcePageRefresh:1,0 ". - "graphicSelect:both,flow,forecast,none ". + "graphicBeamHeight ". + "graphicBeamWidth:slider,40,10,100 ". + "graphicBeam1Color:colorpicker,RGB ". + "graphicBeam2Color:colorpicker,RGB ". + "graphicBeam1Content:pvForecast,pvReal,gridconsumption,consumptionForecast ". + "graphicBeam2Content:pvForecast,pvReal,gridconsumption,consumptionForecast ". + "graphicBeam1FontColor:colorpicker,RGB ". + "graphicBeam2FontColor:colorpicker,RGB ". + "graphicBeam1MaxVal ". + "graphicHistoryHour:slider,0,1,23 ". + "graphicHourCount:slider,4,1,24 ". + "graphicHourStyle ". + "graphicLayoutType:single,double,diff ". + "graphicSelect:both,flow,forecast,none ". + "graphicShowDiff:no,top,bottom ". + "graphicShowNight:1,0 ". + "graphicShowWeather:1,0 ". + "graphicSpaceSize ". + "graphicStartHtml ". + "graphicEndHtml ". + "graphicWeatherColor:colorpicker,RGB ". + "graphicWeatherColorNight:colorpicker,RGB ". "headerDetail:all,co,pv,pvco,statusLink ". - "historyHour:slider,0,1,23 ". - "hourCount:slider,4,1,24 ". - "hourStyle ". - "htmlStart ". - "htmlEnd ". + "headerShow:1,0 ". "interval ". - "layoutType:single,double,diff ". "maxVariancePerDay ". - "maxValBeam ". "numHistDays:slider,1,1,30 ". "optimizeSolCastAPIreqInterval:1,0 ". "preferredChargeBattery:slider,0,1,100 ". "rainFactorDamping:slider,0,1,100 ". "sameWeekdaysForConsfc:1,0 ". - "showDiff:no,top,bottom ". - "showHeader:1,0 ". "showLink:1,0 ". - "showNight:1,0 ". - "showWeather:1,0 ". - "spaceSize ". "Wh_kWh:Wh,kWh ". - "weatherColor:colorpicker,RGB ". - "weatherColorNight:colorpicker,RGB ". $consumer. $readingFnAttributes; @@ -858,6 +858,30 @@ sub Initialize { # $hash->{FW_addDetailToSummary} = 1; # $hash->{FW_atPageEnd} = 1; # wenn 1 -> kein Longpoll ohne informid in HTML-Tag + + $hash->{AttrRenameMap} = { "beam1Color" => "graphicBeam1Color", + "beam1Content" => "graphicBeam1Content", + "beam1FontColor" => "graphicBeam1FontColor", + "beam2Color" => "graphicBeam2Color", + "beam2Content" => "graphicBeam2Content", + "beam2FontColor" => "graphicBeam2FontColor", + "beamHeight" => "graphicBeamHeight", + "beamWidth" => "graphicBeamWidth", + "historyHour" => "graphicHistoryHour", + "hourCount" => "graphicHourCount", + "hourStyle" => "graphicHourStyle", + "layoutType" => "graphicLayoutType", + "maxValBeam" => "graphicBeam1MaxVal", + "showDiff" => "graphicShowDiff", + "showNight" => "graphicShowNight", + "showWeather" => "graphicShowWeather", + "spaceSize" => "graphicSpaceSize", + "weatherColor" => "graphicWeatherColor", + "weatherColorNight" => "graphicWeatherColorNight", + "htmlStart" => "graphicStartHtml", + "htmlEnd" => "graphicEndHtml", + "showHeader" => "headerShow", + }; eval { FHEM::Meta::InitMod( __FILE__, $hash ) }; ## no critic 'eval' @@ -6214,18 +6238,16 @@ sub entryGraphic { # Parameter f. Anzeige extrahieren ################################### - my $width = AttrNum ($name, 'beamWidth', 6); # zu klein ist nicht problematisch - my $maxhours = AttrNum ($name, 'hourCount', 24); - - my $alias = AttrVal ($name, "alias", $name); # Linktext als Aliasname oder Devicename setzen - my $gsel = AttrVal ($name, 'graphicSelect', 'both'); # Auswahl der anzuzeigenden Grafiken - my $dlink = qq{$alias}; - - my $html_start = AttrVal ($name, 'htmlStart', undef); # beliebige HTML Strings die vor der Grafik ausgegeben werden - my $html_end = AttrVal ($name, 'htmlEnd', undef); # beliebige HTML Strings die nach der Grafik ausgegeben werden + my $width = AttrNum ($name, 'graphicBeamWidth', 20); # zu klein ist nicht problematisch + my $maxhours = AttrNum ($name, 'graphicHourCount', 24); + my $alias = AttrVal ($name, 'alias', $name); # Linktext als Aliasname oder Devicename setzen + my $gsel = AttrVal ($name, 'graphicSelect', 'both'); # Auswahl der anzuzeigenden Grafiken + my $html_start = AttrVal ($name, 'graphicStartHtml', undef); # beliebige HTML Strings die vor der Grafik ausgegeben werden + my $html_end = AttrVal ($name, 'graphicEndHtml', undef); # beliebige HTML Strings die nach der Grafik ausgegeben werden my $w = $width * $maxhours; # gesammte Breite der Ausgabe , WetterIcon braucht ca. 34px + my $offset = -1 * AttrNum ($name, 'graphicHistoryHour', $histhourdef); - my $offset = -1 * AttrNum ($name, 'historyHour', $histhourdef); + my $dlink = qq{$alias}; my $paref = { hash => $hash, @@ -6236,28 +6258,28 @@ sub entryGraphic { modulo => 1, dstyle => qq{style='padding-left: 10px; padding-right: 10px; padding-top: 3px; padding-bottom: 3px;'}, # TD-Style offset => $offset, - hourstyle => AttrVal ($name, 'hourStyle', ''), - colorb1 => AttrVal ($name, 'beam1Color', $b1coldef), - colorb2 => AttrVal ($name, 'beam2Color', $b2coldef), - fcolor1 => AttrVal ($name, 'beam1FontColor', $b1fontcoldef), - fcolor2 => AttrVal ($name, 'beam2FontColor', $b2fontcoldef), - beam1cont => AttrVal ($name, 'beam1Content', 'pvReal'), - beam2cont => AttrVal ($name, 'beam2Content', 'pvForecast'), + hourstyle => AttrVal ($name, 'graphicHourStyle', ''), + colorb1 => AttrVal ($name, 'graphicBeam1Color', $b1coldef), + colorb2 => AttrVal ($name, 'graphicBeam2Color', $b2coldef), + fcolor1 => AttrVal ($name, 'graphicBeam1FontColor', $b1fontcoldef), + fcolor2 => AttrVal ($name, 'graphicBeam2FontColor', $b2fontcoldef), + beam1cont => AttrVal ($name, 'graphicBeam1Content', 'pvReal'), + beam2cont => AttrVal ($name, 'graphicBeam2Content', 'pvForecast'), caicon => AttrVal ($name, 'consumerAdviceIcon', $caicondef), # Consumer AdviceIcon clegend => AttrVal ($name, 'consumerLegend', 'icon_top'), # Lage und Art Cunsumer Legende - lotype => AttrVal ($name, 'layoutType', 'double'), + lotype => AttrVal ($name, 'graphicLayoutType', 'double'), kw => AttrVal ($name, 'Wh_kWh', 'Wh'), - height => AttrNum ($name, 'beamHeight', 200), + height => AttrNum ($name, 'graphicBeamHeight', 200), width => $width, - fsize => AttrNum ($name, 'spaceSize', 24), - maxVal => AttrNum ($name, 'maxValBeam', 0), # dyn. Anpassung der Balkenhöhe oder statisch ? - show_night => AttrNum ($name, 'showNight', 0), # alle Balken (Spalten) anzeigen ? - show_diff => AttrVal ($name, 'showDiff', 'no'), # zusätzliche Anzeige $di{} in allen Typen - weather => AttrNum ($name, 'showWeather', 1), - colorw => AttrVal ($name, 'weatherColor', $wthcolddef), # Wetter Icon Farbe Tag - colorwn => AttrVal ($name, 'weatherColorNight', $wthcolndef), # Wetter Icon Farbe Nacht + fsize => AttrNum ($name, 'graphicSpaceSize', 24), + maxVal => AttrNum ($name, 'graphicBeam1MaxVal', 0), # dyn. Anpassung der Balkenhöhe oder statisch ? + show_night => AttrNum ($name, 'graphicShowNight', 0), # alle Balken (Spalten) anzeigen ? + show_diff => AttrVal ($name, 'graphicShowDiff', 'no'), # zusätzliche Anzeige $di{} in allen Typen + weather => AttrNum ($name, 'graphicShowWeather', 1), + colorw => AttrVal ($name, 'graphicWeatherColor', $wthcolddef), # Wetter Icon Farbe Tag + colorwn => AttrVal ($name, 'graphicWeatherColorNight', $wthcolndef), # Wetter Icon Farbe Nacht wlalias => AttrVal ($name, 'alias', $name), - sheader => AttrNum ($name, 'showHeader', 1), + sheader => AttrNum ($name, 'headerShow', 1), hdrDetail => AttrVal ($name, 'headerDetail', 'all'), # ermöglicht den Inhalt zu begrenzen, um bspw. passgenau in ftui einzubetten lang => AttrVal ("global", 'language', 'EN'), flowgsize => AttrVal ($name, 'flowGraphicSize', $flowGSizedef), # Größe Energieflußgrafik @@ -6399,8 +6421,8 @@ sub _checkSetupNotComplete { my $pv0 = NexthoursVal ($hash, "NextHour00", "pvforecast", undef); # der erste PV ForeCast Wert my $link = qq{$name}; - my $height = AttrNum ($name, 'beamHeight', 200); - my $lang = AttrVal ("global", "language", "EN"); + my $height = AttrNum ($name, 'graphicBeamHeight', 200); + my $lang = AttrVal ("global", 'language', 'EN'); if(IsDisabled($name)) { $ret .= "
";
- $ret .= $hfcg->{$i}{time} == $thishour ? # wenn Hervorhebung nur bei gestztem Attr 'historyHour' ? dann hinzufügen: "&& $offset < 0"
+ $ret .= $hfcg->{$i}{time} == $thishour ? # wenn Hervorhebung nur bei gestztem Attr 'graphicHistoryHour' ? dann hinzufügen: "&& $offset < 0"
''.$hfcg->{$i}{time_str}.'' :
$hfcg->{$i}{time_str};
@@ -7711,9 +7731,10 @@ END1
}
if ($flowgconX) { # Dummy Consumer
- $ret .= ' - - + + Farbauswahl der primären Balken. - - + + Auswahl der Schriftfarbe des primären Balken. (default: 0D0D0D) - - + + Legt den darzustellenden Inhalt der primären Balken fest.
- - + + Farbauswahl der sekundären Balken. Die zweite Farbe ist nur sinnvoll für den Anzeigedevice-Typ "pvco" und "diff". - - + + Auswahl der Schriftfarbe des sekundären Balken. (default: 000000) - - + + Legt den darzustellenden Inhalt der sekundären Balken fest.
- - + + Höhe der Balken in px und damit Bestimmung der gesammten Höhe. - In Verbindung mit "hourCount" lassen sich damit auch recht kleine Grafikausgaben erzeugen. + In Verbindung mit "graphicHourCount" lassen sich damit auch recht kleine Grafikausgaben erzeugen. (default: 200) - - - Breite der Balken in px. - (default: 6 (auto)) + + + Breite der Balken der Balkengrafik in px. Ohne gesetzen Attribut wird die Balkenbreite durch das Modul + automatisch bestimmt. @@ -11451,14 +11472,6 @@ Ein/Ausschaltzeiten sowie deren Ausführung vom SolarForecast Modul übernehmen - - - - Das Attribut wird durch das SMAPortal-Device ausgewertet. - Wenn gesetzt, wird ein Reload aller Browserseiten mit aktiven FHEMWEB-Verbindungen nach dem Update des - Eltern-SMAPortal-Devices erzwungen. - @@ -11469,50 +11482,50 @@ Ein/Ausschaltzeiten sowie deren Ausführung vom SolarForecast Modul übernehmen
- - + + Anzahl der vorangegangenen Stunden die in der Balkengrafik dargestellt werden. (default: 2) - - - Anzahl der Balken/Stunden. + + + Anzahl der Balken/Stunden in der Balkengrafk. (default: 24) - Detailiierungsgrad der Kopfzeilen. + Detaillierungsgrad des Kopfbereiches. (default: all)
- - - Format der Zeitangabe. + + + Format der Zeitangabe in der Balkengrafik. |