diff --git a/fhem/FHEM/76_SolarForecast.pm b/fhem/FHEM/76_SolarForecast.pm
index 61238e680..7d03e8cb5 100644
--- a/fhem/FHEM/76_SolarForecast.pm
+++ b/fhem/FHEM/76_SolarForecast.pm
@@ -160,7 +160,8 @@ BEGIN {
# Versions History intern
my %vNotesIntern = (
- "1.49.1" => "25.03.2025 fix batteryPreferredCharge: https://forum.fhem.de/index.php?msg=1337802 ",
+ "1.49.1" => "25.03.2025 fix batteryPreferredCharge: https://forum.fhem.de/index.php?msg=1337802, Attr ctrlBackupFilesKeep is ".
+ "obsolete and replaced by plantControl->backupFilesKeep ",
"1.49.0" => "23.03.2025 _listDataPoolApiData: fix warning item1, new option OpenMeteoDWD_D2-API with preparation for satellite support ".
"add Attr graphicBeamHeightLevel3, Compatibility of Rad1h data between DWD and OpenMeteo established ".
"set reset aiData deletes raw data also, _transferAPIRadiationValues: AI PV estimate limited to inverter capacity summary ".
@@ -573,7 +574,6 @@ my @aconfigs = qw( affectConsForecastIdentWeekdays affectConsForecastLastDays
affectSolCastPercentile
aiControl
consumerLegend consumerAdviceIcon consumerLink
- ctrlBackupFilesKeep
ctrlConsRecommendReadings ctrlGenPVdeviation ctrlInterval
ctrlLanguage ctrlNextDayForecastReadings ctrlNextHoursSoCForecastReadings
ctrlSolCastAPImaxReq
@@ -1536,7 +1536,6 @@ sub Initialize {
"consumerLegend:none,icon_top,icon_bottom,text_top,text_bottom ".
"consumerAdviceIcon ".
"consumerLink:0,1 ".
- "ctrlBackupFilesKeep ".
"ctrlConsRecommendReadings:multiple-strict,$allcs ".
"ctrlDebug:multiple-strict,$dm,#10 ".
"ctrlGenPVdeviation:daily,continuously ".
@@ -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 ctrlShowLink:$av"; # 22.03.2025
+ $hash->{AttrList} .= " affectBatteryPreferredCharge:$av affectConsForecastInPlanning:$av ctrlShowLink:$av ctrlBackupFilesKeep:$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|ctrlShowLink$/) { # 22.03.2025
+ if ($cmd eq 'set' && $aName =~ /^affectBatteryPreferredCharge|affectConsForecastInPlanning|ctrlShowLink|ctrlBackupFilesKeep$/) { # 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) {
@@ -5937,7 +5936,7 @@ sub Attr {
}
if ($cmd eq 'set') {
- if ($aName eq 'ctrlInterval' || $aName eq 'ctrlBackupFilesKeep') {
+ if ($aName eq 'ctrlInterval') {
unless ($aVal =~ /^[0-9]+$/x) {
return qq{Invalid value for $aName. Use only figures 0-9!};
}
@@ -7270,7 +7269,7 @@ sub deleteOldBckpFiles {
my $name = shift;
my $file = shift;
- my $dfk = AttrVal ($name, 'ctrlBackupFilesKeep', 3);
+ my $dfk = CurrentVal ($name, 'backupFilesKeep', 3);
my $bfform = $file.'_.*';
if (!opendir (DH, $cachedir)) {
@@ -8014,6 +8013,16 @@ sub centralTask {
}
######
+ my $cbk = AttrVal ($name, 'ctrlBackupFilesKeep', undef); # 25.03.2025
+ my $pc3 = AttrVal ($name, 'plantControl', '');
+
+ if (defined $cbk) {
+ my $newval = $pc3." backupFilesKeep=$cbk";
+ CommandAttr (undef, "$name plantControl $newval");
+ ::CommandDeleteAttr (undef, "$name ctrlBackupFilesKeep");
+ }
+ ######
+
my $n = 0; # 01.02.25 -> Datenmigration pvrlsum, pvfcsum, dnumsum in pvrl_*, pvfc_*
for my $hh (1..24) {
$hh = sprintf "%02d", $hh;
@@ -8655,8 +8664,8 @@ sub _specialActivities {
Log3 ($name, 4, "$name - Daily special tasks - Task 5 started");
- if (AttrVal ($name, 'ctrlBackupFilesKeep', 3)) {
- periodicWriteMemcache ($hash, 'bckp'); # Backup Files erstellen und alte Versionen löschen (unterbleibt bei ctrlBackupFilesKeep == 0)
+ if (CurrentVal ($name, 'backupFilesKeep', 3)) {
+ periodicWriteMemcache ($hash, 'bckp'); # Backup Files erstellen und alte Versionen löschen (unterbleibt bei 'backupFilesKeep' == 0)
}
Log3 ($name, 4, "$name - Daily special tasks - Task 5 finished");
@@ -23191,16 +23200,16 @@ to ensure that the system configuration is correct.
- backup | Saves the active in-memory structures with the current timestamp. |
- | ctrlBackupFilesKeep generations of the files are saved. Older versions are deleted. |
- | Files: PVH_SolarForecast_<name>_<Timestamp>, PVC_SolarForecast_<name>_<Timestamp> |
- | |
- save | The active in-memory structures are saved. |
- | Files: PVH_SolarForecast_<name>, PVC_SolarForecast_<name> |
- | |
- recover-<File> | Restores the data of the selected backup file as an active in-memory structure. |
- | To avoid inconsistencies, the PVH.* and PVC.* files should be restored in pairs |
- | with the same time stamp. |
+ backup | Saves the active in-memory structures with the current timestamp. |
+ | plantControl->backupFilesKeep generations of the files are saved. Older versions are deleted. |
+ | Files: PVH_SolarForecast_<name>_<Timestamp>, PVC_SolarForecast_<name>_<Timestamp> |
+ | |
+ save | The active in-memory structures are saved. |
+ | Files: PVH_SolarForecast_<name>, PVC_SolarForecast_<name> |
+ | |
+ recover-<File> | Restores the data of the selected backup file as an active in-memory structure. |
+ | To avoid inconsistencies, the PVH.* and PVC.* files should be restored in pairs |
+ | with the same time stamp. |
@@ -24239,16 +24248,6 @@ to ensure that the system configuration is correct.
-
- ctrlBackupFilesKeep <Integer>
- Defines the number of generations of backup files
- (see also set <name> operatingMemory backup).
- If ctrlBackupFilesKeep explit is set to '0', no automatic generation and cleanup of backup files takes place.
- Manual execution with the aforementioned set command is still possible.
- (default: 3)
-
-
-
ctrlBatSocManagementXX lowSoc=<Value> upSoC=<Value> [maxSoC=<Value>] [careCycle=<Value>]
If a battery device (setupBatteryDevXX) is installed, this attribute activates the battery SoC management for this
@@ -24920,12 +24919,18 @@ to ensure that the system configuration is correct.
showLink | Display of a link to the detailed view of the device above the graphics area |
| 0 - Display off, 1 - Display on, default: 0 |
| |
+ backupFilesKeep | Defines the number of generations of backup files. |
+ | (see set <name> operatingMemory backup) |
+ | If ctrlBackupFilesKeep explit is set to '0', no automatic generation and cleanup of backup files takes place. |
+ | Manual execution with the aforementioned set command is still possible. |
+ | Wert: Integer, default: 3 |
+ | |
Beispiel:
- attr <name> plantControl feedinPowerLimit=4800 consForecastInPlanning=1 showLink=1
+ attr <name> plantControl feedinPowerLimit=4800 consForecastInPlanning=1 showLink=1 backupFilesKeep=2
@@ -25695,16 +25700,16 @@ die ordnungsgemäße Anlagenkonfiguration geprüft werden.
- backup | Sichert die aktiven In-Memory Strukturen mit dem aktuellen Zeitstempel. |
- | Es werden ctrlBackupFilesKeep Generationen der Dateien gespeichert. Ältere Versionen werden gelöscht. |
- | Dateien: PVH_SolarForecast_<name>_<Zeitstempel>, PVC_SolarForecast_<name>_<Zeitstempel> |
- | |
- save | Die aktiven In-Memory Strukturen werden gespeichert. |
- | Dateien: PVH_SolarForecast_<name>, PVC_SolarForecast_<name> |
- | |
- recover-<Datei> | Stellt die Daten der ausgewählten Sicherungsdatei als aktive In-Memory Struktur wieder her. |
- | Um Inkonsistenzen zu vermeiden, sollten die Dateien PVH.* und PVC.* mit dem gleichen |
- | Zeitstempel paarweise recovert werden. |
+ backup | Sichert die aktiven In-Memory Strukturen mit dem aktuellen Zeitstempel. |
+ | Es werden plantControl->backupFilesKeep Generationen der Dateien gespeichert. Ältere Versionen werden gelöscht. |
+ | Dateien: PVH_SolarForecast_<name>_<Zeitstempel>, PVC_SolarForecast_<name>_<Zeitstempel> |
+ | |
+ save | Die aktiven In-Memory Strukturen werden gespeichert. |
+ | Dateien: PVH_SolarForecast_<name>, PVC_SolarForecast_<name> |
+ | |
+ recover-<Datei> | Stellt die Daten der ausgewählten Sicherungsdatei als aktive In-Memory Struktur wieder her. |
+ | Um Inkonsistenzen zu vermeiden, sollten die Dateien PVH.* und PVC.* mit dem gleichen |
+ | Zeitstempel paarweise recovert werden. |
@@ -26750,16 +26755,6 @@ die ordnungsgemäße Anlagenkonfiguration geprüft werden.
-
- ctrlBackupFilesKeep <Ganzzahl>
- Legt die Anzahl der Generationen von Sicherungsdateien
- (siehe set <name> operatingMemory backup) fest.
- Ist ctrlBackupFilesKeep explit auf '0' gesetzt, erfolgt keine automatische Generierung und Bereinigung von Sicherungsdateien.
- Eine manuelle Ausführung mit dem genannten Set-Kommando ist weiterhin möglich.
- (default: 3)
-
-
-
ctrlBatSocManagementXX lowSoc=<Wert> upSoC=<Wert> [maxSoC=<Wert>] [careCycle=<Wert>]
Sofern ein Batterie Device (setupBatteryDevXX) installiert ist, aktiviert dieses Attribut das Batterie
@@ -27413,28 +27408,34 @@ die ordnungsgemäße Anlagenkonfiguration geprüft werden.
- batteryPreferredCharge | Verbraucher mit dem Mode can werden erst dann eingeschaltet, wenn die angegebene Batterieladung (%) erreicht ist. |
- | Verbraucher mit dem Mode must beachten die Vorrangladung der Batterie nicht. |
- | Wert: Ganzzahl 0..100, default: 0 |
- | |
- feedinPowerLimit | Einspeiselimit der Gesamtanlage in das öffentliche Netz in Watt. |
- | SolarForecast limitiert die Einspeisung nicht, verwendet diese Angabe jedoch |
- | innerhalb des Batterie-Lademanagements zur Vermeidung einer Anlagenabregelung. |
- | Wert: Ganzzahl, default: unbegrent |
- | |
- consForecastInPlanning | Der Schlüssel bestimmt die Vorgehensweise bei der Einplanung der registrierten Verbraucher. |
- | 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 |
- | |
+ batteryPreferredCharge | Verbraucher mit dem Mode can werden erst dann eingeschaltet, wenn die angegebene Batterieladung (%) erreicht ist. |
+ | Verbraucher mit dem Mode must beachten die Vorrangladung der Batterie nicht. |
+ | Wert: Ganzzahl 0..100, default: 0 |
+ | |
+ feedinPowerLimit | Einspeiselimit der Gesamtanlage in das öffentliche Netz in Watt. |
+ | SolarForecast limitiert die Einspeisung nicht, verwendet diese Angabe jedoch |
+ | innerhalb des Batterie-Lademanagements zur Vermeidung einer Anlagenabregelung. |
+ | Wert: Ganzzahl, default: unbegrent |
+ | |
+ consForecastInPlanning | Der Schlüssel bestimmt die Vorgehensweise bei der Einplanung der registrierten Verbraucher. |
+ | 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 |
+ | |
+ backupFilesKeep | Legt die Anzahl der Generationen von Sicherungsdateien fest. |
+ | (siehe set <name> operatingMemory backup) |
+ | Ist ctrlBackupFilesKeep explit auf '0' gesetzt, erfolgt keine automatische Generierung und Bereinigung von Sicherungsdateien. |
+ | Eine manuelle Ausführung mit dem genannten Set-Kommando ist weiterhin möglich. |
+ | Wert: Ganzzahl, default: 3 |
+ | |
Beispiel:
- attr <name> plantControl feedinPowerLimit=4800 consForecastInPlanning=1 showLink=1
+ attr <name> plantControl feedinPowerLimit=4800 consForecastInPlanning=1 showLink=1 backupFilesKeep=2