76_SolarForecast: version 1.54.2, more debug info

git-svn-id: https://svn.fhem.de/fhem/trunk@30132 2b470e98-0d58-463d-a4d8-8e2adae1ed80
This commit is contained in:
DS_Starter
2025-07-18 19:56:47 +00:00
parent 1c6f1de531
commit 4acdffdcac
3 changed files with 37 additions and 24 deletions

View File

@@ -1,5 +1,6 @@
# Add changes at the top of the list. Keep it in ASCII, and 80-char wide. # 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 # Do not insert empty lines here, update check depends on it
- change: 76_SolarForecast: version 1.54.2, more debug info
- feature: 72_FRITZBOX: Vorbereitung auf Fritz!OS 8.10 - feature: 72_FRITZBOX: Vorbereitung auf Fritz!OS 8.10
get <name> callApifromList <data.lua|query.lua|tr064|javascript> get <name> callApifromList <data.lua|query.lua|tr064|javascript>
enableCPUInfo <0 | (-1) | 1 | 2 ... | 24> enableCPUInfo <0 | (-1) | 1 | 2 ... | 24>

View File

@@ -160,6 +160,7 @@ BEGIN {
# Versions History intern # Versions History intern
my %vNotesIntern = ( my %vNotesIntern = (
"1.54.2" => "18.07.2025 _createSummaries: add debug infos ",
"1.54.1" => "08.07.2025 userExit: new coding, __createReduceIcon: fix Wide character in syswrite - https://forum.fhem.de/index.php?msg=1344368 ". "1.54.1" => "08.07.2025 userExit: new coding, __createReduceIcon: fix Wide character in syswrite - https://forum.fhem.de/index.php?msg=1344368 ".
"_setattrKeyVal: optimize function between execute from FHEMWEB and Commandline ". "_setattrKeyVal: optimize function between execute from FHEMWEB and Commandline ".
"_beamGraphicFirstHour, _beamGraphicRemainingHours: decimal places according to the setting of the energy unit ". "_beamGraphicFirstHour, _beamGraphicRemainingHours: decimal places according to the setting of the energy unit ".
@@ -11805,8 +11806,8 @@ sub _createSummaries {
my $day = $paref->{day}; my $day = $paref->{day};
my $chour = $paref->{chour}; # aktuelle Stunde my $chour = $paref->{chour}; # aktuelle Stunde
my $minute = $paref->{minute}; # aktuelle Minute my $minute = $paref->{minute}; # aktuelle Minute
my $debug = $paref->{debug};
my $hash = $defs{$name};
$minute = int ($minute) + 1; # Minute Range umsetzen auf 1 bis 60 $minute = int ($minute) + 1; # Minute Range umsetzen auf 1 bis 60
## Initialisierung ## Initialisierung
@@ -11826,9 +11827,9 @@ sub _createSummaries {
my $tdConFcTillSunset = 0; my $tdConFcTillSunset = 0;
my $remainminutes = 60 - $minute; # verbleibende Minuten der aktuellen Stunde my $remainminutes = 60 - $minute; # verbleibende Minuten der aktuellen Stunde
my $hour00pvfc = NexthoursVal ($hash, "NextHour00", 'pvfc', 0) / 60 * $remainminutes; my $hour00pvfc = NexthoursVal ($name, "NextHour00", 'pvfc', 0) / 60 * $remainminutes;
my $hour00confc = NexthoursVal ($hash, "NextHour00", 'confc', 0); my $hour00confc = NexthoursVal ($name, "NextHour00", 'confc', 0);
my $hod00 = NexthoursVal ($hash, "NextHour00", 'hourofday', 0); my $hod00 = NexthoursVal ($name, "NextHour00", 'hourofday', 0);
$hour00pvfc = max (0, $hour00pvfc); # PV Prognose darf nicht negativ sein $hour00pvfc = max (0, $hour00pvfc); # PV Prognose darf nicht negativ sein
$hour00confc = max (0, $hour00confc); # Verbrauchsprognose darf nicht negativ sein $hour00confc = max (0, $hour00confc); # Verbrauchsprognose darf nicht negativ sein
@@ -11858,11 +11859,11 @@ sub _createSummaries {
for my $h (1..47) { for my $h (1..47) {
my $idx = sprintf "%02d", $h; my $idx = sprintf "%02d", $h;
my $pvfc = NexthoursVal ($hash, "NextHour".$idx, 'pvfc', 0); my $pvfc = NexthoursVal ($name, "NextHour".$idx, 'pvfc', 0);
my $confc = NexthoursVal ($hash, "NextHour".$idx, 'confc', 0); my $confc = NexthoursVal ($name, "NextHour".$idx, 'confc', 0);
my $istdy = NexthoursVal ($hash, "NextHour".$idx, 'today', 0); my $istdy = NexthoursVal ($name, "NextHour".$idx, 'today', 0);
my $don = NexthoursVal ($hash, "NextHour".$idx, 'DoN', 0); my $don = NexthoursVal ($name, "NextHour".$idx, 'DoN', 0);
my $hod = NexthoursVal ($hash, "NextHour".$idx, 'hourofday', 0); my $hod = NexthoursVal ($name, "NextHour".$idx, 'hourofday', 0);
$pvfc = max (0, $pvfc); # PV Prognose darf nicht negativ sein $pvfc = max (0, $pvfc); # PV Prognose darf nicht negativ sein
$confc = max (0, $confc); # Verbrauchsprognose darf nicht negativ sein $confc = max (0, $confc); # Verbrauchsprognose darf nicht negativ sein
@@ -11951,7 +11952,7 @@ sub _createSummaries {
for my $pn (1..MAXPRODUCER) { # Erzeugung sonstiger Producer hinzufügen for my $pn (1..MAXPRODUCER) { # Erzeugung sonstiger Producer hinzufügen
$pn = sprintf "%02d", $pn; $pn = sprintf "%02d", $pn;
$othprod += ProducerVal ($hash, $pn, 'pgeneration', 0); $othprod += ProducerVal ($name, $pn, 'pgeneration', 0);
} }
my $consumption = int ($pv2node + $othprod - $gfeedin + $gcon - $batin + $batout); # ohne PV2Grid my $consumption = int ($pv2node + $othprod - $gfeedin + $gcon - $batin + $batout); # ohne PV2Grid
@@ -11961,6 +11962,11 @@ sub _createSummaries {
my $surplus = int ($pv2node - $pv2grid + $othprod - $consumption); # aktueller Überschuß my $surplus = int ($pv2node - $pv2grid + $othprod - $consumption); # aktueller Überschuß
$surplus = 0 if($surplus < 0); # wegen Vergleich nompower vs. surplus $surplus = 0 if($surplus < 0); # wegen Vergleich nompower vs. surplus
if ($debug =~ /collectData/xs) {
Log3 ($name, 1, "$name DEBUG> current Power values -> PV2Node: $pv2node W, PV2Grid: $pv2grid, Other: $othprod W, GridIn: $gfeedin W, GridCon: $gcon W, BatIn: $batin W, BatOut: $batout W");
Log3 ($name, 1, "$name DEBUG> current Consumption result -> $consumption W");
}
my $selfconsumptionrate = 0; my $selfconsumptionrate = 0;
my $autarkyrate = 0; my $autarkyrate = 0;
my $divi = $selfconsumption + $batout + $gcon; my $divi = $selfconsumption + $batout + $gcon;
@@ -14448,7 +14454,7 @@ sub _saveEnergyConsumption {
} }
if ($debug =~ /collectData/xs) { if ($debug =~ /collectData/xs) {
Log3 ($name, 1, "$name DEBUG> EnergyConsumption input -> PV: $pvrl, PP: $ppreal, GridIn: $gfeedin, GridCon: $gcon, BatIn: $batin, BatOut: $batout"); Log3 ($name, 1, "$name DEBUG> EnergyConsumption input -> PV: $pvrl Wh, PP: $ppreal Wh, GridIn: $gfeedin Wh, GridCon: $gcon Wh, BatIn: $batin Wh, BatOut: $batout Wh");
Log3 ($name, 1, "$name DEBUG> EnergyConsumption result -> $con Wh"); Log3 ($name, 1, "$name DEBUG> EnergyConsumption result -> $con Wh");
} }

View File

@@ -160,6 +160,7 @@ BEGIN {
# Versions History intern # Versions History intern
my %vNotesIntern = ( my %vNotesIntern = (
"1.54.2" => "18.07.2025 _createSummaries: add debug infos ",
"1.54.1" => "08.07.2025 userExit: new coding, __createReduceIcon: fix Wide character in syswrite - https://forum.fhem.de/index.php?msg=1344368 ". "1.54.1" => "08.07.2025 userExit: new coding, __createReduceIcon: fix Wide character in syswrite - https://forum.fhem.de/index.php?msg=1344368 ".
"_setattrKeyVal: optimize function between execute from FHEMWEB and Commandline ". "_setattrKeyVal: optimize function between execute from FHEMWEB and Commandline ".
"_beamGraphicFirstHour, _beamGraphicRemainingHours: decimal places according to the setting of the energy unit ". "_beamGraphicFirstHour, _beamGraphicRemainingHours: decimal places according to the setting of the energy unit ".
@@ -11805,8 +11806,8 @@ sub _createSummaries {
my $day = $paref->{day}; my $day = $paref->{day};
my $chour = $paref->{chour}; # aktuelle Stunde my $chour = $paref->{chour}; # aktuelle Stunde
my $minute = $paref->{minute}; # aktuelle Minute my $minute = $paref->{minute}; # aktuelle Minute
my $debug = $paref->{debug};
my $hash = $defs{$name};
$minute = int ($minute) + 1; # Minute Range umsetzen auf 1 bis 60 $minute = int ($minute) + 1; # Minute Range umsetzen auf 1 bis 60
## Initialisierung ## Initialisierung
@@ -11826,9 +11827,9 @@ sub _createSummaries {
my $tdConFcTillSunset = 0; my $tdConFcTillSunset = 0;
my $remainminutes = 60 - $minute; # verbleibende Minuten der aktuellen Stunde my $remainminutes = 60 - $minute; # verbleibende Minuten der aktuellen Stunde
my $hour00pvfc = NexthoursVal ($hash, "NextHour00", 'pvfc', 0) / 60 * $remainminutes; my $hour00pvfc = NexthoursVal ($name, "NextHour00", 'pvfc', 0) / 60 * $remainminutes;
my $hour00confc = NexthoursVal ($hash, "NextHour00", 'confc', 0); my $hour00confc = NexthoursVal ($name, "NextHour00", 'confc', 0);
my $hod00 = NexthoursVal ($hash, "NextHour00", 'hourofday', 0); my $hod00 = NexthoursVal ($name, "NextHour00", 'hourofday', 0);
$hour00pvfc = max (0, $hour00pvfc); # PV Prognose darf nicht negativ sein $hour00pvfc = max (0, $hour00pvfc); # PV Prognose darf nicht negativ sein
$hour00confc = max (0, $hour00confc); # Verbrauchsprognose darf nicht negativ sein $hour00confc = max (0, $hour00confc); # Verbrauchsprognose darf nicht negativ sein
@@ -11858,11 +11859,11 @@ sub _createSummaries {
for my $h (1..47) { for my $h (1..47) {
my $idx = sprintf "%02d", $h; my $idx = sprintf "%02d", $h;
my $pvfc = NexthoursVal ($hash, "NextHour".$idx, 'pvfc', 0); my $pvfc = NexthoursVal ($name, "NextHour".$idx, 'pvfc', 0);
my $confc = NexthoursVal ($hash, "NextHour".$idx, 'confc', 0); my $confc = NexthoursVal ($name, "NextHour".$idx, 'confc', 0);
my $istdy = NexthoursVal ($hash, "NextHour".$idx, 'today', 0); my $istdy = NexthoursVal ($name, "NextHour".$idx, 'today', 0);
my $don = NexthoursVal ($hash, "NextHour".$idx, 'DoN', 0); my $don = NexthoursVal ($name, "NextHour".$idx, 'DoN', 0);
my $hod = NexthoursVal ($hash, "NextHour".$idx, 'hourofday', 0); my $hod = NexthoursVal ($name, "NextHour".$idx, 'hourofday', 0);
$pvfc = max (0, $pvfc); # PV Prognose darf nicht negativ sein $pvfc = max (0, $pvfc); # PV Prognose darf nicht negativ sein
$confc = max (0, $confc); # Verbrauchsprognose darf nicht negativ sein $confc = max (0, $confc); # Verbrauchsprognose darf nicht negativ sein
@@ -11951,7 +11952,7 @@ sub _createSummaries {
for my $pn (1..MAXPRODUCER) { # Erzeugung sonstiger Producer hinzufügen for my $pn (1..MAXPRODUCER) { # Erzeugung sonstiger Producer hinzufügen
$pn = sprintf "%02d", $pn; $pn = sprintf "%02d", $pn;
$othprod += ProducerVal ($hash, $pn, 'pgeneration', 0); $othprod += ProducerVal ($name, $pn, 'pgeneration', 0);
} }
my $consumption = int ($pv2node + $othprod - $gfeedin + $gcon - $batin + $batout); # ohne PV2Grid my $consumption = int ($pv2node + $othprod - $gfeedin + $gcon - $batin + $batout); # ohne PV2Grid
@@ -11961,6 +11962,11 @@ sub _createSummaries {
my $surplus = int ($pv2node - $pv2grid + $othprod - $consumption); # aktueller Überschuß my $surplus = int ($pv2node - $pv2grid + $othprod - $consumption); # aktueller Überschuß
$surplus = 0 if($surplus < 0); # wegen Vergleich nompower vs. surplus $surplus = 0 if($surplus < 0); # wegen Vergleich nompower vs. surplus
if ($debug =~ /collectData/xs) {
Log3 ($name, 1, "$name DEBUG> current Power values -> PV2Node: $pv2node W, PV2Grid: $pv2grid, Other: $othprod W, GridIn: $gfeedin W, GridCon: $gcon W, BatIn: $batin W, BatOut: $batout W");
Log3 ($name, 1, "$name DEBUG> current Consumption result -> $consumption W");
}
my $selfconsumptionrate = 0; my $selfconsumptionrate = 0;
my $autarkyrate = 0; my $autarkyrate = 0;
my $divi = $selfconsumption + $batout + $gcon; my $divi = $selfconsumption + $batout + $gcon;
@@ -14448,7 +14454,7 @@ sub _saveEnergyConsumption {
} }
if ($debug =~ /collectData/xs) { if ($debug =~ /collectData/xs) {
Log3 ($name, 1, "$name DEBUG> EnergyConsumption input -> PV: $pvrl, PP: $ppreal, GridIn: $gfeedin, GridCon: $gcon, BatIn: $batin, BatOut: $batout"); Log3 ($name, 1, "$name DEBUG> EnergyConsumption input -> PV: $pvrl Wh, PP: $ppreal Wh, GridIn: $gfeedin Wh, GridCon: $gcon Wh, BatIn: $batin Wh, BatOut: $batout Wh");
Log3 ($name, 1, "$name DEBUG> EnergyConsumption result -> $con Wh"); Log3 ($name, 1, "$name DEBUG> EnergyConsumption result -> $con Wh");
} }