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

76_SolarForecast.pm: contrib 0.56.0

git-svn-id: https://svn.fhem.de/fhem/trunk@24954 2b470e98-0d58-463d-a4d8-8e2adae1ed80
This commit is contained in:
nasseeder1 2021-09-11 16:46:13 +00:00
parent f4a82eea92
commit 350aa4e64a

View File

@ -2654,7 +2654,7 @@ sub _manageConsumerData {
if(!$paread){ if(!$paread){
my $timespan = $t - ConsumerVal ($hash, $c, "old_etottime", $t); my $timespan = $t - ConsumerVal ($hash, $c, "old_etottime", $t);
my $delta = $etot - ConsumerVal ($hash, $c, "old_etotal", $etot); my $delta = $etot - ConsumerVal ($hash, $c, "old_etotal", $etot);
$pcurr = sprintf("%.6f", $delta / (3600 * $timespan)) if($delta > 0); # Einheitenformel beachten !!: W = Wh / (3600 * s) $pcurr = sprintf("%.6f", $delta / (3600 * $timespan)) if($delta > 0); # Einheitenformel beachten !!: W = Wh / (3600 * s)
$data{$type}{$name}{consumers}{$c}{old_etotal} = $etot; $data{$type}{$name}{consumers}{$c}{old_etotal} = $etot;
$data{$type}{$name}{consumers}{$c}{old_etottime} = $t; $data{$type}{$name}{consumers}{$c}{old_etottime} = $t;
@ -2711,8 +2711,7 @@ sub _manageConsumerData {
my $starthour = strftime "%H", localtime(ConsumerVal ($hash, $c, "startTime", $t)); my $starthour = strftime "%H", localtime(ConsumerVal ($hash, $c, "startTime", $t));
if($chour eq $starthour) { if($chour eq $starthour) {
my $runtime = ($t - ConsumerVal ($hash, $c, "startTime", $t)) / 60; # in Minuten ! (gettimeofday sind ms !) $data{$type}{$name}{consumers}{$c}{minutesOn} = ($t - ConsumerVal ($hash, $c, "startTime", $t)) / 60; # in Minuten ! (gettimeofday sind ms !)
$data{$type}{$name}{consumers}{$c}{minutesOn} = ConsumerVal ($hash, $c, "minutesOn", 0) + $runtime;
} }
else { # neue Stunde hat begonnen else { # neue Stunde hat begonnen
$data{$type}{$name}{consumers}{$c}{startTime} = timestringToTimestamp ($date." ".sprintf("%02d",$chour).":00:00"); $data{$type}{$name}{consumers}{$c}{startTime} = timestringToTimestamp ($date." ".sprintf("%02d",$chour).":00:00");