From d50896e4b8f564911d43759ad2da42e631f69d5a Mon Sep 17 00:00:00 2001 From: nasseeder1 Date: Sat, 22 Mar 2025 09:30:35 +0000 Subject: [PATCH] 76_SolarForecast: contrib 1.49.0 git-svn-id: https://svn.fhem.de/fhem/trunk@29776 2b470e98-0d58-463d-a4d8-8e2adae1ed80 --- fhem/contrib/DS_Starter/76_SolarForecast.pm | 61 +++++++++------------ 1 file changed, 26 insertions(+), 35 deletions(-) diff --git a/fhem/contrib/DS_Starter/76_SolarForecast.pm b/fhem/contrib/DS_Starter/76_SolarForecast.pm index 86c49a926..cef6baabf 100644 --- a/fhem/contrib/DS_Starter/76_SolarForecast.pm +++ b/fhem/contrib/DS_Starter/76_SolarForecast.pm @@ -166,7 +166,7 @@ my %vNotesIntern = ( "__calcPVestimates: pv power summary of all strings connected to inverter limited to inverter capacity summary ". "_batChargeRecmd: fix calc if more than one batteries are installed, set aiDecTree: new option rawDataGHIreplace ". "new Attr plantControl with keys feedinPowerLimit, batteryPreferredCharge, consForecastInPlanning ". - "Attr affectBatteryPreferredCharge, affectConsForecastInPlanning are obsolete ", + "Attr affectBatteryPreferredCharge, affectConsForecastInPlanning, ctrlShowLink are obsolete ", "1.48.0" => "14.03.2025 edit commandref, add graphicBeam layer 5 and 6, attr ctrlAIdataStorageDuration, ctrlAIshiftTrainStart removed ", "1.47.3" => "11.03.2025 adjust weather_ids and management of significant weather, _calcDataEveryFullHour: change attrInvChangedTs Management ". "split __batteryOnBeam into _beamFillupBatValues and itself, expand bat key 'show' by top, bottom ". @@ -575,7 +575,7 @@ my @aconfigs = qw( affectConsForecastIdentWeekdays ctrlBackupFilesKeep ctrlConsRecommendReadings ctrlGenPVdeviation ctrlInterval ctrlLanguage ctrlNextDayForecastReadings ctrlNextHoursSoCForecastReadings - ctrlShowLink ctrlSolCastAPImaxReq + ctrlSolCastAPImaxReq ctrlSolCastAPIoptimizeReq ctrlSpecialReadings ctrlUserExitFn disable flowGraphicControl graphicBeamWidth @@ -1543,7 +1543,6 @@ sub Initialize { "ctrlLanguage:DE,EN ". "ctrlNextDayForecastReadings:multiple-strict,$hod ". "ctrlNextHoursSoCForecastReadings ". - "ctrlShowLink:1,0 ". "ctrlSolCastAPImaxReq:selectnumbers,5,5,60,0,lin ". "ctrlSolCastAPIoptimizeReq:1,0 ". "ctrlSpecialReadings:multiple-strict,$srd ". @@ -1594,7 +1593,7 @@ sub Initialize { ### nicht mehr benötigte Daten verarbeiten - Bereich kann später wieder raus !! ########################################################################################################################## my $av = 'obsolete#-#use#attr#plantControl#instead'; - $hash->{AttrList} .= " affectBatteryPreferredCharge:$av affectConsForecastInPlanning:$av"; # 22.03.2025 + $hash->{AttrList} .= " affectBatteryPreferredCharge:$av affectConsForecastInPlanning:$av ctrlShowLink:$av"; # 22.03.2025 ########################################################################################################################## $hash->{FW_hideDisplayName} = 1; # Forum 88667 @@ -5874,7 +5873,7 @@ sub Attr { ### nicht mehr benötigte Daten verarbeiten - Bereich kann später wieder raus !! ###################################################################################################################### - if ($cmd eq 'set' && $aName =~ /^affectBatteryPreferredCharge|affectConsForecastInPlanning$/) { # 22.03.2025 + if ($cmd eq 'set' && $aName =~ /^affectBatteryPreferredCharge|affectConsForecastInPlanning|ctrlShowLink$/) { # 22.03.2025 #my $msg = "The attribute $aName is obsolete and will be deleted soon. Please press 'save config' when restart is finished."; my $msg = "The attribute $aName is replaced by 'plantControl'."; if (!$init_done) { @@ -6352,6 +6351,7 @@ sub _attrplantControl { ## no critic "not used" for my $av ( qw( batteryPreferredCharge consForecastInPlanning feedinPowerLimit + showLink ) ) { delete $data{$name}{current}{$av}; @@ -6362,6 +6362,7 @@ sub _attrplantControl { ## no critic "not used" batteryPreferredCharge => '([0-9]|[1-9][0-9]|100)', consForecastInPlanning => '0|1', feedinPowerLimit => '\d+', + showLink => '0|1', }; my ($a, $h) = parseParams ($aVal); @@ -7996,12 +7997,22 @@ sub centralTask { my $pc1 = AttrVal ($name, 'plantControl', ''); if (defined $afp) { - my $newval = $apc." consForecastInPlanning=$afp"; + my $newval = $pc1." consForecastInPlanning=$afp"; CommandAttr (undef, "$name plantControl $newval"); ::CommandDeleteAttr (undef, "$name affectConsForecastInPlanning"); } ###### + my $csl = AttrVal ($name, 'ctrlShowLink', undef); # 22.03.2025 + my $pc2 = AttrVal ($name, 'plantControl', ''); + + if (defined $csl) { + my $newval = $pc2." showLink=$csl"; + CommandAttr (undef, "$name plantControl $newval"); + ::CommandDeleteAttr (undef, "$name ctrlShowLink"); + } + ###### + my $n = 0; # 01.02.25 -> Datenmigration pvrlsum, pvfcsum, dnumsum in pvrl_*, pvfc_* for my $hh (1..24) { $hh = sprintf "%02d", $hh; @@ -13711,7 +13722,7 @@ sub entryGraphic { my $colspan = $maxhours + 2; my $ret = q{}; - $ret .= "$dlink
" if(AttrVal($name, 'ctrlShowLink', 0)); + $ret .= "$dlink
" if(CurrentVal ($name, 'showLink', 0)); #$ret .= ""; $ret .= ""; @@ -23999,12 +24010,6 @@ to ensure that the system configuration is correct.
- -
  • alias
    - In connection with "ctrlShowLink" any display name. -
  • -
    -
  • consumerAdviceIcon
    Defines the type of information about the planned switching times of a consumer in the consumer legend. @@ -24404,13 +24409,6 @@ to ensure that the system configuration is correct.

  • - -
  • ctrlShowLink
    - Display of the link to the detailed view of the device above the graphic area.
    - (default: 1) -
  • -
    -
  • ctrlSolCastAPImaxReq
    (only when using Model SolCastAPI)

    @@ -24918,12 +24916,15 @@ to ensure that the system configuration is correct. 0 - the consumers are scheduled on the basis of the PV forecast (default) 1 - consumers are scheduled on the basis of the PV forecast and the consumption forecast + showLink Display of a link to the detailed view of the device above the graphics area + 0 - Display off, 1 - Display on, default: 0 +
  • @@ -26521,12 +26522,6 @@ die ordnungsgemäße Anlagenkonfiguration geprüft werden.
    - -
  • alias
    - In Verbindung mit "ctrlShowLink" ein beliebiger Anzeigename. -
  • -
    -
  • consumerAdviceIcon
    Definiert die Art der Information über die geplanten Schaltzeiten eines Verbrauchers in der Verbraucherlegende. @@ -26926,13 +26921,6 @@ die ordnungsgemäße Anlagenkonfiguration geprüft werden.

  • - -
  • ctrlShowLink
    - Anzeige des Links zur Detailansicht des Device über dem Grafikbereich
    - (default: 1) -
  • -
    -
  • ctrlSolCastAPImaxReq
    (nur bei Verwendung Model SolCastAPI)

    @@ -27437,12 +27425,15 @@ die ordnungsgemäße Anlagenkonfiguration geprüft werden. 0 - die Einplanung der Verbraucher erfolgt auf Grundlage der PV Prognose (default) 1 - die Einplanung der Verbraucher erfolgt auf Grundlage der PV Prognose und der Prognose des Verbrauchs + showLink Anzeige eines Links zur Detailansicht des Device über dem Grafikbereich + 0 - Anzeige aus, 1 - Anzeige an, default: 0 +