2
0
mirror of https://github.com/fhem/fhem-mirror.git synced 2025-04-16 10:46:03 +00:00

76_SolarForecast.pm: contrib 0.68.4

git-svn-id: https://svn.fhem.de/fhem/trunk@26476 2b470e98-0d58-463d-a4d8-8e2adae1ed80
This commit is contained in:
nasseeder1 2022-10-03 13:32:47 +00:00
parent 16fae5eccc
commit b3749a3ad3

View File

@ -127,7 +127,8 @@ BEGIN {
# Versions History intern # Versions History intern
my %vNotesIntern = ( my %vNotesIntern = (
"0.68.4 "=> "03.10.2022 do ___setLastAPIcallKeyData if response_status, generate events of Today_MaxPVforecast.* in every cycle ". "0.68.4 "=> "03.10.2022 do ___setLastAPIcallKeyData if response_status, generate events of Today_MaxPVforecast.* in every cycle ".
"add SolCast section in _graphicHeader, change default colors and settings, new reading Today_PVreal ", "add SolCast section in _graphicHeader, change default colors and settings, new reading Today_PVreal ".
"fix sub __setConsRcmdState ",
"0.68.3 "=> "19.09.2022 fix calculation of currentAPIinterval ", "0.68.3 "=> "19.09.2022 fix calculation of currentAPIinterval ",
"0.68.2 "=> "18.09.2022 fix function _setpvCorrectionFactorAuto, new attr optimizeSolCastAPIreqInterval, change createReadingsFromArray ", "0.68.2 "=> "18.09.2022 fix function _setpvCorrectionFactorAuto, new attr optimizeSolCastAPIreqInterval, change createReadingsFromArray ",
"0.68.1 "=> "17.09.2022 new readings Today_MaxPVforecast, Today_MaxPVforecastTime ", "0.68.1 "=> "17.09.2022 new readings Today_MaxPVforecast, Today_MaxPVforecastTime ",
@ -4651,17 +4652,19 @@ sub __setConsRcmdState {
my $paref = shift; my $paref = shift;
my $hash = $paref->{hash}; my $hash = $paref->{hash};
my $name = $paref->{name}; my $name = $paref->{name};
my $c = $paref->{consumer}; # aktueller Unixtimestamp my $c = $paref->{consumer}; # aktueller Unixtimestamp
my $daref = $paref->{daref}; my $daref = $paref->{daref};
my $type = $hash->{TYPE}; my $type = $hash->{TYPE};
my $surplus = CurrentVal ($hash, "surplus", 0); # aktueller Energieüberschuß my $surplus = CurrentVal ($hash, "surplus", 0); # aktueller Energieüberschuß
my $nompower = ConsumerVal ($hash, $c, "power", 0); # Consumer nominale Leistungsaufnahme (W) my $ccons = CurrentVal ($hash, 'consumption', 0); # aktueller Verbrauch
my $ccr = AttrVal ($name, 'createConsumptionRecReadings', ''); # Liste der Consumer für die ConsumptionRecommended-Readings erstellt werden sollen my $nompower = ConsumerVal ($hash, $c, "power", 0); # Consumer nominale Leistungsaufnahme (W)
my $ccr = AttrVal ($name, 'createConsumptionRecReadings', ''); # Liste der Consumer für die ConsumptionRecommended-Readings erstellt werden sollen
my $rescons = isConsumerPhysOn($hash, $c) ? $ccons : $ccons + $nompower; # resultierender Verbauch nach Einschaltung Consumer
if (!$nompower || $surplus >= $nompower) { if (!$nompower || $surplus + $ccons >= $rescons) {
$data{$type}{$name}{consumers}{$c}{isConsumptionRecommended} = 1; # Einschalten des Consumers günstig $data{$type}{$name}{consumers}{$c}{isConsumptionRecommended} = 1; # Einschalten des Consumers günstig
} }
else { else {
$data{$type}{$name}{consumers}{$c}{isConsumptionRecommended} = 0; $data{$type}{$name}{consumers}{$c}{isConsumptionRecommended} = 0;
@ -8663,7 +8666,7 @@ sub isConsumerPhysOn {
return 0; return 0;
} }
my $reg = ConsumerVal ($hash, $c, "onreg", "on"); my $reg = ConsumerVal ($hash, $c, "onreg", "on");
my $rswstate = ConsumerVal ($hash, $c, "rswstate", "state"); # Reading mit Schaltstatus my $rswstate = ConsumerVal ($hash, $c, "rswstate", "state"); # Reading mit Schaltstatus
my $swstate = ReadingsVal ($cname, $rswstate, "undef"); my $swstate = ReadingsVal ($cname, $rswstate, "undef");