From 0077a3cbdf7e50a39008124c20ecdc9e6a691b0b Mon Sep 17 00:00:00 2001 From: nasseeder1 Date: Fri, 4 Oct 2024 19:16:36 +0000 Subject: [PATCH] 76_SolarForecast: contrib 1.34.2 git-svn-id: https://svn.fhem.de/fhem/trunk@29194 2b470e98-0d58-463d-a4d8-8e2adae1ed80 --- fhem/contrib/DS_Starter/76_SolarForecast.pm | 112 +++++++++----------- 1 file changed, 49 insertions(+), 63 deletions(-) diff --git a/fhem/contrib/DS_Starter/76_SolarForecast.pm b/fhem/contrib/DS_Starter/76_SolarForecast.pm index 1a763069e..aeda701ed 100644 --- a/fhem/contrib/DS_Starter/76_SolarForecast.pm +++ b/fhem/contrib/DS_Starter/76_SolarForecast.pm @@ -156,6 +156,8 @@ BEGIN { # Versions History intern my %vNotesIntern = ( + "1.34.2" => "04.10.2024 _flowGraphic: replace sun by FHEM SVG-Icon ", + "1.34.1" => "04.10.2024 _flowGraphic: replace house by FHEM SVG-Icon ", "1.34.0" => "03.10.2024 implement ___areaFactorTrack for calculation of direct area factor and share of direct radiation ". "note in Reading pvCorrectionFactor_XX if AI prediction was used in relevant hour ". "AI usage depending either of available number of rules or difference to api forecast ". @@ -482,6 +484,8 @@ my $fgCDdef = 130; my $prodicondef = 'sani_garden_pump'; # default Producer-Icon my $consicondef = 'light_light_dim_100'; # default Consumer-Icon +my $homeicondef = 'control_building_control@grey'; # default Home-Icon +my $sunicondef = 'weather_sun'; # default Sonne-icon my $bPath = 'https://svn.fhem.de/trac/browser/trunk/fhem/contrib/SolarForecast/'; # Basispfad Abruf contrib SolarForecast Files my $pPath = '?format=txt'; # Download Format @@ -489,8 +493,6 @@ my $cfile = 'controls_solarforecast.txt'; # default CSS-Style my $cssdef = qq{.flowg.text { stroke: none; fill: gray; font-size: 60px; } \n}. - qq{.flowg.sun_active { stroke: orange; fill: orange; } \n}. - qq{.flowg.sun_inactive { stroke: gray; fill: gray; } \n}. qq{.flowg.bat25 { stroke: red; fill: red; } \n}. qq{.flowg.bat50 { stroke: darkorange; fill: darkorange; } \n}. qq{.flowg.bat75 { stroke: green; fill: green; } \n}. @@ -920,6 +922,8 @@ my %htitles = ( DE => qq{nicht bewertet} }, aimstt => { EN => qq{Perl module AI::DecisionTree is missing}, DE => qq{Perl Modul AI::DecisionTree ist nicht vorhanden} }, + dumtxt => { EN => qq{Consumption that cannot be allocated to registered consumers}, + DE => qq{Verbrauch der den registrierten Verbrauchern nicht zugeordnet werden kann} }, pstate => { EN => qq{Planning status: \nInfo: \n\nOn: \nOff: \nRemaining lock time:  seconds}, DE => qq{Planungsstatus: \nInfo: \n\nEin: \nAus: \nverbleibende Sperrzeit:  Sekunden} }, ainuse => { EN => qq{AI Perl module is installed, but the AI support is not used.\nRun 'set plantConfiguration check' for hints.}, @@ -13904,6 +13908,7 @@ sub _flowGraphic { my $flowgconPower = $paref->{flowgconsPower}; my $consDist = $paref->{flowgconsDist}; my $css = $paref->{css}; + my $lang = $paref->{lang}; my $style = 'width:98%; height:'.$flowgsize.'px;'; my $animation = $flowgani ? '@keyframes dash { to { stroke-dashoffset: 0; } }' : ''; # Animation Ja/Nein @@ -14004,20 +14009,15 @@ sub _flowGraphic { $p2home = sprintf "%.0f", $p2home if($p2home > 10); $p2home = 0 if($p2home == 0); # 0.0 eliminieren wenn keine Leistung zum Haus - ## SVG Box initialisieren - ########################### - my $sun_color = $cpv ? 'flowg sun_active' : 'flowg sun_inactive'; - my $batin_style = $batin ? 'flowg active_in active_bat_in' : 'flowg inactive_out'; - my $csc_style = $p2home ? 'flowg active_out' : 'flowg inactive_out'; - my $cgfi_style = $cgfi ? 'flowg active_out' : 'flowg inactive_out'; + ## SVG Box initialisieren mit Grid-Icon + ######################################### + my $vbwidth = 800; # width and height specify the viewBox size + my $vbminx = -10 * $flowgshift; # min-x and min-y represent the smallest X and Y coordinates that the viewBox may have + my $vbminy = $flowgprods ? -25 : 100; - my $vbwidth = 800; # width and height specify the viewBox size - my $vbminx = -10 * $flowgshift; # min-x and min-y represent the smallest X and Y coordinates that the viewBox may have - my $vbminy = $flowgprods ? -25 : 100; - - my $vbhight = !$flowgcons ? 380 : - !$flowgconTime ? 590 : - 610; + my $vbhight = !$flowgcons ? 380 : + !$flowgconTime ? 590 : + 610; $vbhight += 100 if($flowgprods); @@ -14031,38 +14031,6 @@ sub _flowGraphic { - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - @@ -14130,11 +14098,17 @@ END0 $pos_left += $consDist; } } + + ## Sonne Icon + ############## + my $suncolor = $cpv ? 'orange' : 'grey'; + $ret .= ''; # translate(X-Koordinate,Y-Koordinate), scale()-> Koordinaten ändern sich bei Größenänderung + $ret .= "Sonne".FW_makeImage($sunicondef.'@'.$suncolor, ''); + $ret .= ' '; - ## Batterie, PV, Netz Laufketten - ################################## - - if ($hasbat) { + ## Batterie Icon + ################## + if ($hasbat) { $ret .= << "END1"; @@ -14147,23 +14121,39 @@ END1 $ret .= '' if ($soc > 88); $ret .= ''; } + + ## Home Icon + ############## + $ret .= ''; # translate(X-Koordinate,Y-Koordinate), scale()-> Koordinaten ändern sich bei Größenänderung + $ret .= "Home".FW_makeImage($homeicondef, ''); + $ret .= ' '; - if ($flowgconX) { # Dummy Consumer + ## Dummy Consumer Icon + ######################## + if ($flowgconX) { + my $dumtxt = $htitles{dumtxt}{$lang}; my $dumcol = $cc_dummy <= 0 ? '@grey' : q{}; # Einfärbung Consumer Dummy $ret .= ''; - $ret .= "consumer_X".FW_makeImage($consicondef.$dumcol, ''); + $ret .= "$dumtxt".FW_makeImage($consicondef.$dumcol, ''); $ret .= ' '; } - $ret .= << "END2"; + ## Laufketten PV->Home, PV->Grid, Grid->Home + ############################################## + my $csc_style = $p2home ? 'flowg active_out' : 'flowg inactive_out'; + my $cgfi_style = $cgfi ? 'flowg active_out' : 'flowg inactive_out'; + $ret .= << "END2"; END2 + ## Laufketten PV->Batterie, Batterie->Home + ############################################## if ($hasbat) { - $ret .= << "END3"; + my $batin_style = $batin ? 'flowg active_in active_bat_in' : 'flowg inactive_out'; + $ret .= << "END3"; END3 @@ -20054,9 +20044,9 @@ to ensure that the system configuration is correct.
fix a uniquely determined area factor is used (default) trackFull the area factor is calculated continuously depending on the position of the sun and applied to the total global radiation trackShared the area factor is calculated continuously depending on the position of the sun and applied to an approximated - proportion of the direct radiation in the global radiation + proportion of the direct radiation in the global radiation trackFlex combines the 'trackFull' and 'trackShared' methods. The system switches from 'trackFull' to 'trackShared' - at a cloud cover of >=80%. + at a cloud cover of >=80%. @@ -20398,8 +20388,6 @@ to ensure that the system configuration is correct.
    .flowg.text { stroke: none; fill: gray; font-size: 60px; }
    - .flowg.sun_active { stroke: orange; fill: orange; }
    - .flowg.sun_inactive { stroke: gray; fill: gray; }
    .flowg.bat25 { stroke: red; fill: red; }
    .flowg.bat50 { stroke: darkorange; fill: darkorange; }
    .flowg.bat75 { stroke: green; fill: green; }
    @@ -22403,9 +22391,9 @@ die ordnungsgemäße Anlagenkonfiguration geprüft werden. fix es wird ein einmalig ermittelter Flächenfaktor verwendet (default) trackFull der Flächenfaktor wird kontinuierlich abhängig vom Sonnenstand berechnet und auf die gesamte Globalstrahlung angewendet trackShared der Flächenfaktor wird kontinuierlich abhängig vom Sonnenstand berechnet und auf einen approximierten Anteil der - Direktstrahlung an der Globalstrahlung angewendet + Direktstrahlung an der Globalstrahlung angewendet trackFlex kombiniert die Verfahren 'trackFull' und 'trackShared'. Es erfolgt eine Umschaltung von 'trackFull' auf 'trackShared' - bei einer Bewölkung von >=80%. + bei einer Bewölkung von >=80%.
@@ -22749,8 +22737,6 @@ die ordnungsgemäße Anlagenkonfiguration geprüft werden.
    .flowg.text { stroke: none; fill: gray; font-size: 60px; }
    - .flowg.sun_active { stroke: orange; fill: orange; }
    - .flowg.sun_inactive { stroke: gray; fill: gray; }
    .flowg.bat25 { stroke: red; fill: red; }
    .flowg.bat50 { stroke: darkorange; fill: darkorange; }
    .flowg.bat75 { stroke: green; fill: green; }