diff --git a/fhem/CHANGED b/fhem/CHANGED
index 6b3dddbc5..3c0d349c9 100644
--- a/fhem/CHANGED
+++ b/fhem/CHANGED
@@ -1,5 +1,6 @@
# Add changes at the top of the list. Keep it in ASCII, and 80-char wide.
# Do not insert empty lines here, update check depends on it
+ - change: 76_SolarForecast: attr ctrlWeatherDevX to setupWeatherDevX,
- bufgix: 76_SMAInverter: fix PW Lengs Bug
- bugfix: 10_KNX: prevent set/get-cmd during fhem start
add sub dpts for dpt14, enfoce gadname rules
diff --git a/fhem/FHEM/76_SolarForecast.pm b/fhem/FHEM/76_SolarForecast.pm
index 2b406c62c..af5711cdb 100644
--- a/fhem/FHEM/76_SolarForecast.pm
+++ b/fhem/FHEM/76_SolarForecast.pm
@@ -155,6 +155,7 @@ BEGIN {
# Versions History intern
my %vNotesIntern = (
+ "1.31.0" => "20.08.2024 rename attributes ctrlWeatherDevX to setupWeatherDevX ",
"1.30.0" => "18.08.2024 new attribute flowGraphicShift, Forum:https://forum.fhem.de/index.php?msg=1318597 ",
"1.29.4" => "03.08.2024 delete writeCacheToFile from _getRoofTopData, _specialActivities: avoid loop caused by \@widgetreadings ",
"1.29.3" => "20.07.2024 eleminate hand over \$hash in _getRoofTopData routines, fix label 'gcon' to 'gcons' ",
@@ -388,7 +389,7 @@ my $WhtokJ = 3.6;
my $defmaxvar = 0.5; # max. Varianz pro Tagesberechnung Autokorrekturfaktor
my $definterval = 70; # Standard Abfrageintervall
my $slidenumdef = 3; # max. Anzahl der Arrayelemente in Schieberegistern
-my $weatherDevMax = 3; # max. Anzahl Wetter Devices (Attr ctrlWeatherDevX)
+my $weatherDevMax = 3; # max. Anzahl Wetter Devices (Attr setupWeatherDevX)
my $maxSoCdef = 95; # default Wert (%) auf den die Batterie maximal aufgeladen werden soll bzw. als aufgeladen gilt
my $carecycledef = 20; # max. Anzahl Tage die zwischen der Batterieladung auf maxSoC liegen dürfen
my $batSocChgDay = 5; # prozentuale SoC Änderung pro Tag
@@ -522,7 +523,7 @@ my @aconfigs = qw( affect70percentRule affectBatteryPreferredCharge affectConsFo
ctrlBatSocManagement ctrlConsRecommendReadings ctrlGenPVdeviation ctrlInterval
ctrlLanguage ctrlNextDayForecastReadings ctrlShowLink ctrlSolCastAPImaxReq
ctrlSolCastAPIoptimizeReq ctrlStatisticReadings ctrlUserExitFn
- ctrlWeatherDev1 ctrlWeatherDev2 ctrlWeatherDev3
+ setupWeatherDev1 setupWeatherDev2 setupWeatherDev3
disable
flowGraphicSize flowGraphicAnimate flowGraphicConsumerDistance flowGraphicShowConsumer
flowGraphicShowConsumerDummy flowGraphicShowConsumerPower flowGraphicShowConsumerRemainTime
@@ -609,9 +610,9 @@ my %hattr = ( # H
ctrlConsRecommendReadings => { fn => \&_attrcreateConsRecRdgs },
ctrlStatisticReadings => { fn => \&_attrcreateStatisticRdgs },
ctrlDebug => { fn => \&_attrctrlDebug },
- ctrlWeatherDev1 => { fn => \&_attrWeatherDev },
- ctrlWeatherDev2 => { fn => \&_attrWeatherDev },
- ctrlWeatherDev3 => { fn => \&_attrWeatherDev },
+ setupWeatherDev1 => { fn => \&_attrWeatherDev },
+ setupWeatherDev2 => { fn => \&_attrWeatherDev },
+ setupWeatherDev3 => { fn => \&_attrWeatherDev },
setupMeterDev => { fn => \&_attrMeterDev },
setupBatteryDev => { fn => \&_attrBatteryDev },
setupInverterDev => { fn => \&_attrInverterDev },
@@ -661,8 +662,8 @@ my %hqtxt = (
"set LINK plantConfiguration check" oder mit Druck auf das angebotene Icon.
Korrigieren sie bitte eventuelle Fehler und beachten sie mögliche Hinweise.
(Die Anzeigesprache kann mit dem Attribut "ctrlLanguage" umgestellt werden.)
} },
- cfd => { EN => qq{Please enter at least one weather forecast device with "attr LINK ctrlWeatherDev1"},
- DE => qq{Bitte geben sie mindestens ein Wettervorhersage Device mit "attr LINK ctrlWeatherDev1" an} },
+ cfd => { EN => qq{Please enter at least one weather forecast device with "attr LINK setupWeatherDev1"},
+ DE => qq{Bitte geben sie mindestens ein Wettervorhersage Device mit "attr LINK setupWeatherDev1" an} },
crd => { EN => qq{Please select the radiation forecast service with "attr LINK setupRadiationAPI"},
DE => qq{Bitte geben sie den Strahlungsvorhersage Dienst mit "attr LINK setupRadiationAPI" an} },
cid => { EN => qq{Please specify the Inverter device with "attr LINK setupInverterDev"},
@@ -1182,9 +1183,6 @@ sub Initialize {
"ctrlSolCastAPIoptimizeReq:1,0 ".
"ctrlStatisticReadings:multiple-strict,$srd ".
"ctrlUserExitFn:textField-long ".
- "ctrlWeatherDev1 ".
- "ctrlWeatherDev2 ".
- "ctrlWeatherDev3 ".
"disable:1,0 ".
"flowGraphicSize ".
"flowGraphicAnimate:1,0 ".
@@ -1232,6 +1230,9 @@ sub Initialize {
"setupInverterDev:textField-long ".
"setupInverterStrings ".
"setupMeterDev:textField-long ".
+ "setupWeatherDev1 ".
+ "setupWeatherDev2 ".
+ "setupWeatherDev3 ".
"setupRoofTops ".
"setupBatteryDev:textField-long ".
"setupRadiationAPI ".
@@ -1245,6 +1246,9 @@ sub Initialize {
# $hash->{FW_atPageEnd} = 1; # wenn 1 -> kein Longpoll ohne informid in HTML-Tag
$hash->{AttrRenameMap} = { "graphicBeamHeight" => "graphicBeamHeightLevel1", # 07.05.24
+ "ctrlWeatherDev1" => "setupWeatherDev1", # 20.08.24
+ "ctrlWeatherDev2" => "setupWeatherDev2",
+ "ctrlWeatherDev3" => "setupWeatherDev3",
};
eval { FHEM::Meta::InitMod( __FILE__, $hash ) }; ## no critic 'eval'
@@ -5669,7 +5673,7 @@ return;
}
################################################################
-# Attr ctrlWeatherDevX
+# Attr setupWeatherDevX
################################################################
sub _attrWeatherDev { ## no critic "not used"
my $paref = shift;
@@ -5687,11 +5691,11 @@ sub _attrWeatherDev { ## no critic "not used"
}
if ($aVal =~ /^OpenMeteo/xs) {
- if ($aName ne 'ctrlWeatherDev1') {
- return qq{Only the leading attribute 'ctrlWeatherDev1' can set to '$aVal'};
+ if ($aName ne 'setupWeatherDev1') {
+ return qq{Only the leading attribute 'setupWeatherDev1' can set to '$aVal'};
}
- InternalTimer (gettimeofday()+1, 'FHEM::SolarForecast::__setRadAPIdelayed', $hash, 0); # automatisch setupRadiationAPI setzen wenn ctrlWeatherDev1
+ InternalTimer (gettimeofday()+1, 'FHEM::SolarForecast::__setRadAPIdelayed', $hash, 0); # automatisch setupRadiationAPI setzen wenn setupWeatherDev1
return;
}
@@ -5723,12 +5727,12 @@ sub _attrRadiationAPI { ## no critic "not used"
return qq{The device "$aVal" doesn't exist or has no TYPE "DWD_OpenData"};
}
- my $awdev1 = AttrVal ($name, 'ctrlWeatherDev1', '');
+ my $awdev1 = AttrVal ($name, 'setupWeatherDev1', '');
if (($awdev1 eq 'OpenMeteoDWD-API' && $aVal ne 'OpenMeteoDWD-API') ||
($awdev1 eq 'OpenMeteoDWDEnsemble-API' && $aVal ne 'OpenMeteoDWDEnsemble-API') ||
($awdev1 eq 'OpenMeteoWorld-API' && $aVal ne 'OpenMeteoWorld-API')) {
- return "The attribute 'ctrlWeatherDev1' is set to '$awdev1'. \n".
+ return "The attribute 'setupWeatherDev1' is set to '$awdev1'. \n".
"Change that attribute to another weather device first if you want use an other API.";
}
@@ -5798,7 +5802,7 @@ sub __setRadAPIdelayed {
my $hash = shift;
my $name = $hash->{NAME};
- my $awdev1 = AttrVal ($name, 'ctrlWeatherDev1', '');
+ my $awdev1 = AttrVal ($name, 'setupWeatherDev1', '');
CommandAttr (undef, "$name setupRadiationAPI $awdev1"); # automatisch setupRadiationAPI setzen
@@ -6428,7 +6432,7 @@ sub _addDynAttr {
my $hash = shift;
my $type = $hash->{TYPE};
- ## Attr ctrlWeatherDevX zur Laufzeit hinzufügen
+ ## Attr setupWeatherDevX zur Laufzeit hinzufügen
#################################################
my $adwds = '';
my @alldwd = devspec2array ("TYPE=DWD_OpenData");
@@ -6445,16 +6449,17 @@ sub _addDynAttr {
my @deva = split " ", $modules{$type}{AttrList};
- my $atd = 'ctrlWeatherDev|setupRadiationAPI';
+ my $atd = 'setupWeatherDev|setupRadiationAPI';
@deva = grep {!/$atd/} @deva;
for my $step (1..$weatherDevMax) {
if ($step == 1) {
- push @deva, ($adwds ? "ctrlWeatherDev1:OpenMeteoDWD-API,OpenMeteoDWDEnsemble-API,OpenMeteoWorld-API,$adwds" : "ctrlWeatherDev1:OpenMeteoDWD-API,OpenMeteoDWDEnsemble-API,OpenMeteoWorld-API");
+ push @deva, ($adwds ? "setupWeatherDev1:OpenMeteoDWD-API,OpenMeteoDWDEnsemble-API,OpenMeteoWorld-API,$adwds" :
+ "setupWeatherDev1:OpenMeteoDWD-API,OpenMeteoDWDEnsemble-API,OpenMeteoWorld-API");
next;
}
- push @deva, ($adwds ? "ctrlWeatherDev".$step.":$adwds" : "");
+ push @deva, ($adwds ? "setupWeatherDev".$step.":$adwds" : "");
}
push @deva, "setupRadiationAPI:$rdd ";
@@ -6495,19 +6500,7 @@ sub centralTask {
return if(!$init_done);
### nicht mehr benötigte Daten verarbeiten - Bereich kann später wieder raus !!
- ##########################################################################################################################
- my $val4 = ReadingsVal ($name, 'currentRadiationAPI', ''); # 10.06.2024
- if ($val4) {
- CommandAttr (undef, "$name setupRadiationAPI $val4");
- readingsDelete ($hash, 'currentRadiationAPI');
- }
-
- my $val5 = ReadingsVal ($name, 'modulePeakString', ''); # 12.06.2024
- if ($val5) {
- CommandAttr (undef, "$name setupStringPeak $val5");
- readingsDelete ($hash, 'modulePeakString');
- }
-
+ ##########################################################################################################################
my $dir = ReadingsVal ($name, 'moduleAzimuth', ''); # 16.06.2024
if ($dir) {
readingsSingleUpdate ($hash, 'setupStringAzimuth', $dir, 0);
@@ -7362,7 +7355,7 @@ sub _transferWeatherValues {
my $chour = $paref->{chour};
my $hash = $defs{$name};
- my ($valid, $fcname, $apiu) = isWeatherDevValid ($hash, 'ctrlWeatherDev1'); # Standard Weather Forecast Device
+ my ($valid, $fcname, $apiu) = isWeatherDevValid ($hash, 'setupWeatherDev1'); # Standard Weather Forecast Device
return if(!$valid);
my $type = $paref->{type};
@@ -7443,7 +7436,7 @@ return;
}
################################################################
-# lese Wetterdaten aus Device im Attribut ctrlWeatherDevX
+# lese Wetterdaten aus Device im Attribut setupWeatherDevX
# X = laufende Schleifenvariable $step
################################################################
sub __readDataWeather {
@@ -7454,7 +7447,7 @@ sub __readDataWeather {
my $step = $paref->{step};
my $hash = $defs{$name};
- my ($valid, $fcname, $apiu) = isWeatherDevValid ($hash, 'ctrlWeatherDev'.$step); # Weather Forecast Device
+ my ($valid, $fcname, $apiu) = isWeatherDevValid ($hash, 'setupWeatherDev'.$step); # Weather Forecast Device
return if(!$valid);
if ($apiu) { # eine API wird verwendet
@@ -7562,7 +7555,7 @@ sub __mergeDataWeather {
my $ds = 0;
for my $wd (1..$weatherDevMax) {
- my ($valid, $fcname, $apiu) = isWeatherDevValid ($hash, 'ctrlWeatherDev'.$wd); # Weather Forecast Device
+ my ($valid, $fcname, $apiu) = isWeatherDevValid ($hash, 'setupWeatherDev'.$wd); # Weather Forecast Device
$ds++ if($valid);
}
@@ -11689,7 +11682,7 @@ sub _checkSetupNotComplete {
##########################################################################################
my $is = AttrVal ($name, 'setupInverterStrings', undef); # String Konfig
- my $wedev = AttrVal ($name, 'ctrlWeatherDev1', undef); # Device Vorhersage Wetterdaten (Bewölkung etc.)
+ my $wedev = AttrVal ($name, 'setupWeatherDev1', undef); # Device Vorhersage Wetterdaten (Bewölkung etc.)
my $radev = AttrVal ($name, 'setupRadiationAPI', undef); # Device Strahlungsdaten Vorhersage
my $indev = AttrVal ($name, 'setupInverterDev', undef); # Inverter Device
my $medev = AttrVal ($name, 'setupMeterDev', undef); # Meter Device
@@ -13638,18 +13631,14 @@ sub _flowGraphic {
my $csc_style = $csc && $cpv ? 'flowg active_out' : 'flowg inactive_out';
my $cgfi_style = $cgfi ? 'flowg active_out' : 'flowg inactive_out';
- my $vbminx = -10 * $flowgshift; # min-x and min-y represent the smallest X and Y coordinates that the viewBox may have
- my $vbminy = -25;
- my $vbwidth = 800; # width and height specify the viewBox size
- my $vbhight = !$flowgcons ? 480 :
- $flowgconTime ? 700 :
- 680;
+ my $vbminx = -10 * $flowgshift; # min-x and min-y represent the smallest X and Y coordinates that the viewBox may have
+ my $vbminy = -25;
+ my $vbwidth = 800; # width and height specify the viewBox size
+ my $vbhight = !$flowgcons ? 480 :
+ $flowgconTime ? 700 :
+ 680;
my $vbox = "$vbminx $vbminy $vbwidth $vbhight";
-
- #my $vbox = !$flowgcons ? "$vbminx -25 800 480" :
- # $flowgconTime ? "$vbminx -25 800 700" :
- # "$vbminx -25 800 680";
my $ret = << "END0";
-