diff --git a/fhem/contrib/DS_Starter/76_SolarForecast.pm b/fhem/contrib/DS_Starter/76_SolarForecast.pm index bf35c2570..c6adb6562 100644 --- a/fhem/contrib/DS_Starter/76_SolarForecast.pm +++ b/fhem/contrib/DS_Starter/76_SolarForecast.pm @@ -160,6 +160,7 @@ BEGIN { # Versions History intern my %vNotesIntern = ( + "1.52.13"=> "16.06.2025 _genSpecialReadings: new option remainingHrsWoChargeRcmdBat_XX ", "1.52.12"=> "15.06.2025 readCacheFile: option aitrained -> Code optimized for saving memory ". "fillupMessageSystem: prevent Icon failore if SV contain spaces ". "setupBatteryDevXX: 'dyn' -> Battery color can be dynamically set depending from SoC value ", @@ -1453,6 +1454,12 @@ my %hcsr = ( $hcsr{'todayBatOut_'.$bn}{par} = 99; $hcsr{'todayBatOut_'.$bn}{unit} = ' Wh'; $hcsr{'todayBatOut_'.$bn}{def} = 0; + + $hcsr{'remainingHrsWoChargeRcmdBat_'.$bn}{fnr} = 5; + $hcsr{'remainingHrsWoChargeRcmdBat_'.$bn}{fn} = \&NexthoursVal; + $hcsr{'remainingHrsWoChargeRcmdBat_'.$bn}{par} = 'rcdchargebat'.$bn; + $hcsr{'remainingHrsWoChargeRcmdBat_'.$bn}{unit} = ''; + $hcsr{'remainingHrsWoChargeRcmdBat_'.$bn}{def} = '-'; } # Funktiontemplate zur Speicherung von Werten in pvHistory @@ -14396,6 +14403,24 @@ sub _genSpecialReadings { storeReading ($prpo.'_'.$kpi, $d2c); } + elsif ($kpi =~ /remainingHrsWoChargeRcmdBat_/xs) { + my $bn = (split "_", $kpi)[1]; + my $n = 0; + + for my $idx (sort keys %{$data{$name}{nexthours}}) { + my $istoday = &{$hcsr{$kpi}{fn}} ($name, $idx, 'today', 0); + last if(!$istoday); + + my $rcdcharge = &{$hcsr{$kpi}{fn}} ($name, $idx, $hcsr{$kpi}{par}, $def); + + if (!$rcdcharge) { + $n++; + } + } + + storeReading ($prpo.'_'.$kpi, $n); + + } elsif ($kpi eq 'todayGridFeedIn') { my $idfi = &{$hcsr{$kpi}{fn}} ($hash, $hcsr{$kpi}{par}, 'initdayfeedin', $def); # initialer Tagesstartwert my $cfi = &{$hcsr{$kpi}{fn}} ($hash, $hcsr{$kpi}{par}, 'feedintotal', $def); # aktuelles total Feed In @@ -14710,7 +14735,7 @@ sub entryGraphic { lotype => CurrentVal ($name, 'layoutType', 'double'), hourstyle => CurrentVal ($name, 'hourStyle', ''), hdrDetail => CurrentVal ($name, 'headerDetail', 'all'), # ermöglicht den Inhalt zu begrenzen, um bspw. passgenau in ftui einzubetten - fsize => CurrentVal ($name, 'spaceSize', SPACESIZE), + spacesz => CurrentVal ($name, 'spaceSize', SPACESIZE), kw => CurrentVal ($name, 'energyUnit', 'Wh'), clegendpos => CurrentVal ($name, 'showLegend', 'icon_top'), # Lage und Art Cunsumer Legende clink => CurrentVal ($name, 'detailLink', 1), # Link zur Detailansicht des Verbrauchers @@ -16682,7 +16707,7 @@ sub _beamGraphic { my $show_diff = $paref->{show_diff}; # zusätzliche Anzeige $di{} in allen Typen my $lotype = $paref->{lotype}; my $height = $paref->{height}; - my $fsize = $paref->{fsize}; + my $spacesz = $paref->{spacesz}; my $kw = $paref->{kw}; my $colorb1 = $paref->{colorb1}; my $colorb2 = $paref->{colorb2}; @@ -16775,13 +16800,13 @@ sub _beamGraphic { # Berechnung der Zonen ######################## if ($lotype eq 'single') { - $he = int(($maxVal - $hfcg->{$i}{beam1}) / $maxVal * $height) + $fsize; # Der zusätzliche Offset durch $fsize verhindert bei den meisten Skins dass die Grundlinie der Balken nach unten durchbrochen wird - $z3 = int($height + $fsize - $he); + $he = int(($maxVal - $hfcg->{$i}{beam1}) / $maxVal * $height) + $spacesz; # Der zusätzliche Offset durch $spacesz verhindert bei den meisten Skins dass die Grundlinie der Balken nach unten durchbrochen wird + $z3 = int($height + $spacesz - $he); $titz3 = qq/title="$hfcg->{0}{beam1txt}"/; } if ($lotype eq 'double') { - # he - freier der Raum über den Balken. fsize wird nicht verwendet, da bei diesem Typ keine Zahlen über den Balken stehen + # he - freier der Raum über den Balken. spacesz wird nicht verwendet, da bei diesem Typ keine Zahlen über den Balken stehen # z2 - primärer Balkenwert ggf. mit Icon # z3 - sekundärer Balkenwert, bei zu kleinem Wert wird der Platz komplett Zone 2 zugeschlagen und nicht angezeigt # z2 und z3 nach Bedarf tauschen, wenn sekundärer Balkenwert > primärer Balkenwert @@ -16805,17 +16830,17 @@ sub _beamGraphic { $z2 = int (($z2 - $z3) / $maxVal * $height); $z3 = int ($height - $he - $z2); # was von maxVal noch übrig ist - if ($z3 < int($fsize / 2)) { # dünnen Strichbalken vermeiden / ca. halbe Zeichenhöhe + if ($z3 < int($spacesz / 2)) { # dünnen Strichbalken vermeiden / ca. halbe Zeichenhöhe $z2 += $z3; $z3 = 0; } } if ($lotype eq 'diff') { - # he - freier der Raum über den Balken , Zahl positiver Wert + fsize + # he - freier der Raum über den Balken , Zahl positiver Wert + spacesz # z2 - positiver Balken inkl Icon # z3 - negativer Balken - # z4 - Zahl negativer Wert + fsize + # z4 - Zahl negativer Wert + spacesz my ($px_pos,$px_neg); my $maxValBeam = 0; # ToDo: maxValBeam noch aus maxVal ableiten @@ -16858,9 +16883,9 @@ sub _beamGraphic { $z4 = (!$px_neg || !$minDif) ? 0 : int((abs($minDif)-$z3) / abs($minDif) * $px_neg); # Teilung durch 0 unbedingt vermeiden $z3 = ($px_neg - $z4); - # Beiden Zonen die Werte ausgeben könnten muß fsize als zusätzlicher Raum zugeschlagen werden ! - $he += $fsize; - $z4 += $fsize if($z3); # komplette Grafik ohne negativ Balken, keine Ausgabe von z3 & z4 + # Beiden Zonen die Werte ausgeben könnten muß spacesz als zusätzlicher Raum zugeschlagen werden ! + $he += $spacesz; + $z4 += $spacesz if($z3); # komplette Grafik ohne negativ Balken, keine Ausgabe von z3 & z4 } ## Erstellung der Balken @@ -25892,44 +25917,45 @@ to ensure that the system configuration is correct.
| BatPowerIn_Sum | the sum of the current battery charging power of all defined battery devices |
| BatPowerOut_Sum | the sum of the current battery discharge power of all defined battery devices |
| BatWeightedTotalSOC | the resulting (weighted) SOC across all installed batteries in % |
| allStringsFullfilled | Fulfillment status of error-free generation of all strings |
| conForecastTillNextSunrise | Consumption forecast from current hour to the coming sunrise |
| currentAPIinterval | the current polling interval of the selected radiation data API in seconds |
| currentRunMtsConsumer_XX | the running time (minutes) of the consumer "XX" since the last switch-on. (last running cycle) |
| dayAfterTomorrowPVforecast | provides the forecast of PV generation for the day after tomorrow (if available) without autocorrection (raw data) |
| daysUntilBatteryCare_XX | Days until the next battery XX maintenance (reaching the charge 'maxSoC' from attribute ctrlBatSocManagementXX) |
| lastretrieval_time | the last retrieval time of the selected radiation data API |
| lastretrieval_timestamp | the timestamp of the last retrieval time of the selected radiation data API |
| response_message | the last status message of the selected radiation data API |
| runTimeAvgDayConsumer_XX | the average running time (minutes) of consumer "XX" on one day |
| runTimeCentralTask | the runtime of the last SolarForecast interval (total process) in seconds |
| runTimeTrainAI | the runtime of the last AI training cycle in seconds |
| runTimeLastAPIAnswer | the last response time of the radiation data API retrieval to a request in seconds |
| runTimeLastAPIProc | the last process time for processing the received radiation data API data |
| SunMinutes_Remain | the remaining minutes until sunset of the current day |
| SunHours_Remain | the remaining hours until sunset of the current day |
| todayConsumption | the energy consumption of the house on the current day |
| todayNotOwnerConsumption | the energy consumption on the current day that cannot be allocated to the registered consumers |
| todayConsumptionForecastDay | Consumption forecast for the current day |
| todayConsumptionForecast | Consumption forecast per hour of the current day (01-24) |
| todayConForecastTillSunset | Consumption forecast from current hour to hour before sunset |
| todayDoneAPIcalls | the number of radiation data API calls executed on the current day |
| todayDoneAPIrequests | the number of radiation data API requests executed on the current day |
| todayGridConsumption | the energy drawn from the public grid on the current day |
| todayGridFeedIn | PV energy fed into the public grid on the current day |
| todayMaxAPIcalls | the maximum possible number of radiation data API calls. |
| A call can contain multiple API requests. | |
| todayRemainingAPIcalls | the number of radiation data API calls still possible on the current day |
| todayRemainingAPIrequests | the number of radiation data API requests still possible on the current day |
| todayBatIn_XX | the energy charged into the battery XX on the current day |
| todayBatInSum | Total energy charged in all batteries on the current day |
| todayBatOut_XX | the energy taken from the battery XX on the current day |
| todayBatOutSum | Total energy drawn from all batteries on the current day |
| tomorrowConsumptionForecast | Consumption forecast per hour of the coming day (01-24) |
| BatPowerIn_Sum | the sum of the current battery charging power of all defined battery devices |
| BatPowerOut_Sum | the sum of the current battery discharge power of all defined battery devices |
| BatWeightedTotalSOC | the resulting (weighted) SOC across all installed batteries in % |
| allStringsFullfilled | Fulfillment status of error-free generation of all strings |
| conForecastTillNextSunrise | Consumption forecast from current hour to the coming sunrise |
| currentAPIinterval | the current polling interval of the selected radiation data API in seconds |
| currentRunMtsConsumer_XX | the running time (minutes) of the consumer "XX" since the last switch-on. (last running cycle) |
| dayAfterTomorrowPVforecast | provides the forecast of PV generation for the day after tomorrow (if available) without autocorrection (raw data) |
| daysUntilBatteryCare_XX | Days until the next battery XX maintenance (reaching the charge 'maxSoC' from attribute ctrlBatSocManagementXX) |
| lastretrieval_time | the last retrieval time of the selected radiation data API |
| lastretrieval_timestamp | the timestamp of the last retrieval time of the selected radiation data API |
| response_message | the last status message of the selected radiation data API |
| remainingHrsWoChargeRcmdBat_XX | die verbleibende Anzahl Stunden ohne Ladeempfehlung für Batterie XX am aktuellen Tag |
| runTimeAvgDayConsumer_XX | the average running time (minutes) of consumer "XX" on one day |
| runTimeCentralTask | the runtime of the last SolarForecast interval (total process) in seconds |
| runTimeTrainAI | the runtime of the last AI training cycle in seconds |
| runTimeLastAPIAnswer | the last response time of the radiation data API retrieval to a request in seconds |
| runTimeLastAPIProc | the last process time for processing the received radiation data API data |
| SunMinutes_Remain | the remaining minutes until sunset of the current day |
| SunHours_Remain | the remaining hours until sunset of the current day |
| todayConsumption | the energy consumption of the house on the current day |
| todayNotOwnerConsumption | the energy consumption on the current day that cannot be allocated to the registered consumers |
| todayConsumptionForecastDay | Consumption forecast for the current day |
| todayConsumptionForecast | Consumption forecast per hour of the current day (01-24) |
| todayConForecastTillSunset | Consumption forecast from current hour to hour before sunset |
| todayDoneAPIcalls | the number of radiation data API calls executed on the current day |
| todayDoneAPIrequests | the number of radiation data API requests executed on the current day |
| todayGridConsumption | the energy drawn from the public grid on the current day |
| todayGridFeedIn | PV energy fed into the public grid on the current day |
| todayMaxAPIcalls | the maximum possible number of radiation data API calls. |
| A call can contain multiple API requests. | |
| todayRemainingAPIcalls | the number of radiation data API calls still possible on the current day |
| todayRemainingAPIrequests | the number of radiation data API requests still possible on the current day |
| todayBatIn_XX | the energy charged into the battery XX on the current day |
| todayBatInSum | Total energy charged in all batteries on the current day |
| todayBatOut_XX | the energy taken from the battery XX on the current day |
| todayBatOutSum | Total energy drawn from all batteries on the current day |
| tomorrowConsumptionForecast | Consumption forecast per hour of the coming day (01-24) |
| BatPowerIn_Sum | die Summe der momentanen Batterieladeleistung aller definierten Batterie Geräte |
| BatPowerOut_Sum | die Summe der momentanen Batterieentladeleistung aller definierten Batterie Geräte |
| BatWeightedTotalSOC | der resultierende (gewichtete) SOC über alle installierten Batterien in % |
| allStringsFullfilled | Erfüllungsstatus der fehlerfreien Generierung aller Strings |
| conForecastTillNextSunrise | Verbrauchsprognose von aktueller Stunde bis zum kommenden Sonnenaufgang |
| currentAPIinterval | das aktuelle Abrufintervall der gewählten Strahlungsdaten-API in Sekunden |
| currentRunMtsConsumer_XX | die Laufzeit (Minuten) des Verbrauchers "XX" seit dem letzten Einschalten. (letzter Laufzyklus) |
| dayAfterTomorrowPVforecast | liefert die Vorhersage der PV Erzeugung für Übermorgen (sofern verfügbar) ohne Autokorrektur (Rohdaten). |
| daysUntilBatteryCare_XX | Tage bis zur nächsten Batterie XX Pflege (Erreichen der Ladung 'maxSoC' aus Attribut ctrlBatSocManagementXX) |
| lastretrieval_time | der letzte Abrufzeitpunkt der gewählten Strahlungsdaten-API |
| lastretrieval_timestamp | der Timestamp der letzen Abrufzeitpunkt der gewählten Strahlungsdaten-API |
| response_message | die letzte Statusmeldung der gewählten Strahlungsdaten-API |
| runTimeAvgDayConsumer_XX | die durchschnittliche Laufzeit (Minuten) des Verbrauchers "XX" an einem Tag |
| runTimeCentralTask | die Laufzeit des letzten SolarForecast Intervalls (Gesamtprozess) in Sekunden |
| runTimeTrainAI | die Laufzeit des letzten KI Trainingszyklus in Sekunden |
| runTimeLastAPIAnswer | die letzte Antwortzeit des Strahlungsdaten-API Abrufs auf einen Request in Sekunden |
| runTimeLastAPIProc | die letzte Prozesszeit zur Verarbeitung der empfangenen Strahlungsdaten-API Daten |
| SunMinutes_Remain | die verbleibenden Minuten bis Sonnenuntergang des aktuellen Tages |
| SunHours_Remain | die verbleibenden Stunden bis Sonnenuntergang des aktuellen Tages |
| todayConsumption | der Energieverbrauch des Hauses am aktuellen Tag |
| todayNotOwnerConsumption | der Energieverbrauch am aktuellen Tag, der den registrierten Verbrauchern nicht zugeordnet werden kann |
| todayConsumptionForecastDay | Verbrauchsprognose für den aktuellen Tag |
| todayConsumptionForecast | Verbrauchsprognose pro Stunde des aktuellen Tages (01-24) |
| todayConForecastTillSunset | Verbrauchsprognose von aktueller Stunde bis Stunde vor Sonnenuntergang |
| todayDoneAPIcalls | die Anzahl der am aktuellen Tag ausgeführten Strahlungsdaten-API Calls |
| todayDoneAPIrequests | die Anzahl der am aktuellen Tag ausgeführten Strahlungsdaten-API Requests |
| todayGridConsumption | die aus dem öffentlichen Netz bezogene Energie am aktuellen Tag |
| todayGridFeedIn | die in das öffentliche Netz eingespeiste PV Energie am aktuellen Tag |
| todayMaxAPIcalls | die maximal mögliche Anzahl Strahlungsdaten-API Calls. |
| Ein Call kann mehrere API Requests enthalten. | |
| todayRemainingAPIcalls | die Anzahl der am aktuellen Tag noch möglichen Strahlungsdaten-API Calls |
| todayRemainingAPIrequests | die Anzahl der am aktuellen Tag noch möglichen Strahlungsdaten-API Requests |
| todayBatIn_XX | die am aktuellen Tag in die Batterie XX geladene Energie |
| todayBatInSum | Summe der am aktuellen Tag in alle Batterien geladene Energie |
| todayBatOut_XX | die am aktuellen Tag aus der Batterie XX entnommene Energie |
| todayBatOutSum | Summe der am aktuellen Tag aus allen Batterien entnommene Energie |
| tomorrowConsumptionForecast | Verbrauchsprognose pro Stunde des kommenden Tages (01-24) |
| BatPowerIn_Sum | die Summe der momentanen Batterieladeleistung aller definierten Batterie Geräte |
| BatPowerOut_Sum | die Summe der momentanen Batterieentladeleistung aller definierten Batterie Geräte |
| BatWeightedTotalSOC | der resultierende (gewichtete) SOC über alle installierten Batterien in % |
| allStringsFullfilled | Erfüllungsstatus der fehlerfreien Generierung aller Strings |
| conForecastTillNextSunrise | Verbrauchsprognose von aktueller Stunde bis zum kommenden Sonnenaufgang |
| currentAPIinterval | das aktuelle Abrufintervall der gewählten Strahlungsdaten-API in Sekunden |
| currentRunMtsConsumer_XX | die Laufzeit (Minuten) des Verbrauchers "XX" seit dem letzten Einschalten. (letzter Laufzyklus) |
| dayAfterTomorrowPVforecast | liefert die Vorhersage der PV Erzeugung für Übermorgen (sofern verfügbar) ohne Autokorrektur (Rohdaten). |
| daysUntilBatteryCare_XX | Tage bis zur nächsten Batterie XX Pflege (Erreichen der Ladung 'maxSoC' aus Attribut ctrlBatSocManagementXX) |
| lastretrieval_time | der letzte Abrufzeitpunkt der gewählten Strahlungsdaten-API |
| lastretrieval_timestamp | der Timestamp der letzen Abrufzeitpunkt der gewählten Strahlungsdaten-API |
| response_message | die letzte Statusmeldung der gewählten Strahlungsdaten-API |
| remainingHrsWoChargeRcmdBat_XX | die verbleibende Anzahl Stunden ohne Ladeempfehlung für Batterie XX am aktuellen Tag |
| runTimeAvgDayConsumer_XX | die durchschnittliche Laufzeit (Minuten) des Verbrauchers "XX" an einem Tag |
| runTimeCentralTask | die Laufzeit des letzten SolarForecast Intervalls (Gesamtprozess) in Sekunden |
| runTimeTrainAI | die Laufzeit des letzten KI Trainingszyklus in Sekunden |
| runTimeLastAPIAnswer | die letzte Antwortzeit des Strahlungsdaten-API Abrufs auf einen Request in Sekunden |
| runTimeLastAPIProc | die letzte Prozesszeit zur Verarbeitung der empfangenen Strahlungsdaten-API Daten |
| SunMinutes_Remain | die verbleibenden Minuten bis Sonnenuntergang des aktuellen Tages |
| SunHours_Remain | die verbleibenden Stunden bis Sonnenuntergang des aktuellen Tages |
| todayConsumption | der Energieverbrauch des Hauses am aktuellen Tag |
| todayNotOwnerConsumption | der Energieverbrauch am aktuellen Tag, der den registrierten Verbrauchern nicht zugeordnet werden kann |
| todayConsumptionForecastDay | Verbrauchsprognose für den aktuellen Tag |
| todayConsumptionForecast | Verbrauchsprognose pro Stunde des aktuellen Tages (01-24) |
| todayConForecastTillSunset | Verbrauchsprognose von aktueller Stunde bis Stunde vor Sonnenuntergang |
| todayDoneAPIcalls | die Anzahl der am aktuellen Tag ausgeführten Strahlungsdaten-API Calls |
| todayDoneAPIrequests | die Anzahl der am aktuellen Tag ausgeführten Strahlungsdaten-API Requests |
| todayGridConsumption | die aus dem öffentlichen Netz bezogene Energie am aktuellen Tag |
| todayGridFeedIn | die in das öffentliche Netz eingespeiste PV Energie am aktuellen Tag |
| todayMaxAPIcalls | die maximal mögliche Anzahl Strahlungsdaten-API Calls. |
| Ein Call kann mehrere API Requests enthalten. | |
| todayRemainingAPIcalls | die Anzahl der am aktuellen Tag noch möglichen Strahlungsdaten-API Calls |
| todayRemainingAPIrequests | die Anzahl der am aktuellen Tag noch möglichen Strahlungsdaten-API Requests |
| todayBatIn_XX | die am aktuellen Tag in die Batterie XX geladene Energie |
| todayBatInSum | Summe der am aktuellen Tag in alle Batterien geladene Energie |
| todayBatOut_XX | die am aktuellen Tag aus der Batterie XX entnommene Energie |
| todayBatOutSum | Summe der am aktuellen Tag aus allen Batterien entnommene Energie |
| tomorrowConsumptionForecast | Verbrauchsprognose pro Stunde des kommenden Tages (01-24) |