mirror of
https://github.com/fhem/fhem-mirror.git
synced 2025-01-31 06:39:11 +00:00
76_SolarForecast: contrib 0.79.0
git-svn-id: https://svn.fhem.de/fhem/trunk@27565 2b470e98-0d58-463d-a4d8-8e2adae1ed80
This commit is contained in:
parent
448a3abb64
commit
0502d41553
@ -586,8 +586,6 @@ my %hqtxt = (
|
|||||||
DE => qq{nach} },
|
DE => qq{nach} },
|
||||||
nxtscc => { EN => qq{next SolCast call},
|
nxtscc => { EN => qq{next SolCast call},
|
||||||
DE => qq{nächste SolCast Abfrage} },
|
DE => qq{nächste SolCast Abfrage} },
|
||||||
pstate => { EN => qq{Planning status: <pstate><br>On: <start><br>Off: <stop>},
|
|
||||||
DE => qq{Planungsstatus: <pstate><br>Ein: <start><br>Aus: <stop>} },
|
|
||||||
fulfd => { EN => qq{fulfilled},
|
fulfd => { EN => qq{fulfilled},
|
||||||
DE => qq{erfüllt} },
|
DE => qq{erfüllt} },
|
||||||
pmtp => { EN => qq{produced more than predicted :-D},
|
pmtp => { EN => qq{produced more than predicted :-D},
|
||||||
@ -608,6 +606,8 @@ my %hqtxt = (
|
|||||||
DE => qq{Sieht ganz gut aus 😐, die Anlagenkonfiguration ist prinzipiell in Ordnung. Bitte beachten Sie die Warnungen (<W>).} },
|
DE => qq{Sieht ganz gut aus 😐, die Anlagenkonfiguration ist prinzipiell in Ordnung. Bitte beachten Sie die Warnungen (<W>).} },
|
||||||
strnok => { EN => qq{Oh no 🙁, the system configuration is incorrect. Please check the settings and notes!},
|
strnok => { EN => qq{Oh no 🙁, the system configuration is incorrect. Please check the settings and notes!},
|
||||||
DE => qq{Oh nein 😢, die Anlagenkonfiguration ist fehlerhaft. Bitte überprüfen Sie die Einstellungen und Hinweise!} },
|
DE => qq{Oh nein 😢, die Anlagenkonfiguration ist fehlerhaft. Bitte überprüfen Sie die Einstellungen und Hinweise!} },
|
||||||
|
pstate => { EN => qq{Planning status: <pstate><br>On: <start><br>Off: <stop><br>Remaining lock time: <RLT> seconds},
|
||||||
|
DE => qq{Planungsstatus: <pstate><br>Ein: <start><br>Aus: <stop><br>verbleibende Sperrzeit: <RLT> Sekunden} },
|
||||||
);
|
);
|
||||||
|
|
||||||
my %htitles = ( # Hash Hilfetexte (Mouse Over)
|
my %htitles = ( # Hash Hilfetexte (Mouse Over)
|
||||||
@ -641,8 +641,6 @@ my %htitles = (
|
|||||||
DE => qq{Aktuelle Zeit liegt innerhalb der Verbrauchsplanung, Vorrangladen Batterie ist aktiv} },
|
DE => qq{Aktuelle Zeit liegt innerhalb der Verbrauchsplanung, Vorrangladen Batterie ist aktiv} },
|
||||||
connorec => { EN => qq{Consumption planning is outside current time\n(Click for immediate planning)},
|
connorec => { EN => qq{Consumption planning is outside current time\n(Click for immediate planning)},
|
||||||
DE => qq{Verbrauchsplanung liegt ausserhalb aktueller Zeit\n(Klick für sofortige Einplanung)} },
|
DE => qq{Verbrauchsplanung liegt ausserhalb aktueller Zeit\n(Klick für sofortige Einplanung)} },
|
||||||
pstate => { EN => qq{Planning status: <pstate>\n\nOn: <start>\nOff: <stop>},
|
|
||||||
DE => qq{Planungsstatus: <pstate>\n\nEin: <start>\nAus: <stop>} },
|
|
||||||
akorron => { EN => qq{Enable auto correction with:\nset <NAME> pvCorrectionFactor_Auto on},
|
akorron => { EN => qq{Enable auto correction with:\nset <NAME> pvCorrectionFactor_Auto on},
|
||||||
DE => qq{Einschalten Autokorrektur mit:\nset <NAME> pvCorrectionFactor_Auto on} },
|
DE => qq{Einschalten Autokorrektur mit:\nset <NAME> pvCorrectionFactor_Auto on} },
|
||||||
splus => { EN => qq{PV surplus sufficient},
|
splus => { EN => qq{PV surplus sufficient},
|
||||||
@ -665,6 +663,8 @@ my %htitles = (
|
|||||||
DE => qq{API Schlüssel existiert nicht} },
|
DE => qq{API Schlüssel existiert nicht} },
|
||||||
scrsdne => { EN => qq{Rooftop site does not exist or is not accessible},
|
scrsdne => { EN => qq{Rooftop site does not exist or is not accessible},
|
||||||
DE => qq{Rooftop ID existiert nicht oder ist nicht abrufbar} },
|
DE => qq{Rooftop ID existiert nicht oder ist nicht abrufbar} },
|
||||||
|
pstate => { EN => qq{Planning status: <pstate>\n\nOn: <start>\nOff: <stop>\nRemaining lock time: <RLT> seconds},
|
||||||
|
DE => qq{Planungsstatus: <pstate>\n\nEin: <start>\nAus: <stop>\nverbleibende Sperrzeit: <RLT> Sekunden} },
|
||||||
);
|
);
|
||||||
|
|
||||||
my %weather_ids = (
|
my %weather_ids = (
|
||||||
@ -4728,8 +4728,11 @@ sub _manageConsumerData {
|
|||||||
$data{$type}{$name}{consumers}{$c}{state} = $costate;
|
$data{$type}{$name}{consumers}{$c}{state} = $costate;
|
||||||
|
|
||||||
my ($pstate,$starttime,$stoptime) = __getPlanningStateAndTimes ($paref);
|
my ($pstate,$starttime,$stoptime) = __getPlanningStateAndTimes ($paref);
|
||||||
|
my ($iilt,$rlt) = isInLocktime ($paref); # Sperrzeit Status ermitteln
|
||||||
push @$daref, "consumer${c}<>" ."name='$alias' state='$costate' planningstate='$pstate' "; # Consumer Infos
|
my $constate = "name='$alias' state='$costate' planningstate='$pstate'";
|
||||||
|
$constate .= " remainLockTime='$rlt'" if($rlt);
|
||||||
|
|
||||||
|
push @$daref, "consumer${c}<>" .$constate; # Consumer Infos
|
||||||
push @$daref, "consumer${c}_planned_start<>"."$starttime" if($starttime); # Consumer Start geplant
|
push @$daref, "consumer${c}_planned_start<>"."$starttime" if($starttime); # Consumer Start geplant
|
||||||
push @$daref, "consumer${c}_planned_stop<>". "$stoptime" if($stoptime); # Consumer Stop geplant
|
push @$daref, "consumer${c}_planned_stop<>". "$stoptime" if($stoptime); # Consumer Stop geplant
|
||||||
}
|
}
|
||||||
@ -5444,7 +5447,7 @@ sub ___switchConsumerOn {
|
|||||||
($swoffcond,$info,$err) = isAddSwitchOffCond ($hash, $c); # zusätzliche Switch off Bedingung
|
($swoffcond,$info,$err) = isAddSwitchOffCond ($hash, $c); # zusätzliche Switch off Bedingung
|
||||||
Log3 ($name, 1, "$name - $err") if($err);
|
Log3 ($name, 1, "$name - $err") if($err);
|
||||||
|
|
||||||
my $iilt = isInLocktime ($paref); # Sperrzeit Status ermitteln
|
my ($iilt,$rlt) = isInLocktime ($paref); # Sperrzeit Status ermitteln
|
||||||
|
|
||||||
if ($debug =~ /consumerSwitching/x) { # nur für Debugging
|
if ($debug =~ /consumerSwitching/x) { # nur für Debugging
|
||||||
my $cons = CurrentVal ($hash, 'consumption', 0);
|
my $cons = CurrentVal ($hash, 'consumption', 0);
|
||||||
@ -6719,6 +6722,7 @@ sub entryGraphic {
|
|||||||
type => $hash->{TYPE},
|
type => $hash->{TYPE},
|
||||||
ftui => $ftui,
|
ftui => $ftui,
|
||||||
maxhours => $maxhours,
|
maxhours => $maxhours,
|
||||||
|
t => time,
|
||||||
modulo => 1,
|
modulo => 1,
|
||||||
dstyle => qq{style='padding-left: 10px; padding-right: 10px; padding-top: 3px; padding-bottom: 3px; white-space:nowrap;'}, # TD-Style
|
dstyle => qq{style='padding-left: 10px; padding-right: 10px; padding-top: 3px; padding-bottom: 3px; white-space:nowrap;'}, # TD-Style
|
||||||
offset => $offset,
|
offset => $offset,
|
||||||
@ -7421,12 +7425,15 @@ sub _graphicConsumerLegend {
|
|||||||
$paref->{consumer} = $c;
|
$paref->{consumer} = $c;
|
||||||
|
|
||||||
my ($planstate,$starttime,$stoptime) = __getPlanningStateAndTimes ($paref);
|
my ($planstate,$starttime,$stoptime) = __getPlanningStateAndTimes ($paref);
|
||||||
|
my ($iilt,$rlt) = isInLocktime ($paref); # Sperrzeit Status ermitteln
|
||||||
|
|
||||||
my $pstate = $caicon eq "times" ? $hqtxt{pstate}{$lang} : $htitles{pstate}{$lang};
|
my $pstate = $caicon eq "times" ? $hqtxt{pstate}{$lang} : $htitles{pstate}{$lang};
|
||||||
my $surplusinfo = isConsRcmd($hash, $c) ? $htitles{splus}{$lang} : $htitles{nosplus}{$lang};
|
my $surplusinfo = isConsRcmd($hash, $c) ? $htitles{splus}{$lang} : $htitles{nosplus}{$lang};
|
||||||
|
|
||||||
$pstate =~ s/<pstate>/$planstate/xs;
|
$pstate =~ s/<pstate>/$planstate/xs;
|
||||||
$pstate =~ s/<start>/$starttime/xs;
|
$pstate =~ s/<start>/$starttime/xs;
|
||||||
$pstate =~ s/<stop>/$stoptime/xs;
|
$pstate =~ s/<stop>/$stoptime/xs;
|
||||||
|
$pstate =~ s/<RLT>/$rlt/xs;
|
||||||
$pstate =~ s/\s+/ /gxs if($caicon eq "times");
|
$pstate =~ s/\s+/ /gxs if($caicon eq "times");
|
||||||
|
|
||||||
if ($clink) {
|
if ($clink) {
|
||||||
@ -10478,14 +10485,17 @@ sub isInLocktime {
|
|||||||
my $t = $paref->{t};
|
my $t = $paref->{t};
|
||||||
|
|
||||||
my $iilt = 0;
|
my $iilt = 0;
|
||||||
|
my $rlt = 0;
|
||||||
my $clt = ConsumerVal ($hash, $c, 'locktime', 0);
|
my $clt = ConsumerVal ($hash, $c, 'locktime', 0);
|
||||||
my $lot = ConsumerVal ($hash, $c, 'lastAutoOffTs', 0);
|
my $lot = ConsumerVal ($hash, $c, 'lastAutoOffTs', 0);
|
||||||
|
|
||||||
if ($t - $lot <= $clt) {
|
if ($t - $lot <= $clt) {
|
||||||
$iilt = 1;
|
$iilt = 1;
|
||||||
|
$rlt = $clt - ($t - $lot); # remain lock time
|
||||||
}
|
}
|
||||||
|
|
||||||
return $iilt;
|
Log3 ($name, 1, "$name - consumer: $c, time: $t, lastAutoOffTs: $lot, RLT: $rlt");
|
||||||
|
return ($iilt,$rlt);
|
||||||
}
|
}
|
||||||
|
|
||||||
################################################################
|
################################################################
|
||||||
|
Loading…
Reference in New Issue
Block a user